Last update: April 30, 2001

Secrets I learned... about Linux/Win and LILO

In the document lilo.html I discuss some of the concepts behind LILO as well as issues involved in mounted two Linux systems on the same disk. This document describes considerations and insights in putting together a Linux/Windows machine.
Linux first
  • I created a primary partition /dev/hda1 with no expectation of using it for Linux.
  • I had LILO write to /dev/hda ie: the MBR
  • Very important: I created a boot diskette during the install. I tested it. It didn't work. (Nothing to blame Linux about. It happened to be a crummy diskette.) Just as well. It helped me learn that the command to make a boot disk for my 2.4.2-2 kernel is
            mkbootdisk 2.4.2-2
  • I tested the boot floppy.
  • I tested it again.
    • Boot up a Win98 "startup" diskette
    • Delete that partition
    • Create it again
    • Run sys c:
    I can't say that all that was necessary, but it didn't hurt.
Windows second
I installed Win98. Happily it didn't touch anything other than that one partition.

Important Windoze, of course, merrily wiped out the MBR that Linux had created. But that's OK for now. I booted Linux from the floppy.

Back to Linux again

My next task was to manipulate the MBR so that LILO would give me a choice between booting up Linux or Windows. Nervous? Darn right.

I knew I'd always be able to boot up Linux since I had that floppy.

But I wasn't so sure about Windoze. Remember that the MBR was no longer the one that Linux had written. Windows had written its own. I intend to re-write it again with /sbin/lilo   What if I screw up? Yes, I'll still be able to boot up Linux, but I won't be able to boot up Windows.

So I gave myself some insurance and made a copy of the MBR.
     dd if=/dev/hda of=insurance.mbr bs=512 count=1

If I somehow screw up the MBR and can't access Windows, I know that I can boot up Linux with the floppy. Then, all I'd have to do is to reverse the dd process:
     dd of=/dev/hda if=insurance.mbr bs=512 count=1

I editted /etc/lilo.conf putting in another stanza.
other=/dev/hda1
    label=Windoze

and wrote the MBR using /sbin/lilo

... and now things are well in the MBR