Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Adding tags to LVM volumes and showing volumes that possess that tag is easy and works like a charm; but somehow I can't find a way to list all tags in use, or to show tags that apply to a specific volume. lvdisplay -v doesn't give me details on tags, neither lvs seems to have any option for that. (I am using CentOS 5.4.)

share|improve this question
up vote 5 down vote accepted

Showing tags that belong to a specific volume:

# lvchange --addtag @RootFS /dev/VolGroup00/LogVol00
Logical volume "LogVol00" changed

# lvs -o lv_tags /dev/VolGroup00/LogVol00
  LV Tags

# lvs -o lv_tags /dev/VolGroup00/LogVol01
  LV Tags

You can easily script getting the active tags for a specific volume that way.

If you parse the output of the lvs command, and run the logical volumes through the command I used above, you'll be able to grep, sed and awk your way to a list of all tags in use.

Physical volumes and volume groups have commands that are similar to the above:

# pvs -o pv_tags /dev/sda2
  PV Tags

# vgs -o vg_tags /dev/VolGroup00
  VG Tags

Here's a Red Hat KB article about this

share|improve this answer
Thanks a lot! That was exactly what I was searching for :) – ikso May 28 '10 at 15:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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