I'm on a bit of a mission to get
the RAID support in d-i to allow the creation of a degraded array. So this
afternoon, I thought I'd refresh myself with how mdcfg currently did it's
thing by installing a RAID1 system in qemu.
Last time I played with qemu and d-i, it was all good up until it came to
the network, which ended up being more of a notwork. Today, I tried the
approach I used about 18 months ago with User Mode Linux. Using
bridge-utils, I rejigged the host to be using a bridge device, br0, and
added eth0 and the tun0 device to the bridge. (I had to load the tun kernel
module and because I was running qemu as myself, I also made /dev/net/tun
mode 666 for good measure). This immediately gave network access to d-i
running in qemu, and DHCP worked flawlessly.
I created two 1GB empty files by dd'ing /dev/zero, one for hda and one for
hdb and kicked off an install. Something like 3 hours later, the install
completed. It was sooo sloooow. I was reminded of a driver reviver TV
commercial, where a family of koalas are driving somewhere, and the kid
koala in the back is going "Are we there yet?" every five minutes, because I
felt like I was constantly doing that, jumping between virtual consoles to
check the installation's progress.
But it wasn't in vain. I spent time poking around the innards of mdcfg,
and it should be relatively easy to hack it so that, for example, if you go
to make a RAID1 device, and only select 1 partition, it'll create a degraded
mirror. It seems to do something of this ilk already. If you specify
that there are a number of hot spare devices, and then fail to select that
many partitions, it assumes the remainder are missing.
All in all, I'm very impressed with how d-i has progressed in terms of
block device flexibility. We've come from boot floppies, supporting only
vanilla partitions, to partman, that until recently supported LVM and RAID,
to the situation today, where it'll finally do LVM on RAID.
That's the icing on the cake for me. If I can help get to the point where
you can create a degraded array, so you can add disks post-install, I think
we'll be at the pinnacle of partitioning flexibility.