mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix underquotations in lvm_dump.sh.
This commit is contained in:
parent
da08e40f8f
commit
216283b651
@ -1,6 +1,7 @@
|
|||||||
Version 2.02.29 -
|
Version 2.02.29 -
|
||||||
==================================
|
==================================
|
||||||
Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries.
|
Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries.
|
||||||
|
Fix underquotations in lvm_dump.sh.
|
||||||
Refactor lvcreate stripe and mirror parameter validation.
|
Refactor lvcreate stripe and mirror parameter validation.
|
||||||
All tools: print --help output to stdout, not stderr.
|
All tools: print --help output to stdout, not stderr.
|
||||||
After a diagnostic, suggest --help, rather than printing all --help output.
|
After a diagnostic, suggest --help, rather than printing all --help output.
|
||||||
|
@ -91,11 +91,11 @@ log="$dir/lvmdump.log"
|
|||||||
|
|
||||||
myecho() {
|
myecho() {
|
||||||
echo "$@"
|
echo "$@"
|
||||||
echo "$@" >> $log
|
echo "$@" >> "$log"
|
||||||
}
|
}
|
||||||
|
|
||||||
log() {
|
log() {
|
||||||
echo "$@" >> $log
|
echo "$@" >> "$log"
|
||||||
eval "$@"
|
eval "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,19 +107,19 @@ if (( $advanced )); then
|
|||||||
myecho "Gathering LVM volume info..."
|
myecho "Gathering LVM volume info..."
|
||||||
|
|
||||||
myecho " vgscan..."
|
myecho " vgscan..."
|
||||||
log "$LVM vgscan -vvvv > $dir/vgscan 2>&1"
|
log "\"$LVM\" vgscan -vvvv > \"$dir/vgscan\" 2>&1"
|
||||||
|
|
||||||
myecho " pvscan..."
|
myecho " pvscan..."
|
||||||
log "$LVM pvscan -v >> $dir/pvscan 2>> $log"
|
log "\"$LVM\" pvscan -v >> \"$dir/pvscan\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho " lvs..."
|
myecho " lvs..."
|
||||||
log "$LVM lvs -a -o +devices >> $dir/lvs 2>> $log"
|
log "\"$LVM\" lvs -a -o +devices >> \"$dir/lvs\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho " pvs..."
|
myecho " pvs..."
|
||||||
log "$LVM pvs -a -v > $dir/pvs 2>> $log"
|
log "\"$LVM\" pvs -a -v > \"$dir/pvs\" 2>> \"$log\""
|
||||||
|
|
||||||
echo " vgs..."
|
myecho " vgs..."
|
||||||
log "$LVM vgs -v > $dir/vgs 2>> $log"
|
log "\"$LVM\" vgs -v > \"$dir/vgs\" 2>> \"$log\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( $clustered )); then
|
if (( $clustered )); then
|
||||||
@ -129,7 +129,7 @@ if (( $clustered )); then
|
|||||||
for i in nodes status services; do
|
for i in nodes status services; do
|
||||||
cap_i=$(echo $i|tr a-z A-Z)
|
cap_i=$(echo $i|tr a-z A-Z)
|
||||||
printf "$cap_i:\n----------------------------------\n"
|
printf "$cap_i:\n----------------------------------\n"
|
||||||
log "cman_tool $i 2>> $log"
|
log "cman_tool $i 2>> \"$log\""
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -161,50 +161,50 @@ if (( $clustered )); then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
myecho "Gathering LVM & device-mapper version info..."
|
myecho "Gathering LVM & device-mapper version info..."
|
||||||
echo "LVM VERSION:" > $dir/versions
|
echo "LVM VERSION:" > "$dir/versions"
|
||||||
"$LVM" lvs --version >> $dir/versions 2>> $log
|
"$LVM" lvs --version >> "$dir/versions" 2>> "$log"
|
||||||
echo "DEVICE MAPPER VERSION:" >> $dir/versions
|
echo "DEVICE MAPPER VERSION:" >> "$dir/versions"
|
||||||
"$DMSETUP" --version >> $dir/versions 2>> $log
|
"$DMSETUP" --version >> "$dir/versions" 2>> "$log"
|
||||||
echo "KERNEL VERSION:" >> $dir/versions
|
echo "KERNEL VERSION:" >> "$dir/versions"
|
||||||
"$UNAME" -a >> $dir/versions 2>> $log
|
"$UNAME" -a >> "$dir/versions" 2>> "$log"
|
||||||
echo "DM TARGETS VERSIONS:" >> $dir/versions
|
echo "DM TARGETS VERSIONS:" >> "$dir/versions"
|
||||||
"$DMSETUP" targets >> $dir/versions 2>> $log
|
"$DMSETUP" targets >> "$dir/versions" 2>> "$log"
|
||||||
|
|
||||||
myecho "Gathering dmsetup info..."
|
myecho "Gathering dmsetup info..."
|
||||||
log "$DMSETUP info -c > $dir/dmsetup_info 2>> $log"
|
log "\"$DMSETUP\" info -c > \"$dir/dmsetup_info\" 2>> \"$log\""
|
||||||
log "$DMSETUP table > $dir/dmsetup_table 2>> $log"
|
log "\"$DMSETUP\" table > \"$dir/dmsetup_table\" 2>> \"$log\""
|
||||||
log "$DMSETUP status > $dir/dmsetup_status 2>> $log"
|
log "\"$DMSETUP\" status > \"$dir/dmsetup_status\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho "Gathering process info..."
|
myecho "Gathering process info..."
|
||||||
log "$PS alx > $dir/ps_info 2>> $log"
|
log "$PS alx > \"$dir/ps_info\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho "Gathering console messages..."
|
myecho "Gathering console messages..."
|
||||||
log "$TAIL -n 75 /var/log/messages > $dir/messages 2>> $log"
|
log "$TAIL -n 75 /var/log/messages > \"$dir/messages\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho "Gathering /etc/lvm info..."
|
myecho "Gathering /etc/lvm info..."
|
||||||
log "$CP -a /etc/lvm $dir/lvm 2>> $log"
|
log "$CP -a /etc/lvm \"$dir/lvm\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho "Gathering /dev listing..."
|
myecho "Gathering /dev listing..."
|
||||||
log "$LS -laR /dev > $dir/dev_listing 2>> $log"
|
log "$LS -laR /dev > \"$dir/dev_listing\" 2>> \"$log\""
|
||||||
|
|
||||||
myecho "Gathering /sys/block listing..."
|
myecho "Gathering /sys/block listing..."
|
||||||
log "$LS -laR /sys/block > $dir/sysblock_listing"
|
log "$LS -laR /sys/block > \"$dir/sysblock_listing\""
|
||||||
|
|
||||||
if (( $metadata )); then
|
if (( $metadata )); then
|
||||||
myecho "Gathering LVM metadata from Physical Volumes..."
|
myecho "Gathering LVM metadata from Physical Volumes..."
|
||||||
|
|
||||||
log "$MKDIR -p $dir/metadata"
|
log "$MKDIR -p \"$dir/metadata\""
|
||||||
|
|
||||||
pvs="$($LVM pvs --separator , --noheadings --units s --nosuffix -o \
|
pvs="$("$LVM" pvs --separator , --noheadings --units s --nosuffix -o \
|
||||||
name,pe_start 2>> $log | $SED -e 's/^ *//')"
|
name,pe_start 2>> "$log" | $SED -e 's/^ *//')"
|
||||||
for line in "$pvs"
|
for line in "$pvs"
|
||||||
do
|
do
|
||||||
test -z "$line" && continue
|
test -z "$line" && continue
|
||||||
pv="$(echo $line | $CUT -d, -f1)"
|
pv="$(echo $line | $CUT -d, -f1)"
|
||||||
pe_start="$(echo $line | $CUT -d, -f2)"
|
pe_start="$(echo $line | $CUT -d, -f2)"
|
||||||
name="$($BASENAME $pv)"
|
name="$($BASENAME "$pv")"
|
||||||
myecho " $pv"
|
myecho " $pv"
|
||||||
log "$DD if=$pv of=$dir/metadata/$name bs=512 count=$pe_start 2>> $log"
|
log "$DD if=$pv \"of=$dir/metadata/$name\" bs=512 count=$pe_start 2>> \"$log\""
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -212,8 +212,8 @@ if test -z "$userdir"; then
|
|||||||
lvm_dump="$dirbase.tgz"
|
lvm_dump="$dirbase.tgz"
|
||||||
myecho "Creating report tarball in $HOME/$lvm_dump..."
|
myecho "Creating report tarball in $HOME/$lvm_dump..."
|
||||||
cd "$HOME"
|
cd "$HOME"
|
||||||
"$TAR" czf $lvm_dump $dirbase 2>/dev/null
|
"$TAR" czf "$lvm_dump" "$dirbase" 2>/dev/null
|
||||||
"$RM" -rf $dir
|
"$RM" -rf "$dir"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$UID" != "0" && test "$EUID" != "0"; then
|
if test "$UID" != "0" && test "$EUID" != "0"; then
|
||||||
|
Loading…
Reference in New Issue
Block a user