Subject: Re: Disklabel on lilo disk
To: James K. Lowden <jklowden@schemamania.org>
From: Thomas Hafner <hafner@sdf-eu.org>
List: netbsd-help
Date: 05/07/2003 10:03:14
"James K. Lowden" <jklowden@schemamania.org> writes:

> On Sun, 4 May 2003 17:11:21 +0100, Neil Booth <neil@daikokuya.co.uk>
> wrote:
> > If I write a NetBSD disklabel to a disk with lilo installed, will that
> > render it unbootable?
> 
> [I think I know the answer.  Let's see if someone corrects me.]
> 
> No.  The disklabel is written to the front of the NetBSD partition.  It is
> NetBSD's description of the disk.  lilo lives outside that, in the first
> sector of the disk.  Writing a disklabel won't touch the MBR unless you
> use options e.g. -B that explicitly do so.  

Lilo lives outside the NetBSD partition, but it's no need that Lilo is
in the first sector of the disk (the disk's master boot record, isn't
it?). Actually on my machine Lilo resides on a partition's boot
record. The Linux installation procedure offers two alternative ways:

1. install Lilo in the disk's master boot record, or

2. install Lilo in a partition's boot record and install a master boot
   record which let you switch to such boot records.

In the latter case it's even possible to have different Lilos (one per
bootable partition). It's a good choice when trying out different
Linux installations on the same hard disk. I had that configuration
without any problems. Now, as I replaced one of my two Linux
installations by a NetBSD one and installed the NetBSD boot selector,
booting on my machine is like follows.

* If I press F2, the NetBSD boot selector boots NetBSD.

* If I press F4, the NetBSD boot selector loads Lilo from a partition.
  Lilo let me chose one of different Linux kernels.

Disklabel did not destroy Lilo, but there was a danger of
misconfiguration, for I didn't want to waste disk space for two swap
partitions (one for Linux, the other one for NetBSD) that will never
be used at the same time. I configured by disklabel, that NetBSD's
swap partition consists of the same sectors as Linux' swap partition.

Even the installation of the NetBSD boot selector did not destroy
Lilo.

Regards
  Thomas

-- 
+-----+ Thomas Hafner +-----+
| hafn@      / hafner@      |
|   gmx.net /    sdf-eu.org |
+ http://hafner.sdf-eu.org/ +