3 file -bks $device | grep -qF partition
8 echo " partition tables"
13 # Step 1: Find partition to which this sector belongs
19 echo "# $device: partition table detected" 1>&2
21 partdev="`fdisk -ul $device | awk -v sector="$sector" -F '[ *]+' '/^\// && !/Extended$/ && $2<=sector && $3>=sector {print $1,$2}'`" #`"
23 if [ -z "$partdev" ]; then
24 echo "# sector $sector is not part of any partition on $device" 1>&2
28 partstart="${partdev#* }"
29 partdev="${partdev% *}"
30 partsector="`dc -e "$sector $partstart - p"`" # `"
32 echo "offset $partstart"
33 echo "device $partdev partition"
34 echo "sector $partsector"
42 register_mapper "partition"