From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx2.redhat.com (mx2.redhat.com [10.255.15.25]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id l73FBLYC031723 for ; Fri, 3 Aug 2007 11:11:21 -0400 Received: from mail.terrascale.net ([64.254.245.114]) by mx2.redhat.com (8.13.1/8.13.1) with ESMTP id l73FBKcu022996 for ; Fri, 3 Aug 2007 11:11:20 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.terrascale.net (Postfix) with ESMTP id 72F4BA4027 for ; Fri, 3 Aug 2007 14:19:08 +0000 (UTC) Received: from mail.terrascale.net ([127.0.0.1]) by localhost (mail.terrascale.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05919-10 for ; Fri, 3 Aug 2007 10:19:07 -0400 (EDT) Received: from [172.20.6.11] (monkey.ts [172.20.6.11]) by mail.terrascale.net (Postfix) with ESMTP id B610EA4026 for ; Fri, 3 Aug 2007 10:19:07 -0400 (EDT) Message-ID: <46B3395A.5020701@terrascale.net> Date: Fri, 03 Aug 2007 10:19:06 -0400 From: Steeve McCauley MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [linux-lvm] Listing physical volumes in a volume group Reply-To: LVM general discussion and development List-Id: LVM general discussion and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-lvm@redhat.com 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