6

Maybe I'm missing something obvious but I do not see it listed in vgdisplay.

4 Answers 4

6

You can try this format:

# pvdisplay -C --separator '  |  ' -o pv_name,vg_name

You get something like what I think you're looking for:

  PV  |  VG
  /dev/sda2  |  vg_c6srv3
  /dev/sdb2  |  vg_c6srv3
  /dev/sdc2  |  vg_c6srv3
  /dev/sdd1  |  vg_ora112
  /dev/sdd2  |  
  /dev/sdd3  |  vg_ora112
  /dev/sdd5  |  vg_ora101
  /dev/sde1  |  vg_ora112
  /dev/sde2  |  vg_ora112
  /dev/sde3  |  
  /dev/sde4  |  vg_ora101
  /dev/sdf1  |  vg_ora112
  /dev/sdf2  |  
  /dev/sdf3  |  vg_ora112
  /dev/sdf5  |  vg_ora101

Hope that helps.

7

pvdisplay shows the VG each PV belongs to.

2
  • I've been doing pvs | grep volume_group but I thought I might be missing something better suited for this. Nov 9, 2010 at 19:07
  • 2
    And so does pvs, if one wants a more concise form.
    – Gabriel
    Jan 7, 2014 at 18:43
0
vgdisplay -v <volume_group_name> 2> /dev/null | awk '/PV Name/ {print $3}'
1
  • 2
    Can you elaborate? Just pasting a commandline input isn't always easy to understand.
    – K.A.Monica
    Jan 7, 2014 at 4:46
0

to answer the question, it is just as simple as:

pvdisplay -S vgname=YOUR_VOLUME_GROUP_NAME

but if you want a simple overview of all physical volumes with its related volume groups:

pvdisplay -C -o pv_name,vg_name or even simpler just pvs

or that overview filtered on a specific volume group:

pvdisplay -C -o pv_name,vg_name -S vgname=YOUR_VOLUME_GROUP_NAME

where:

-C|--columns
              Display output in columns, the equivalent of vgs(8).  Options listed are the same as options given in vgs(8).
-o|--options String
              Comma-separated, ordered list of fields to display in columns.
-S|--select String
              Select objects for processing and reporting based on specified criteria.

Example output:

# pvdisplay -C -o pv_name,vg_name -S vgname=vg_home
  PV         VG
  /dev/sdb   vg_home

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.