It could happen that your PC, after some operations (i.g. with gdisk) doesn’t start booting and you are therefore in grub rescue prompt. A very unpleasant situation.
The steps to follow are:
- see what are the partitions, with the command
ls
- you should see something like:
(hd0)(hd0,msdos1)(hd0,msdos2)(hd1)(hd1,gpt1)
- you should see something like:
- understand what is the right partition to boot (i.g. hd0,gpt2):
- you can list a single partition to see what it contains, with the command ls (hd0,gpt2). You should be able to see if a partition is the right one.
- give the command
set prefix=(hd0,gpt2)/boot/grub
- give the command
set root=(hd0,gpt2)/ root=/dev/sda2
(if the right partition is hd0,gpt2 the name is /dev/sda2, if it was hd1,gpt3 it would be /dev/sdb3) - give the command
insmod norma
l - give the command:
normal
(orboot
)
In this way the system should start with the expected partition.