Boot into recovery mode using Grub cli
After the initial BIOS splash screen, press Shift
to open GRUB menu. Then press c
to enter CLI mode.
You will see a terminal like following
grub>
grub> ls
(hd0) (hd0,msdos2) (hd0,msdos1)
hd0
is the disk name. And (hd0, msdos1)
, (hd0,msdos2)
are the partitions at /dev/sda1
, /dev/sda2
respectively.
What’s all this msdos stuff? That means this system has the old-style MS-DOS partition table(MBR), rather than the shiny new Globally Unique Identifiers partition table (GPT)
To list files in dev/sda2
run the following
grub> ls (hd0,msdos2)/
lost+found/ bin/ boot/ cdrom/ dev/ etc/ home/ lib/
lib64/ media/ mnt/ opt/ proc/ root/ run/ sbin/
srv/ sys/ tmp/ usr/ var/
To boot into the linux image present in dev/sda2
do the following
grub> set root=(hd0,msdos2)
grub> linux /boot/vmlinuz-5.4.0-58-generic root=/dev/sda2
grub> initrd /boot/vmlinuz-5.4.0-58-generic
grub> boot
For booting into recovery mode replace Step 2 of the above process with
grub> linux /boot/vmlinuz-5.4.0-58-generic root=/dev/sda2 recovery