«

»

Jul 15

All I got was this lousy GRUB rescue prompt.

I recently found myself staring at a grub rescue prompt after I renamed a volume group but forgot to update grub. The grub rescue prompt has very few commands but will get you out of a jam providing things aren’t too broken. In my case, grub (quite correctly) couldn’t find the /boot partition since it was inside the LVM which had the volume group renamed.

This is what I did to get the system in a state where I could update grub:

set  (This will print the current root and prefix)

ls (This will list the devices that grub can see. If you are using LVM, then these will be listed also)

So, I could see my (old) LVM partitions being listed, I just need to tell grub what I had renamed them to:

set prefix=(vg_foobar-lv_root)/boot/grub

set root=vg_foobar-lv_root

insmod normal

normal

The ‘normal’ command will tell grub to move to the next boot stage which will display the normal grub prompt. Once that appears, I was able to edit the boot line with the correct volume groups, boot the system, update grub and the day was saved. The other lesson I took from this is always create a /boot partition outside of LVM!

References:

http://sazeit.com/articles/boot-ubuntu-from-grub-prompt

http://www.dedoimedo.com/computers/grub-2.html

http://www.gnu.org/software/grub/manual/grub.html