Many of us just get afraid and stuck to old but bad formula of formatting all drives and installing all the stuff again STRANGE!!!!
In this post you will find precise steps to recover your Grub.
First step is to find whether grub can open and read any files on any partition
grub> find /boot/grub/stage1
This will return partition in the form of (hdX,Y). For example (hd0,5)
Next step is to intall the grub.
grub> root(hd0,5)
grub> setup(hd0,5)
Next step is to tell grub about the kernel and initrd img. Assuming its in sda2
grub> kernel /boot/[select your vimlinuz PRESSING TAB] root=/dev/sda2
grub> initrd /boot/[select your initrd image PRESSING TAB]
Make sure you select the same version in both kernel and initrd.
Last step is to boot in to machine
grub> boot
This will return you to command prompt interface. Just do a normal login and type startx to start GUI.
startx
Bingo You are done.
Next step is to restore the menu.lst or make new one. Search for the menu.lst in /boot/grub/.
If its empty you need to add few lines for showing grub menu in while booting. We need to know the various UUID (Universally Unique Identifier) and details of the partition. Run the command
cat /etc/fstab
or
ls -al /dev/disk/by-uuid/*
menu.lst normally looks like
title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 63451d1e-eba4-487e-ba98-eee9e58e3101
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=63451d1e-eba4-487e-ba98-eee9e58e3101 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet
title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 63451d1e-eba4-487e-ba98-eee9e58e3101
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=63451d1e-eba4-487e-ba98-eee9e58e3101 ro single
initrd /boot/initrd.img-2.6.28-11-generic
title Ubuntu 9.04, memtest86+
uuid 63451d1e-eba4-487e-ba98-eee9e58e3101
kernel /boot/memtest86+.bin
quiet
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1
title : shows as in Grub Menu option
UUID : For disks
kernel : for loading os
initrd image
Make your ones with the appropriate enttries and UUID and done. Save file and reboot the system.
No comments:
Post a Comment