Hide Forgot
Document URL: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lvm_tags.html Section Number and Name: Appendix D. LVM Object Tags Describe the issue: The document incorrectly describes lvm snapshot tagging as not possible. Excerpt: "Only objects in a volume group can be tagged. Physical volumes lose their tags if they are removed from a volume group; this is because tags are stored as part of the volume group metadata and that is deleted when a physical volume is removed. Snapshots cannot be tagged." Per https://www.redhat.com/archives/linux-lvm/2012-April/msg00032.html this works and is supported. Suggestions for improvement: Remove the last sentence from the mentioned paragraph.
Yes, it works (for both snapshots and thinsnaps): [root@bp-01 ~]# lvs vg LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv vg rwi-a-r--- 500.00m 100.00 [root@bp-01 ~]# lvs -o name,attr,size,segtype,tags vg LV Attr LSize Type LV Tags lv rwi-a-r--- 500.00m raid1 [root@bp-01 ~]# lvcreate -s -L 500M -n snap vg/lv Using default stripesize 64.00 KiB. Logical volume "snap" created. [root@bp-01 ~]# lvs -o name,attr,size,segtype,tags vg LV Attr LSize Type LV Tags lv owi-aor--- 500.00m raid1 snap swi-a-s--- 500.00m linear [root@bp-01 ~]# lvchange --addtag foo vg/snap Logical volume vg/snap changed. [root@bp-01 ~]# lvs -o name,attr,size,segtype,tags vg LV Attr LSize Type LV Tags lv owi-aor--- 500.00m raid1 snap swi-a-s--- 500.00m linear foo [root@bp-01 ~]# lvcreate -T -L 5G -V50G -n thinLV --thinpool vg/tpool Using default stripesize 64.00 KiB. WARNING: Sum of all thin volume sizes (50.00 GiB) exceeds the size of thin pool vg/tpool (5.00 GiB)! For thin pool auto extension activation/thin_pool_autoextend_threshold should be below 100. Logical volume "thinLV" created. [root@bp-01 ~]# lvs -o name,attr,size,segtype,tags vg LV Attr LSize Type LV Tags lv owi-aor--- 500.00m raid1 snap swi-a-s--- 500.00m linear foo thinLV Vwi-a-tz-- 50.00g thin tpool twi-aotz-- 5.00g thin-pool [root@bp-01 ~]# lvcreate -s -n thinSnap vg/thinLV Using default stripesize 64.00 KiB. WARNING: Sum of all thin volume sizes (100.00 GiB) exceeds the size of thin pool vg/tpool (5.00 GiB)! For thin pool auto extension activation/thin_pool_autoextend_threshold should be below 100. Logical volume "thinSnap" created. [root@bp-01 ~]# lvs -o name,attr,size,segtype,tags vg LV Attr LSize Type LV Tags lv owi-aor--- 500.00m raid1 snap swi-a-s--- 500.00m linear foo thinLV Vwi-a-tz-- 50.00g thin thinSnap Vwi---tz-k 50.00g thin tpool twi-aotz-- 5.00g thin-pool [root@bp-01 ~]# lvchange --addtag bar vg/thinSnap Logical volume vg/thinSnap changed. [root@bp-01 ~]# lvs -o name,attr,size,segtype,tags vg LV Attr LSize Type LV Tags lv owi-aor--- 500.00m raid1 snap swi-a-s--- 500.00m linear foo thinLV Vwi-a-tz-- 50.00g thin thinSnap Vwi---tz-k 50.00g thin bar tpool twi-aotz-- 5.00g thin-pool
Updated in draft. I will close this bz when the fix appears on the Portal.
The RHEL 6 copy of the LVM manual on the portal no longer includes the two mentions that tagging is not supported on snapshots. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lvm_tags.html