From 5c2182a1c9bbe111187f348fcaeddda5b82e762c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Mon, 27 Apr 2026 16:30:19 +0200 Subject: [PATCH] Fix parted failing on busy partition in script mode parted -s answers confirmation prompts with "no" (conservative), causing resizepart/mkpart to fail on a mounted partition. Pipe "Yes" to parted stdin instead so busy-partition warnings are confirmed and the operation proceeds. Co-Authored-By: Claude Sonnet 4.6 --- system_setup/install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system_setup/install.sh b/system_setup/install.sh index bc95dd3..3615166 100755 --- a/system_setup/install.sh +++ b/system_setup/install.sh @@ -377,14 +377,15 @@ if [[ "$MODE" == "shrink" ]]; then fi info "Shrinking partition $S_PNUM to ${NEW_END} MiB in partition table..." - parted -s "$S_DISK" resizepart "$S_PNUM" "${NEW_END}MiB" \ + # Use printf instead of -s so parted's "partition is busy" confirmation is answered Yes + printf 'Yes\n' | parted "$S_DISK" resizepart "$S_PNUM" "${NEW_END}MiB" \ || die "parted resizepart failed." fi # ── Create OEMDRV partition ─────────────────────────────────────────────────── info "Creating new OEMDRV partition (${OEMDRV_START}–${OEMDRV_END} MiB) on $WORK_DISK..." -parted -s "$WORK_DISK" mkpart primary btrfs "${OEMDRV_START}MiB" "${OEMDRV_END}MiB" \ +printf 'Yes\n' | parted "$WORK_DISK" mkpart primary btrfs "${OEMDRV_START}MiB" "${OEMDRV_END}MiB" \ || die "parted mkpart failed. Check that the target area is free space on $WORK_DISK." partprobe "$WORK_DISK"