diff --git a/imagesync.sh b/imagesync.sh index 4a893aa..8a91d60 100755 --- a/imagesync.sh +++ b/imagesync.sh @@ -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