From: Steeve McCauley <steeve@terrascale.net>
To: linux-lvm@redhat.com
Subject: [linux-lvm] Listing physical volumes in a volume group
Date: Fri, 03 Aug 2007 10:19:06 -0400 [thread overview]
Message-ID: <46B3395A.5020701@terrascale.net> (raw)
I would like to know if there is a canonical way to list the
physical volumes in a volume group, specifically to extract
the uuid for those PVs in a bash script. I am able to do
something along the lines of,
PVS=$(vgdisplay -vv 2>&1 | grep "PV UUID" | awk '{print $3}')
PVUUID=$(pvs -o pv_uuid --noheadings /dev/sdx | awk '{print $1}')
and then look for PVUUID in the list of PVS.
for uuid in $PVS; do
[ "$uuid" != "$PVUUID" ] && continue
...
done
but this relies on the output format of 'vgdisplay -vv' and
I want to be sure that I will always get the expected result.
Thanks,
steeve
--
Steeve McCauley
:wq
next reply other threads:[~2007-08-03 15:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-03 14:19 Steeve McCauley [this message]
2007-08-03 15:46 ` [linux-lvm] Listing physical volumes in a volume group Milan Broz
2007-08-03 16:01 ` Steeve McCauley
2007-08-07 20:24 ` Alasdair G Kergon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46B3395A.5020701@terrascale.net \
--to=steeve@terrascale.net \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.