Random LVM stuff

LV caching

We use LV caching at least on godard.d.o and smit.d.o. Here are the setup instructions:

  lvcreate --type cache --cachemode writethrough -L 120G -n srv_cachepool vg0/srv /dev/sda3
  lvs -o+cache_mode,devices -a

This will produce output similar to:

  LV                          VG  Attr       LSize  Pool                  Origin      Data%  Meta%  Move Log Cpy%Sync Convert CacheMode    Devices
  [lvol0_pmspare]             vg0 ewi------- 32.00m                                                                                        /dev/vdc(2560)
  srv                         vg0 Cwi-aoC--- <2.54t [srv_cachepool_cpool] [srv_corig] 100.00 24.21           0.00             writethrough srv_corig(0)
  [srv_cachepool_cpool]       vg0 Cwi---C--- 80.00g                                   100.00 24.21           0.00             writethrough srv_cachepool_cpool_cdata(0)
  [srv_cachepool_cpool_cdata] vg0 Cwi-ao---- 80.00g                                                                                        /dev/vdc(2576)
  [srv_cachepool_cpool_cmeta] vg0 ewi-ao---- 32.00m                                                                                        /dev/vdc(2568)
  [srv_corig]                 vg0 owi-aoC--- <2.54t                                                                                        /dev/vdb(2560)
  swap                        vg0 -wi-ao---- 10.00g                                                                                        /dev/vdc(0)

The values required to rebuild the cache "as was" are:

  lvconvert --uncache vg0/srv