From defa82c46c54fac05087a0514bb957d4cb31aeb3 Mon Sep 17 00:00:00 2001 From: randogoth Date: Sun, 1 Feb 2026 20:35:07 +0200 Subject: [PATCH] Fix disk selection for installer prompts --- scripts/install-btrfs.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/install-btrfs.sh b/scripts/install-btrfs.sh index 28ddb07..f5c8cb1 100755 --- a/scripts/install-btrfs.sh +++ b/scripts/install-btrfs.sh @@ -85,6 +85,7 @@ if (( ! NON_INTERACTIVE )); then disk_choices+=("$d" "") done DISK=$(prompt_select "disk" "Select target disk (will be wiped)" "${disk_choices[@]}") + DISK=${DISK%% *} # strip size suffix from selection fi target_mode=$(prompt_select "mode" "Partitioning mode" \ @@ -129,6 +130,11 @@ mapper_root="" echo "[1/8] Partitioning/selection" if [[ -z "$ROOT_PART" ]]; then + if [[ ! -b "$DISK" ]]; then + echo "Error: target disk ${DISK} not found. Available disks:" + ls_disks + exit 1 + fi printf "label: gpt\n,550M,U,boot\n,,L,cryptroot\n" | sfdisk "${DISK}" part_boot="${DISK}1" part_root="${DISK}2"