[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

Getting Lilo Back


A while ago I had to reinstall XP which I have duel booting with Mandrake 9. In doing this it got rid of Lilo. So I can't access Linux. Any idea how I can get it back up without reinstalling? Thanks

1 Solution
If you made a Linux boot floppy you can boot from it. When you get to a login prompt, login as root then run the following command:

/sbin/lilo -v

This will reinstall LILO with the last settings you had. I assume that since you only reinstalled XP that those settings should work fine.

If you don't have a boot floppy, you should be able to boot your system from the mandrake install DISC. At the boot: prompt, type the following:

linux root=/dev/pathToYourLinuxPartition noinitrd ro

When you get back in, login ad root and run /sbin/lilo -v

This *SHOULD* fix your problem.

After booting from the first CD (or DVD), press F1 for a list of advanced options, type "rescue" at the boot prompt, and press "enter".
After booting, Mandrake's rescue mode displays a menu of choices: "Re-install Boot Loader", "Restore Windows Boot Loader", "Mount your partitions under /mnt", "Go to console", "Reboot", and "Doc: what's addressed by this Rescue?".

"Go to console" is the most useful of these choices across a variety of Linux systems, because it gives you a root prompt and access to the tools that you can use to repair your system.

One thing you could be interested in is multiboot from XP :

Suppose that your boot sector is on /dev/sda, in /etc/lilo.conf you should have this line then :


From the linux root prompt do the following things :

dd if=/dev/sda of=bootsect.lnx bs=512 count=1

This will copy the boot sector to the file bootsect.lnx

Copy this file to a floppy :

mount -t msdos /dev/fd0 /mnt/floppy
copy bootsect.lnx /mnt/floppy
umount /mnt/floppy

Now reboot to windows and edit the boot.ini file (assuming you use C: )

From CMD.EXE execute this :

attrib -s -r c:\boot.ini

Edit this file with wordpad or notepad (I prefer gVim :-)
and add this line :

[boot loader]
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINNT="Windows XP ...

From CMD.EXE execute this :

attrib +s +r c:\boot.ini

Don't forget to copy the file generated from Linux to C:\

After restarting you should obtain a new entry from windows prompt.
You need to boot off some other linux media.  Usually boot/rescue disks will allow you to choose a partitiion to mount.  At the lilo prompt it's something like "root=/dev/hda1".  

I would highly reccomend Timos RescueCD.  It's a small debian based CD that will provide enough documentation to boot off your hard drive.  Once on log on as root and then run /sbin/lilo .

Timos RescueCD is available at:

If you would prefer to use floppy disks over a CD you can use something like:

There is plenty of documentation there about retrieving the disk images and writing the disks.  With the floppy at the lilo prompt you can specify to boot off your hard drive and then just run /sbin/lilo, reboot, and everything should be fixed.

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now