summaryrefslogtreecommitdiff
path: root/scripts/vgimportclone.sh
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@redhat.com>2013-10-21 18:04:14 -0400
committerMike Snitzer <snitzer@redhat.com>2013-10-21 18:04:14 -0400
commit65456a4a29d8f25ab75af2145b8a6b2a9ff391e5 (patch)
tree2c13752e6b613a0a06f3af86d2c0891a7955d625 /scripts/vgimportclone.sh
parent7763607f3617188906dae9e9ae218e9099f5e6e9 (diff)
downloadlvm2-65456a4a29d8f25ab75af2145b8a6b2a9ff391e5.tar.gz
vgimportclone: remove 2>/dev/null from three lvm commands
There is no point eating stderr for these commands. In fact the redirect causes confusion and hurts dubugging. Also reword an error message if the pvs command fails so as not be certain that a device is not a PV. Coupled with removing the stderr redirect this will improve the user experience in the face of errors.
Diffstat (limited to 'scripts/vgimportclone.sh')
-rwxr-xr-xscripts/vgimportclone.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh
index d6ad75d3c..708755792 100755
--- a/scripts/vgimportclone.sh
+++ b/scripts/vgimportclone.sh
@@ -204,8 +204,8 @@ for ARG
do
if [ -b "$ARG" ]
then
- PVS_OUT=`"${LVM}" pvs ${LVM_OPTS} --noheadings -o vg_name "$ARG" 2>/dev/null`
- checkvalue $? "$ARG is not a PV."
+ PVS_OUT=`"${LVM}" pvs ${LVM_OPTS} --noheadings -o vg_name "$ARG"`
+ checkvalue $? "$ARG could not be verified to be a PV without errors."
PV_VGNAME=$(echo $PVS_OUT | $GREP -v '[[:space:]]+$')
[ -z "$PV_VGNAME" ] && die 3 "$ARG is not in a VG."
@@ -227,7 +227,7 @@ fi
### Get the existing state so we can use it later
#####################################################################
-OLDVGS=`"${LVM}" vgs ${LVM_OPTS} -o name --noheadings 2>/dev/null`
+OLDVGS=`"${LVM}" vgs ${LVM_OPTS} -o name --noheadings`
checkvalue $? "Current VG names could not be collected without errors"
#####################################################################
@@ -280,7 +280,7 @@ export LVM_SYSTEM_DIR=${TMP_LVM_SYSTEM_DIR}
### Rename the VG(s) and change the VG and PV UUIDs.
#####################################################################
-PVINFO=`"${LVM}" pvs ${LVM_OPTS} -o pv_name,vg_name,vg_attr --noheadings --separator : 2>/dev/null`
+PVINFO=`"${LVM}" pvs ${LVM_OPTS} -o pv_name,vg_name,vg_attr --noheadings --separator :`
checkvalue $? "PV info could not be collected without errors"
# output VG info so each line looks like: name:exported?:disk1,disk2,...