Sunday, August 31, 2008

ubuntu grub recovery

this is some technical stuff here.....
for the ubuntu users whose ubuntu has been wiped out after installing windows doesnt need to worry u only need ubuntu live cd to get back your grub....
1.boot your system using live cd....
2.when u get to the desktop just enter into the terminal...i hope u know terminal hey just kiddin
3.in shell type in

sudo grub

and something like this appear in the shell

[ Minimal BASH-like line editing is supported. For
the first word, TAB lists possible command
completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub>


4.type...

grub>find /boot/grub/stage1

youll get somethin like this

hd(?,?) //where ? represents a number

5.type...
grub>root (hd?,?)

//take care of space between root (hd?,?)
grub>setup (hd0)

6.

grub>quit


re reboot the system ull get ur ubuntu back


sudo grub gets you the grub shell.
find /boot/grub/stage1 has grub locate the file stage1. this tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.

1 comment:

paristhiti said...

o..thanks raj...and if I am a Debian user what should I do?