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"