Add some tips about LV caching
[mirror/dsa-wiki.git] / input / howto / lvm.creole
1 == Random LVM stuff ==
2
3 === LV caching ===
4
5 We use LV caching at least on godard.d.o and smit.d.o. Here are the setup instructions:
6
7 * Make sure that both the HDD and SSD are in the same volume group.
8
9 * Make sure module loading is enabled
10
11 * Run the following command to enable LV caching for the srv LV in the vg0 VG, assuming the SSD is /dev/sda3:
12
13 {{{
14   lvcreate --type cache --cachemode writethrough -L 120G -n srv_cachepool vg0/srv /dev/sda3
15 }}}
16
17 * It is currently not possible to resize a LV with a LVM cache. The workaround is to disable LV caching, resize the LV and reenable it. LV caching can be disabled with the following command:
18
19 {{{
20   lvconvert --uncache vg0/srv
21 }}}