> > > fdisk /mbr (undocumented feature of fdisk)
> > > does the trick.
> > > 
> > > Joop
> > 
> > Just wondering, is there a linux way to do this?
> > -samuel
> 
> Yes... but only if you still have linux intact...
> Lilo saves a copy of your bootsector on first install.
> this can be recovered with lilo -u or lilo -U
> 
> RTFM... it's all there (lilo(8))
 
Hmm its always good idea to keep your mbr on your linux boot disk
with a quick script to recover it. You will find the saved mbr record
in /boot/mbr.b usually. Then:

Create files /root/lilo-fd.conf and /root/fixmbr:

cat >/root/lilo-fd.conf <<EOF
boot=/dev/fd0
root=/dev/hda1
install=boot.b
map=map
vga=ASK
#append="mem=128M"
delay=10
compact
read-only
default=linux
image=vmlinuz
        Label=linux
image=vmlinuz
        Label=fixmbr
        append="init=/fixmbr"
EOF

cat >/root/fixmbr <<EOF
#!/sash
dd if=/mbr.b of=/dev/hda bs=512 count=1
EOF

Of course /dev/hda1 replace with your root partition and 
I suppose you replace master boot on primary master HD.

Then insert new floppy and proceed as root:

mke2fs /dev/fd0
mount -t ext2 /dev/fd0 /floppy
cp /boot/vmlinuz /boot/boot.b /boot/mbr.b /floppy/
cp /root/lilo-fd.conf /root/fixmbr /bin/dd /bin/sash /floppy/
mkdir /floppy/dev
mknod /floppy/dev/hda b 3 0
chmod 666 /floppy/dev/hda 
cd floppy
lilo -C lilo-fd.conf
cd /
umount /floppy

I'd say that creating such floppy could save you lots of troubles in case
you want to play with installing windows on your computer, since it likes
to replace your masterboot in the worst possible moments and then again
don't work/install in case you won't give it its M$ masterboot ...

Jirka

PS: I hope I did not make there some mistake, writing this out of my head.

-- 
Jiri Klouda <[EMAIL PROTECTED]>
http://atrey.karlin.mff.cuni.cz/~jk

Reply via email to