Grub rescue > and how to recover your boot menu and make changes permanently

A few days ago, after resizing some partitions on my hard-drive i did a restart and boom, no boot menu and i got this message:

unknown filesystem.

grub rescue>

What happened until now:

– i have 1 hard disk with dual boot setup with GRUB (linux boot menu) with Debian Linux and Windows.

– the Windows part has 2 partitions: C:\ with the system (bootable) and D:\with stuff.

– the Linux part have 3 partitions: root (/) (also bootable), home (/home) and swap.

– i shrinked with gParted the D: partition and grow the root and home partition on Linux.

– restart and ran into the grub rescue> problem above. What happened was that when resizing the root partition i screwed up the boot part.

The solution is basicaly to identify your linux bootable root partition and update the GRUB with the correct settings so that at the next boot, GRUB to be able to “read” all bootable partitions in your hard drive.

1. Make sure what is your Linux bootable root (/) partition. To do that, make sure you have the Debian Live DVD and boot into this DVD.

2. Go and try the Live image. Wait to load.

3. Open a Terminal.

4. At the prompt, type (the sudo -s won’t require a password):

sudo -s

fdisk -l

What i get was all the partitions and the bootable ones marked with *. I get something like:

Drive           Bootable      Type          Mount         Size        Etc……

/dev/sda1     *                 ntfs

/dev/sda2                        ntfs

/dev/sda3   ………… blah            blah

/dev/sda4                        ext4          /home

/dev/sda5                        swap

/dev/sda6    *                  ext4          /

5. So the Linux root bootable partition will be /dev/sda6. TRY TO UNDERSTAND THIS: so it’s on the first drive (sda) and on the 6th partition (sda6). At point 7. you will understand.

6. Restart and take the Debian/Ubuntu Live DVD out.

7. Back at the grub rescue> you should type each line followed by [Enter]:

grub rescue>set boot=(hd0,msdos6)

grub rescue>set prefix=(hd0,msdos6)/boot/grub

grub rescue>insmod normal

grub rescue>normal

8. You are back at the lost boot menu. ^-^. Boot into Linux.

Back on track, but if you restart the computer, you will be back to the grub rescue> problem. So to make the changes to GRUB that will be permanent, we should reinstall GRUB on the hard drive and update the GRUB menu:

9. Open a Terminal and type (Now for every sudo command you should enter your user password):

sudo grub-install /dev/sda

sudo update-grub

10. That’s it! Your changes to the boot menu ar permanent.

NOTE: If Windows won’t boot, use a Windows installer DVD and do a Stratup Repair.

Have fun! ^-^

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s