header

Torsten Curdt’s weblog

Restoring Lilo

If you ever want to install Windows XP on a partition next to your linux installation be aware of the fact that it will overwrite your bootloader. No big problem as long you have a rescue disk or e.g. a knoppix cd at hand. All you have to do is to chroot and call lilo again.


> mount -o dev /dev/hda5 /mnt/hda5; chroot /mnt/hda5
> vi /etc/lilo.conf # fix if needed
> lilo

2 Responses to “Restoring Lilo”

  1. michael said, on 6. September 2005 at 23:14

    I’d be fascinated to know how you got XP to boot after doing this, ie, how you boot XP from lilo?

  2. michael said, on 7. September 2005 at 22:45

    apparently, you don’t. If anyone else stumbles across this, fixing the NTLDR is challenging. I opted for a file backup and reinstall. Make a backup copy of your mbr before you install lilo, just to be safe. Do that like so:

    dd if=/dev/hda of=/home/you/mbrbackup bs=512 count=1

    (restoring this would be the reverse, ie:

    dd if=/home/you/mbrbackup of=/dev/hda bs=512 count=1 )

    If you have both XP and linux partitions within the first 8 GB of your hdd, booting both from lilo should be a snap. Install XP first, then linux. DONT LET your installer put lilo on the mbr! make sure it does

    lilo /dev/hda2

    or appropriate partition, rather than hda, or youll have a helluva time getting XP to boot. It should pick up XP and NTLDR and make a menu entry for it automagically.

Leave a Reply

Please copy the string WmN2A4 to the field below: