X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fsys;h=57d9d60859c37d2efba1052b2cbe7295d65b1e0b;hb=42b7be6130c2e4ebc29ea87647aa80a34c596215;hp=677d5eee1b72ece94935c8e4fdf138b6a8fb88a9;hpb=56c992661cec11bc5caf9511ba1e1d6384cebaa7;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/sys b/handlers/sys index 677d5ee..57d9d60 100755 --- a/handlers/sys +++ b/handlers/sys @@ -443,17 +443,21 @@ fi # these files can be used to directly partition a disk of the same size. if [ "$partitions" == "yes" ]; then - devices=`$SFDISK -l | grep "^Disk /dev" | cut -d/ -f2,3 | cut -d: -f1` + devices=`$SFDISK -l 2>/dev/null | grep "^Disk /dev" | awk '{print $2}' | cut -d: -f1` if [ "$devices" == "" ]; then warning "No harddisks found" fi for dev in $devices; do + debug "$SFDISK will try to backup partition tables for device $dev" [ -b $dev ] || continue label=${dev#/dev/} label=${label//\//-} outputfile=${partitionsfile//__star__/$label} - debug "$SFDISK $sfdisk_options -d /$dev > $outputfile" - $SFDISK $sfdisk_options -d /$dev > $outputfile + debug "$SFDISK $sfdisk_options -d $dev > $outputfile 2>/dev/null" + $SFDISK $sfdisk_options -d $dev > $outputfile 2>/dev/null + if [ $? -ne 0 ]; then + warning "The partition table for $dev could not be saved." + fi done fi