[ILUG] Installing lilo on another disk.

From: Niall O Broin (niall at domain linux.ie)
Date: Tue 30 Jul 2002 - 15:40:30 IST


I'm installing warm standby disks on a number of boxes. These disks will be
the same size (sometimes bigger) than the main disk. The idea is that every
night I'll rsync the partitions on the main disk to the standby disk so that
in the case of disaster, the first port of call, before the tapes, is the
standby disk. (We did consider running Linux md RAID on the disks but RAID
gives you no protection against slips of the finger)

So, in the event of finger slips we can mount the relevant partition and
retrieve the banjaxed file. In the case of a disk crash, the plan is that
we'll put the standby disk in place of the main disk and the workstation
will be back up ASAP. Then we can deal with replacing the disk without the
pressure of a broken box on our back.

However, I'm stumped as to how to install LILO on the backup disk. Let's say
the master disk is /dev/hda and the backup disk is /dev/hdb. lilo.conf
currently looks like this:

boot = /dev/hda
change-rules
reset
read-only
menu-scheme = Wg:kw:Wg:Wg
lba32
prompt
timeout = 80
message = /boot/message

  image = /boot/vmlinuz
  label = linux
  root = /dev/hda3
  vga = 791
  initrd = /boot/initrd

There are a couple more boot stanzas, but they're not germane. As you can
see, / is on /dev/hda3 and /boot is on /dev/hda1. So if for instance I had
booted from a CD and wanted to re-install LILO on this disk I'd do something
like

mount /dev/hda3 /mnt
mount /dev/hda1 /mnt/boot
lilo -r /mnt

which is OK because I'm installing lilo on /dev/hda and I want it to boot
from /dev/hda so it'll plug in all the right numbers.

However, in the case of the standby disk, I'll have to do something like

mount /dev/hdb3 /mnt
mount /dev/hdb1 /mnt/boot
lilo -r /mnt

But I'm obviously going to have to do something different here because I
want to install onto /dev/hdb in such a way that the disk will boot when it
becomes /dev/hda after a disaster (like the one I had this morning :-( -
shutting the stable door was on the to-do list, but the bloody horse decided
to do a bunk early). The machine already has its spare disk - just hadn't
yet been used :-(

I thought perhaps I should just do lilo -b /dev/hdb -r /mnt but I think
that -b is analogous to the boot keyword in lilo.conf. Or will this just
work automagically ? i.e. boot = /dev/hda tells lilo what numbers to poke
where, and it figures out where the disk is from the -r ?

Unfortunately suck and it and see is rather tricky - the machines concerned
are not to hand.

Niall



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:18:06 GMT