mirror of
git://sourceware.org/git/lvm2.git
synced 2025-10-07 15:33:21 +03:00
Use dm-writecache to attach a cache volume (CV) to an LV. The LV type becomes "writecache" (--type writecache can be optionally specified when attaching.) lvconvert --cachevol-attach CV LV lvconvert --cachevol-detach CV LV The cachevol (CV) is a special LV that was created on cache devices, e.g. lvcreate --cachevol -L <size> -n <name> VG Cache devices are special PVs that are added to the VG to use for cachevols, e.g. vgextend --cachedev VG PV Example: Add persistent memory to a VG as a cache device: vgextend --cachedev vg /dev/pmem0 Create a cache volume from pmem0: lvcreate --cachevol -L1G -n cvol0 vg Create a second cache volume from pmem0: lvcreate --cachevol -L1G -n cvol1 vg Attach the cache volumes to LVs: lvconvert --cachevol-attach cvol0 vg/lv0 lvconvert --cachevol-attach cvol1 vg/lv1