Sat Jun 27 20:37:07 CEST 2009

lvm raid

got 2x 1G disks.  what i want is 300 meg raid for root and important
data, and the rest (2x700) as a single non-raid volume.


looks like i need to shrink my 900MB root partition first. this can't
be done online, so first step is to create a new VG and a smaller LV
on it.

This is _not_ what i'm looking for:

  lvconvert -i 1 -m 1 --corelog /dev/vg1/root /dev/sda2

converting it back using:

  lvconvert -i 1 -m 0 /dev/vg1/root

Apparently[1] you need 3 pvs for mirror, one to save the log.  Luckily
I have another partition ready.  The proper way is:

  lvconvert -i 1 -m 1 --mirrorlog disk /dev/vg1/root /dev/sda2 /dev/sdb2 /dev/sdb1

I'm chaining up the remaining space on the two harddrives to use as
scratch space. The current allocation is:

zni:/home/tom# lvs -a -o +devices
  LV              VG   Attr   LSize   Origin Snap%  Move Log       Copy%  Convert Devices
  root            vg1  mwi-ao 300.00G                    root_mlog  18.00         root_mimage_0(0),root_mimage_1(0)
  [root_mimage_0] vg1  Iwi-ao 300.00G                                             /dev/sdb2(0)
  [root_mimage_1] vg1  Iwi-ao 300.00G                                             /dev/sda2(0)
  [root_mlog]     vg1  lwi-ao   4.00M                                             /dev/sdb1(0)
  scratch         vg1  -wi-ao   1.22T                                             /dev/sda2(76800)
  scratch         vg1  -wi-ao   1.22T                                             /dev/sdb2(79360)
  swap_1          vg1  -wi-ao  10.00G                                             /dev/sdb2(76800)

[1] https://bugs.launchpad.net/ubuntu/+source/lvm2/+bug/121527