2 March 2009

Restore Master Boot Record (MBR) with grub

In case your MBR is broken, those are some instructions to help you restore it.

The variables of this example are:
- /dev/sda the master hard disk,
- /dev/sdaM the ext3 boot partition (corresponds to hd0,M-1 for bootloader)
- grub as bootloader

Instructions:
- boot with a GNU/Linux Rescue or Live CD of your choice
- remove/rename the /boot folder of the launched GNU/Linux Rescue or Live CD instance
- mount your boot partition
mkdir /boot
mount -t ext3 /dev/sdaM /boot
- restore the MBR
grub
root (hd0,M-1)
setup (hd0,M-1)
quit
grub-install /dev/sda

No comments:

Post a Comment

Thank you for your visit, let's share your point of view: