Monday, May 07, 2007

Recover GRUB after reinstall windows

Boot using a Live CD or Installation CD.

mount your linux partition. Chroot, mount /proc and give the grub specific command to overwrite or update the mbr or where you want.

like my Linux root in /dev/hda6

after boot with the Live CD

#mkdir /mnt/lin (create a folder to use as a mount point)
#mount /dev/hda6 /mnt/lin
#chroot /mnt/lin
# mount /proc
#grub-install /dev/hda
or
#update-grub

the update-grub and grub-install command will work of Debian, Ubuntu and Debian based distro. If your are using other distribution. Read their grub policy and command. Here chroot will enable you to access the existing Linux system using the live CD kernel.

note: If you use normal Installation CD to recover grub then you might need to give the path known by the kernel. Like then you may need to use ../disc0/part4/ etc instead of /dev/hda6. You can find the exact path by execution a script called os-prober that generally comes with the installation CD of Debian.

3 comments:

ranacse05 said...

I'm using fedora 6 how can i recover GRUB loader using Ubuntu 7.04 live CD?
Red marked lines doesn't support,it says no blog drive........
Monday, May 07, 2007
Recover GRUB after reinstall windows
Boot using a Live CD or Installation CD.

mount your linux partition. Chroot, mount /proc and give the grub specific command to overwrite or update the mbr or where you want.

like my Linux root in /dev/hda6

after boot with the Live CD

#mkdir /mnt/lin (create a folder to use as a mount point)
#mount /dev/hda6 /mnt/lin
#chroot /mnt/lin
# mount /proc
#grub-install /dev/hda
or
#update-grub

the update-grub and grub-install command will work of Debian, Ubuntu and Debian based distro. If your are using other distribution. Read their grub policy and command. Here chroot will enable you to access the existing Linux system using the live CD kernel.

note: If you use normal Installation CD to recover grub then you might need to give the path known by the kernel. Like then you may need to use ../disc0/part4/ etc instead of /dev/hda6. You can find the exact path by execution a script called os-prober that generally comes with the installation CD of Debian.
Posted by Salahuddin Pasha (salahuddin66) at 12:04 AM ;
Labels: debian

Khandakar Mujahidul Islam said...

Follow the step to recover grub bootloader:
1. Boot with Ubuntu Live CD
2. Open gnome-terminal
Gve the commands:
3. sudo grub
then it shows grub> like this
grub>find /boot/grub/stage1
it´ĺl give a output like this (hd0,7) 7 is here for example, itĺl be number of ur linux boot partition.
grub>root (hd0,7)
grub>setup (hd0)
grub>quit

Then reboot your machine. I think your boot loader should be recovered.

There is another way.
1. Boot with Fedora CD 1.
2. write
linux rescue
it´ĺl open a shell after some step.
write
grub

Then write previous grub command

Shishal said...

thanx suzan. i have successfuly recovered my fedora6 using ubantu live cd.i have just followed the steps explained by you.