How to remove LILO So that System Boots from DOS Again?

The lilo program (not the complete LILO package), uses the command line option -u to uninstall the LILO boot loader. You have to supply the device name of the device you installed LILO on, for example:

lilo -u /dev/hda

This rewrites the original, pre-LILO master boot record back to the first hard drive, from the boot record saved in /boot/boot.0300.

If you installed LILO to a partition as a secondary boot loader, for example, / dev/hda1, lilo re-installs the original boot sector from the save file /boot/ boot.0301.

Refer to the lilo manual page for details.

If you have an earlier version of LILO, you will have to use the DOS (MS¬DOS 5.0 or later, or OS/2) FDISK /MBR (which is not documented). This will overwrite the lilo boot loader with a standard MS-DOS Master Boot Record.

If you don't have MS-DOS or DR-DOS, you need to have the boot sector that LILO saved when you first installed it. You did keep that file, didn't you? It's probably called boot.0301 or some such. Type:

dd if=boot.0301 of=/dev/hda bs=445 count=1

(or /dev/sda if you're using a SCSI disk). This may also wipe out your partition table, so beware!

If you're desperate, you could use

dd if=/dev/zero of=/dev/hda bs=512 count=1

This will erase your partition table and boot sector completely: you can then reformat the disk using your favorite software. But this will render the contents of your disk inaccessible you'll lose it all unless you're an expert.

Note that the DOS MBR boots whichever (single!) partition is flagged as "active." You may need to use fdisk to set and clear the active flags on partitions appropriately.

Labels: