____

Monday, April 16, 2007

Messed up boot loader ? recover easily

one of the ugliest problems about dual booting windows and Ubuntu (generally Linux) is Boot Loader problems.

the problem is , "the menu" which lets you choose the operation system at startup needs to be stored in your Hard Disk MBR (MBR is the short for -Master Boot Record- and it means the first sector of your hard disk which tells the computer which partition has the operation system to load)

you can easily destroy this MBR by just adding a new hard disk or changing the hard disk cable position or installing a new operation system (windows doesn't care about Linux , so if you install windows after Linux , it will destroy Linux MBR , but if you install Linux after Windows it won't destroy your windows booting ability , so when you install windows after Linux be careful)

so let say you messed that MBR thing up , you will see your computer doesn't load at all ,
but don't worry you have lost none of your data or operation system .

you can solve this ugly problem in less than 3 minutes and 5 commands ,
for this you must have a Linux Live CD (I strongly recommend Ubuntu Dapper live CD)

1- insert your Ubuntu Dapper Live CD and in your computer setup set the options to boot from CD (I assume you know how to boot from CD)

2- now we are in ubuntu (by live CD) , open a Terminal window (it is in menu list)
3- open a terminal and enter these commands :

Sudo Grub


find /boot/grub/stage1

this should give you a result , remember the results .

root (hd?,?)

(replace the ? with the numbers you got in the last command)

setup (hd0)
replace 0 with the hard disk number you want the grub to install to (if you don't know, don't worry just use hd0 it should work fine)

quit

now restart and you should have a boot menu for your all installed operation systems.

2 comments:

The Kitty said...

Your clear instructions saved the day - thanks!

ºoOzhielOoº said...

Hmmn I get someting like error 21: selected disk does not exist. any help? When i fdisk -l i can see all my partitions

Related Posts: