1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

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.
This commit is contained in:
Mike Snitzer 2013-10-21 18:04:14 -04:00
parent 7763607f36
commit 65456a4a29
2 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.104
===================================
Remove 2>/dev/null from three lvm commands executed by vgimportclone.
Add configure --enable-udev-systemd-background-jobs.
Add lvm2-pvscan@.service to run pvscan as a service for lvmetad/autoactivation.
Fix lvconvert swap of poolmetadata volume for active thin pool.

View File

@ -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,...