diff --git a/src/init_resize.sh b/src/init_resize.sh index 4e47d30..e87993d 100755 --- a/src/init_resize.sh +++ b/src/init_resize.sh @@ -113,18 +113,20 @@ main () { check_kernel if [ "$ROOT_PART_END" -eq "$TARGET_END" ]; then - reboot_pi + # Issue a warning but continue trying to resize filesystem + echo "Warning: root partition already resized\n" + else + if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then + FAIL_REASON="Root partition resize failed" + return 1 + fi fi - if ! parted -m "$ROOT_DEV" u s resizepart "$ROOT_PART_NUM" "$TARGET_END"; then - FAIL_REASON="Root partition resize failed" - return 1 - fi - - if ! resize2fs "$ROOT_DEV"; then - FAIL_REASON="Root filesystem resize failed" + mount / -o remount,rw + if ! resize2fs "$ROOT_PART_DEV"; then return 1 fi + mount / -o remount,ro fix_partuuid