3 [ -z "`fdisk -l $device 2>&1 >/dev/null`" ]
8 echo " partition tables"
13 # Step 1: Find partition to which this sector belongs
19 partdev="`fdisk -ul $device | awk -v sector="$sector" -F '[ *]+' '/^\// && !/Extended$/ && $2<=sector && $3>=sector {print $1,$2}'`" #`"
21 if [ -z "$partdev" ]; then
22 echo "# sector $sector is not part of any partition on $device" 1>&2
26 partstart="${partdev#* }"
27 partdev="${partdev% *}"
28 partsector="`dc -e "$sector $partstart - p"`" # `"
30 echo "offset $partstart"
31 echo "device $partdev partition"
32 echo "sector $partsector"
38 register_mapper "partition"