Powered by
Movable Type 3.38 mod_perl/2

Linux soft-raid & lilo

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:

lba32
boot=/dev/md1
raid-extra-boot=mbr
root=/dev/mapper/dm-root
image=/vmlinuz
        label="Linux"
        initrd=/initrd.img
        read-only

“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     

mhmmmmmmm!!!

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


TrackBack

» debian 6 lilo inconsistent raid version information
my first install of a debian 6 and I got the error above just when switching from grub to lilo @ install screen (press go back when asked to install grub) (why lilo over grub? you might ask … well, as they say, habit is a second nature) googling got...

TrackBack URL for this entry:
http://anti.teamidiot.de/mt-tb/1


Comments (8)

I just ran into the same problem. i created my array like i always do with something like

mdadm --create /dev/md0 -v -l raid1 -n 2 /dev/hdc1 /dev/hda4

and lilo gave me the same error. you are right, it states that 0.9 should be default but it definitely set 1.0

thanks to your entry here you saved me from a lot of trouble because i had absolutely NO idea what went wrong

thanks alot!

jeremy (from germany)

You saved my day! thx, georg

It seems that /etc/mdadm/mdadm.conf sets the metadata to 1. :(

I faced this problem since latest knoppix version. Check mdadm.conf and see metadata value. If you want to use lilo, metadata must be 0.9

Thanks !

Holy McCrap, I was dealing with this issue ALL DAY and it wasn't until I stumbled on this blog entry in some Googling that I realized this is what was going on. Using Knoppix to repair an existing root-on-software-RAID installation, I couldn't get lilo to install itself to the boot loader to save my life. This "inconsistent" message kept coming up, and I couldn't figure out why for the life of me. Thanks a million for posting this.

Thanks for this post! It really saved me many hours of grief.

thanks very much for posting this blog entry.

was trying to install suse11.1 on a s/w-raided machine caused grub install to fail, so I thought lilo would be good alternative.

booted into rescue mode, mounted up the installed disks, created a lilo.conf and the "inconsistent" error came up. WTF? then I found your blog entry and all was revealed!