When searching for solutions on Google, many suggest creating a file using the code below, but I tried it and it didn't work for me.#
sudo update-grub || sudo grub2-mkconfig -o /boot/grub2/grub.cfg
On my machine, which is an Amazon EC2 free instance, I couldn't solve the problem using the above code. Instead, I used another DD script below, which worked successfully.
wget -N --no-check-certificate https://down.vpsaff.net/linux/dd/network-reinstall-os.sh && \
chmod +x network-reinstall-os.sh && ./network-reinstall-os.sh
The default username is: root, and the password is: IdcOffer.com
I hope this can help you if you are DDing the system.
Just a reminder, the SSH connection will be disconnected during the installation process, which usually takes about half an hour (so it's not a loss of connection). During this time, you can check the installation process through the online SSH provided by the cloud service provider. If it's not available, please be patient and wait for more than half an hour before reconnecting through SSH.