[nmglug] Argghhh!!! I hosed my MBR

Sam Noble sam.noble at comcast.net
Mon Dec 6 12:18:37 PST 2004


On Mon, 2004-12-06 at 11:04 -0800, Tim Emerick wrote:
> I updated my Win98 partition on my dual boot debian/Windows machine to
> Windows XP.  I expected XP to take over the MBR but didn't realize how
> difficult it was to have LILO take it all back.  I'm now stuck with a dead
> machine.
> 
> Partititions are all intact, checked them with knoppix.
> 
> I tried booting knoppix and following some directions on restoring the MBR so
> that LILO could handle the bootup.  Got lost since most of the directions I
> could find were redhat related and I'm running debian.  I also got lost since
> everytime I tried to run lilo it was looking at the knoppix generated
> /etc/lilo.conf that resided on the ram disk.
> 
> Found some generic linux instructions on running lilo from a virtual terminal
> using the install CD (I used my Debian/Testing netinst CD).  Couldn't get
> lilo to run.
> 
> I also tried popping in the Debian install disk and typing linux
> root=/dev/hda1 and root=/dev/hda3.  Bounced back an error about not being
> able to mount the root.
> 
> So, I'm pretty much at a loss.  My lack of technical expertise is surely
> hindering my efforts at getting this box back up and running.
> 
> I've looked at some doc's that showed how to edit Windows XP's boot.ini file
> to boot the linux partition but I prefer the lilo setup I had.
> 
> With all that said.....HELP!!!!!!  I really need either dummy's approach or a
> link to a dummy's approach.
> 
> Here's my Partition info.
> /dev/hda1 - 10MB  - ext3 - /boot
> /dev/hda2 - 256MB - swap
> /dev/hda3 - 8GB   - ext3 - /
> 
> Thanks in advance,
> 
> Tim Emerick
> /dev/hda4 - 70GB  - vfat - /c (windows XP fat32 partition)
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Take Yahoo! Mail with you! Get it on your mobile phone. 
> http://mobile.yahoo.com/maildemo 
> 
> _______________________________________________
> nmglug mailing list
> nmglug at nmglug.org
> http://www.nmglug.org/mailman/listinfo/nmglug

There are several ways to do this from a rescue environment. But I
recomend using a bootable grub CD to get to your native install and
fixing it from there.

Here's a grub.iso

http://www.laclinux.com/~sam/grub.iso

Boot from that and you'll get a grub prompt.

grub>

Set the grub root (your /boot partition

grub> root (hd0,0)

Then load your kernel; use tab completion to get the name right. and put
your kernel arguments behind it. This should be the same as the 'image='
line in lilo.conf 

So if lilo.conf has:
vga=normal
image=/boot/vmlinuz-2.6.9
initrd=/boot/initrd-2.6.9
        root=/dev/hda3


grub> kernel vmlinuz-2.6.9 ro root=/dev/hda3 vga=normal

Then the initrd. (If there's not one that's cool just skip this step)

grub> initrd initrd-2.6.9

now boot it.

grub> boot

That should get you in. One pitfall would be if lilo.conf was pointed at
symlinks (probably something like '/vmlinuz' and '/initrd') you'll have
to figure out where the real kernel is. But you have tab-completion on
your side :)

Then from in your normal environment I'm sure you'll have no problem
getting lilo fixed up again.

# lilo 


-- 
GPG key F343E5FC (fingerprint:DF37 93BC AFEC 0A6A CC08  4A95 3790 8B4C
F343 E5FC)
available at: http://sam.noble.home.comcast.net/sams_publickey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.nmglug.org/pipermail/nmglug-nmglug.org/attachments/20041206/d0fecc01/attachment.pgp>


More information about the nmglug mailing list