[linux-lvm] addtag

Clay Gerrard clay.gerrard at gmail.com
Thu Apr 26 15:09:12 UTC 2012


On Ubuntu Oneiric the man page for lvm describes the use of tags, with
an addendum about tagging snapshots:

       --addtag tag
              Add  the tag tag to a PV, VG or LV.  A tag is a word that can be
              used to group LVM2 objects of the same type together.  Tags  can
              be given on the command line in place of PV, VG or LV arguments.
              Tags should be prefixed with @ to avoid ambiguity.  Each tag  is
              expanded  by  replacing  it with all objects possessing that tag
              which are of the type expected by its position  on  the  command
              line.  PVs can only possess tags while they are part of a Volume
              Group: PV tags are discarded if the PV is removed from  the  VG.
              As  an example, you could tag some LVs as database and others as
              userdata and then activate the database ones with  lvchange  -ay
              @database.   Objects  can  possess multiple tags simultaneously.
              Only the new LVM2  metadata  format  supports  tagging:  objects
              using  the LVM1 metadata format cannot be tagged because the on-
              disk format does not support it.  **Snapshots  cannot
be  tagged.**
              Characters allowed in tags are: A-Z a-z 0-9 _ + . -

Specifically I'm concerned about "Snapshots  cannot  be  tagged."

It seems that tagging of snapshots *is* supported?

	root at myhost:~# lvcreate myvg -n vol1 -L 100M
	  Logical volume "vol1" created
	root at myhost:~# lvcreate myvg/vol1 -s -n mysnap -L 100M
	  Logical volume "mysnap" created
	root at myhost:~# lvchange --addtag mytag myvg/mysnap
	  Logical volume "mysnap" changed
	root at myhost:~# lvs @mytag
	  LV     VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert
	  mysnap myvg swi-a- 100.00m vol1     0.01


Can I rely on this feature being supported for snapshots despite the
man page's statement to the contrary?

Best Regards,

-clayg




More information about the linux-lvm mailing list