Skip to content
Snippets Groups Projects
Verified Commit f449c7c6 authored by Kienan Stewart's avatar Kienan Stewart
Browse files

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

Refs #11293
parent f9529d1d
No related branches found
No related tags found
No related merge requests found
......@@ -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}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment