From 27c561d2df1c8c75e0d0107794e3efa0f27f8232 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 16 Feb 2018 00:15:39 +0000 Subject: [PATCH] always rewrite the filesystem when the partition table does not match --- imagesync.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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