[H-GEN] Cleaning up the MBR on a /dev/hda

Robert Brockway rbrockway at opentrend.net
Tue Nov 15 12:32:25 EST 2005


On Tue, 15 Nov 2005, Ewan Edwards wrote:

> I could fit a floppy drive, boot DOS, and use it's fdisk utility with
> the /mbr switch.  Unfortunately, I have no desire to make any
> hardware mods, nor natively run any non GPL OS on this box - even if
> only temporarily.  As far as I know there is no equivalent function
> available in the version of fdisk that comes with most Linux distros.

No but in Linux it isn't fdisk's function to mess with the boot loader. 
One could argue the same thing in MS-DOS/Windows actually :)

I know there have been a few posts already but this is the procedure I use 
to rescue a box from the situation you have (using lilo in this case):

1. Boot your favourite general purpose live cdrom.  I like Knoppix.

2. Mount the root filesystem from your disk.  Let's say it is mounted on
    /mnt.

3. Edit /mnt/etc/lilo.conf.

4. Issue the command lilo -r /mnt .  This will chroot and run Knoppix's
    copy of the cdrom as if /mnt was / .  This will rebuild your boot
    loader for you.

    An alternative is to use chroot to change /mnt to be the / filesystem
    and then run lilo off the disk.

> The best idea I've had so far is to somehow capture the partition
> table information, then use dd as above, then somehow write the
> captured information back.

I'd avoid this.

Rob

-- 
Robert Brockway B.Sc.		Phone:	+1-416-669-3073
Senior Technical Consultant	Email:	support at opentrend.net
OpenTrend Solutions Ltd.	Web:	www.opentrend.net
We are open 24x365 for technical support.  Call us in a crisis.




More information about the General mailing list