From a8dcb7496a1f8cbf3b0a489e876469ed55bc77eb Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 4 Oct 2015 18:19:10 +0200 Subject: [PATCH] Throw error if partition table seems corrupt --- hashboot | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hashboot b/hashboot index 3bf4c1a..b1ff916 100755 --- a/hashboot +++ b/hashboot @@ -65,6 +65,10 @@ mbr_size () startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | awk '{print $3}') expr ${sectorsize} \* ${startsector} / 1024 + if [ ${?} != 0 ] + then + die 1 "Something went wrong. Most likely your partition table is corrupt. Use hashboot recover to fix this." + fi } write_hashes ()