2

In dm-cache, how do you make snapshots on a cached LV?

I tried the usual way on a CentOS 6.7 installation and got the following results:

# lvs
LV         VG          Attr       LSize   Pool          Origin             Data%  Meta%  Move Log Cpy%Sync Convert
LogVol00   vg_server17 -wi-ao---- 117.19g
LogVol01   vg_server17 -wi-ao----  78.12g
kvm163_img vg_server17 Cwi-aoC---   1.05t [DataLVcache] [kvm163_img_corig] 10.14  12.29           0.00

# lvcreate -s -n /dev/vg_server17/kvm163_img_snap -L 10G /dev/vg_server17/kvm163_img

  Snapshots of cache type volume vg_server17/kvm163_img is not supported.

Any advice?

  • 1
    I've got an answer for this from the linux-lvm mailing list: "Support for snapshot of cached LV is not yet written - so you need to uncache LV for now." – Syahrul Sazli Shaharir Nov 11 '15 at 9:43
0

As a workaround you could change your setup and use cached LVM volume (/dev/vg_server17/kvm163_img in your setup) as a PV for another VG where snapshots would work.

Have verified such setup on Debian Jessie. It works well, however, require some changes to configuration.

To workaround duplicate PVs detected by LVM (cache origin and cached device have same LVM PV meta) update /etc/lvm/lvm.conf:

# Never scan LVM's own cache volumes. 
# Even if one of that would be identified as PV, most likely, use of cached non-origin is preferred.
global_filter = [ "r|^/dev/.*_corig$|", "r|^/dev/.*_cdata$|", "r|^/dev/.*_cmeta$|" ]

To workaround bug with missing /usr/sbin/cache_check on reboot:

apt-get install thin-provisioning-tools

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.