Friday, June 12, 2009

migrating a RAID1 mirror

Creating a software RAID1 setup with one 2TB and two 1TB drives isn't difficult, but in this case the setup was running in production as a RAID1 over two 1TB drives.
Small sda1 and sdb1 partitions form /dev/md0 and are formatted ext3 for /boot. Large sda2 and sdb2 partitions form /dev/md1 and are an LVM PV, the rest of the system is formatted in logical volumes.
Target situation: to have /boot on all three disks, and the LVM volume group as large as possible, redundant on mirrorred diskspace.
The procedure is strict, but straightforward:
  1. partition the new disk in 3 partitions (small - large - large)
  2. make md0 3-legged with sdc1 as the third device
  3. make md1 3-legged with sdc2 as the third device
  4. wait for the sync (watch /proc/mdstat)
  5. remove sdb2 from md1 and make it 2-legged again (you'll have to --fail sdb2 before you can --remove it).
  6. make a new md2 device for sdb2 and sdc3, make it a PV and add it to your volume group.
The only utilities needed are cfdisk, mdadm, and lvm (for pvcreate and vgextend).
If you need to restructure your existing partition tables in the proces, you might need pvmove to free up existing partitions before reusing or deleting them.

Thursday, June 11, 2009

Innovation

Now that's innovation: automatically detecting the license plate of cars entering a car park / gas station from a highway, and holding them back for a minute if they try to enter the highway too fast. People trying to cut traffic jams (and thereby making them worse, because merging traffic at unadapted speeds creates and worsens traffic jams) get penalized.
Can we get this on the E40 in Heverlee, please ? Pretty please ?