Verified Commit f449c7c6 authored by kienan's avatar kienan

Do not try to dump partition tables for a disk when non are detected

Refs #11293
parent f9529d1d
......@@ -609,12 +609,18 @@ fi
if [ "$partitions" == "yes" ]; then
if [ "$dosfdisk" == "yes" ]; then
devices=`LC_ALL=C $LSBLK --output NAME,TYPE --list --paths 2>/dev/null | grep "disk$" | grep -v '^/dev/zram' | @AWK@ '{print $1}'`
partitions=`LC_ALL=C $SFDISK -l 2>/dev/null |grep "^/dev" | @AWK@ '{print $1}'`
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
echo "${partitions}" | grep -q "${dev}"
if [ $? -ne 0 ] ; then
info "The device $dev does not appear to have any partitions"
continue
fi
label=${dev#/dev/}
label=${label//\//-}
outputfile=${partitionsfile//__star__/$label}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment