diff --git a/hashboot b/hashboot index c590a15..425ca3f 100755 --- a/hashboot +++ b/hashboot @@ -96,7 +96,11 @@ if [ "${sectorsize}" == "=" ] # Older versions of util-linux then sectorsize=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep '^Units' | awk '{print $9}' ) fi -startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $3}' ) +startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $2}' ) +if [ "${startsector}" == "*" ] # If partition is marked as boot, read next field +then + startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $3}' ) +fi MBR_SIZE=$(expr ${sectorsize} \* ${startsector} / 1024)