chris t: April 2008 Archives

So, we were sitting around the prgmr.com world headquarters, when the subject of Catch-22 came up.  I found myself the only person in the room who'd actually enjoyed it, and had to defend my position relying on memory alone.

It went poorly.  But now, a couple of days later, I'm working with LVM mirroring, and I get:

# lvextend -r -v -L +1G lion_domU/cicero
Finding volume group lion_domU
Extending 2 mirror images.
Mirrors cannot be resized while active yet.


Okay, so I deactivate it.  No problem.

# lvchange -an lion_domU/cicero

And then try again.

# lvextend -r -v -L +1G lion_domU/cicero
Finding volume group lion_domU
Extending 2 mirror images.
Logical volume cicero must be activated before resizing filesystem


*sigh*  It's a good thing I can resize manually, otherwise I'd really be out of luck.
Let me describe to you how we're partitioning the current machines.  The goal is to have everything mirrored, so that we can survive an outage on our cheap and crappy SATA disks.  (I mean, they're Seagate and Maxtors.  Could be much worse.  But they're still very commodity.  You know how it goes.  Worse is better.)

Anyway, let's make a table.  All of the md devices are mirrored:

/dev/md0         /             10G
/dev/sd(1,0)     (swap)     (memsize)
/dev/md1         LVM PV  5G

The rest of each drive is an LVM PV.  The three PVs (one mirrored, two not) are then ganged into a VG.  (One of the first things that we do is create an LV to use for /var, sized the same as swap.  This is so that we can save the domUs at machine shutdown and restore them on reboot.  We might just make / bigger, though.)

When we create a domU, the backing store gets created something like this:

 # lvcreate -L 5G -m 1 vgname

Which puts each leg of the mirror on a separate disk, and the mirror log on /dev/md2.

This is fine and dandy.  One problem, though, is that GRUB isn't installed properly on both devices.  If drive 0 fails in a way that renders it invisible to the BIOS, the machine won't boot.  Here's the solution:

 grub> root (hd1,0)
 grub> install /boot/grub/stage1 (hd1) (hd1)1+15 p (hd0,0)/boot/grub/stage2 /boot/grub/grub.conf

Unfortunately, if the failed drive 0 is still visible to the BIOS, GRUB won't load at all.  My understanding of GRUB isn't complete enough to specify a stage2 relative to the boot sector, although it seems like the sort of thing that should be possible.

About this Archive

This page is a archive of recent entries written by chris t in April 2008.

chris t: May 2008 is the next archive.

Find recent content on the main index or look in the archives to find all content.