From ae3a58b9b5c9bf6dd4a709b307d03e00cd45bb06 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 4 Oct 2015 18:56:53 +0200 Subject: [PATCH] corrupt partition table error handling --- hashboot | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hashboot b/hashboot index 748bfb4..514422c 100755 --- a/hashboot +++ b/hashboot @@ -86,9 +86,10 @@ startsector=$(LC_ALL=C fdisk -l ${MBR_DEVICE} | grep -A1 'Device' | tail -n1 | a MBR_SIZE=$(expr ${sectorsize} \* ${startsector} / 1024) -if [ ${?} != 0 ] && [ "${1}" != "recover" ] +if [ ${?} != 0 ] then - die 1 "Something went wrong. Most likely your partition table is corrupt. Use hashboot recover to fix this." + echo "Something went wrong. Most likely your partition table is corrupt." >&2 + die 1 "You have to recover the MBR manually by copying the mbr from ${BACKUP_FILE}" fi if [ "${1}" == "index" ]