First, when sh: grub is displayed, type the following code:
Ls will display the current hard disk partition, as my result is
(Hd0) (hd0, 1) (hd0, 5) (hd0, 6)
(Hd0, 1) is a C drive. I installed ubuntu on a D Drive, that is (hd0, 5). In fact, as long as you know which partitions are there, you can try them one by one, the following code is used:
Set root = (hd0, 5) enter
Loopback loop0/ubuntu/disks/root. disk enter
Set root = (loop0) enter
Linux/boot/vmlinuz-2.6.31-14 (TAB key filled) root =/dev/sda5 loop =/ubuntu/disks/root. disk enter
Initrd/boot/initrd. img-2.6.31-14 (TAB key filled) enter
Boot enter
In case of any exceptions, ubuntu can be started normally. After it is started, enter the following code in the terminal:
Sudo update-grub2 enter
Copy grub. cfg in the/boot/grub/directory to the/host/ubuntu/install/boot/grub/directory, and restart ubuntu.
If there is no install and there is no boot folder, create it by myself.