Sometimes I’m not quite fond of my Debian Linux. Recently I could barely help myself from putting my head in the cement mixer.

What you want: Two harddisks, software mirroring for /boot and /, crypt for everything but /boot

Lilo can boot from raid (it latter turns out that this is not quite the case.. it depends).

How does this look practically?

   Device Boot      Start         End      Blocks   Id  Target
/dev/sda1               1         249     2000061   fd  [ /dev/md0 [ /dev/mapper/swap    [ swap  ] ] ]
/dev/sda2   *         250         257       64260   fd  [ /dev/md1                       [ /boot ]   ]
/dev/sda3             258       10217    80003700   fd  [ /dev/md2 [ /dev/mapper/dm-root [ /     ] ] ]
/dev/sda4           10218       30515   163043685   fd  [ /dev/md3 [ /dev/mapper/data    [ /data ] ] ]

(Analog for /dev/sdb)

The problem?

:/# lilo -v -v
LILO version 22.6.1, Copyright (C) 1992-1998 Werner Almesberger
Development beyond version 21 Copyright (C) 1999-2004 John Coffman
Released 17-Nov-2004, and compiled at 03:22:31 on Aug  1 2006
Debian GNU/Linux

pf_hard_disk_scan: ndevs=2
  0800  B1DB62EC  /dev/sda
  0810  BAC32241  /dev/sdb
device codes (user assigned pf) = 0
device codes (user assigned) = 0
device codes (BIOS assigned) = 3
device codes (canonical) = 3
Fatal: Inconsistent Raid version information on /dev/md1

Hit the jump for some more config file excerpts & the solution.

lilo config:


“Inconsistent version information”, huh?

mdadm -E /dev/md1 mdadm: No md superblock detected on /dev/md1.

mdadm -E /dev/sd[ab]2|grep -i version
        Version : 01     
        Version : 01     


man mdadm (emphasis mine)

… -e , —metadata= Declare the style of superblock (raid metadata) to be used. The default is 0.90 for —create, and to guess for other operations.

Options are:

0, 0.90, default Use the original 0.90 format superblock. This format limits arrays to 28 componenet devices and limits component devices of levels 1 and greater to 2 terabytes.

1, 1.0, 1.1, 1.2 Use the new version-1 format superblock. This has few restrictions. The different subversion store the superblock at different locations on the device, either at the end (for 1.0), at the start (for 1.1) or 4K from the start (for 1.2). …

Well, I didn’t specify any -e switch when creating the array, so why did Debian create a version 1 array here when 0.9 is default?

Googling for “mdadm Magic version uuid raid.level” confirms it:

       Version : 00.90.00

is what I want to read. Recreating and reinitialsing the array with explicitly specifying the version as 0.9, and now lilo is happy, too:

RAID info:  nr=2, raid=2, active=2, working=2, failed=0, spare=0

Added Linux *

do_md_install: MD_PARALLEL
RAID device mask 0x0003
The boot record of  /dev/md1  has been updated.
The Master boot record of  /dev/sda  has been updated.
Warning: /dev/sdb is not on the first disk
The Master boot record of  /dev/sdb  has been updated.

—> lilo only works with raid 0.9 metadata! Not with raid 1.x