Add some tips about LV caching
[mirror/dsa-wiki.git] / input / howto / lvm.creole
diff --git a/input/howto/lvm.creole b/input/howto/lvm.creole
new file mode 100644 (file)
index 0000000..ef201e6
--- /dev/null
@@ -0,0 +1,21 @@
+== Random LVM stuff ==
+
+=== LV caching ===
+
+We use LV caching at least on godard.d.o and smit.d.o. Here are the setup instructions:
+
+* Make sure that both the HDD and SSD are in the same volume group.
+
+* Make sure module loading is enabled
+
+* Run the following command to enable LV caching for the srv LV in the vg0 VG, assuming the SSD is /dev/sda3:
+
+{{{
+  lvcreate --type cache --cachemode writethrough -L 120G -n srv_cachepool vg0/srv /dev/sda3
+}}}
+
+* 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:
+
+{{{
+  lvconvert --uncache vg0/srv
+}}}