Mike Burns
2010-Mar-26 13:09 UTC
[Ovirt-devel] [PATCH node] Use vg uuid when detecting whether vg spans multiple disks
In the case where there are multiple volume groups with the same name, the only way to differentiate is with the uuid. Now we will compare uuid's so we don't report the the vg spans multiple disks when it's a duplicate id. Signed-off-by: Mike Burns <mburns at redhat.com> --- scripts/ovirt-config-storage | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/ovirt-config-storage b/scripts/ovirt-config-storage index 8d59a6b..9d8c482 100755 --- a/scripts/ovirt-config-storage +++ b/scripts/ovirt-config-storage @@ -563,9 +563,9 @@ wipe_lvm_on_disk() if [[ "$dev" =~ "/dev/sd" ]]; then part_delim="" fi - for vg in $(pvs -o vg_name --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do - if pvs -o pv_name,vg_name --noheadings | \ - grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev}" 2>/dev/null; then + for vg in $(pvs -o vg_uuid --noheadings $dev $dev${dev_delim}[0-9]* 2>/dev/null|sort -u); do + if pvs -o pv_name,vg_uuid --noheadings | \ + grep $vg | egrep -v -q "${dev}${part_delim}[0-9]+|${dev} " 2>/dev/null; then log "The volume group \"$vg\" spans multiple disks." log "This operation cannot complete. Please manually" log "cleanup the storage using standard linux tools." -- 1.6.6.1
Apparently Analagous Threads
- [PATCH node] fix install when VG exists on disk
- [PATCH] RFC: Advanced Storage Configuration
- [PATCH node] Handle space in storage wwid
- RESEND: [PATCH node 1/3] enables ability for a common shared root
- [PATCH node] First draft of replacing some of the ovirt-config-* scripts with python equivalents.