always rewrite the filesystem when the partition table does not match

This commit is contained in:
Simon Bruder 2018-02-16 00:15:39 +00:00
parent 82766cebed
commit 27c561d2df

View file

@ -114,6 +114,7 @@ print_waiting "Checking partition tables"
if [ "$parttable" != "$readtable" ];then
print_done
print_waiting "Partition tables do not match; partitioning disk"
rewrite_rootfs=true
sfdisk -q $disk << PARTTABLE
$parttable
PARTTABLE
@ -125,7 +126,7 @@ fi
print_waiting "Checking root filesystem"
e2fsck -y $root
fsck=$?
if [ $fsck != 0 ] && [ $fsck != 1 ];then
if [ $fsck != 0 ] && [ $fsck != 1 ] || [ "$rewrite_rootfs" == "true" ];then
print_done
print_waiting "Creating root filesystem"
mke2fs -q -F -t ext4 $root