Wednesday, November 08, 2006

Fix MBR with Linux boot loader

If for some reasons your MBR is corrupted, you won't be able to boot back to your OS.
Boot from the Linux installation CD and type:

%> linux rescue

It starts mounting your linux installation partition to the /mnt/sysimage. Then type:

%> chroot /mnt/sysimage

Now you are in the shell within the parent directory. It depends on your boot loader, if it is GRUB, then do:

%> grub-install /dev/sda

For SCSI disk or

%> grub-install /dev/hda

for IDE disk

If you have LILO, then do:

%> /sbin/lilo

No comments: