From 6c6d5763c47145ac934e1c2e9c21dccb84303b62 Mon Sep 17 00:00:00 2001 From: Michal Date: Sun, 29 Mar 2026 12:51:44 +0100 Subject: [PATCH] fix: skip USB-attached disks in %pre (JetKVM virtual media is SCSI-over-USB) Check sysfs device path for 'usb' to skip JetKVM virtual media which appears as /dev/sda but is not a real install target. Co-Authored-By: Claude Opus 4.6 (1M context) --- bastion/src/bastion/src/templates/install.ks.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bastion/src/bastion/src/templates/install.ks.ts b/bastion/src/bastion/src/templates/install.ks.ts index a989309..ea1a035 100644 --- a/bastion/src/bastion/src/templates/install.ks.ts +++ b/bastion/src/bastion/src/templates/install.ks.ts @@ -90,11 +90,14 @@ chmod 440 /etc/sudoers.d/${adminUser}`; : `DISK="" # Wait up to 10s for NVMe/SCSI disks to appear (they init async in initrd) for _wait in $(seq 1 10); do - for d in /dev/nvme0n1 /dev/sda /dev/vda; do + for d in /dev/nvme0n1 /dev/nvme1n1 /dev/sda /dev/sdb /dev/vda; do [ -b "$d" ] || continue - # Skip removable disks (USB, CD-ROM, JetKVM virtual media) _bname=$(basename "$d") + # Skip removable disks (USB, CD-ROM, JetKVM virtual media) [ -f "/sys/block/$_bname/removable" ] && [ "$(cat /sys/block/$_bname/removable)" = "1" ] && continue + # Skip USB-attached disks (JetKVM virtual media shows as SCSI over USB) + _transport=$(readlink -f /sys/block/$_bname/device 2>/dev/null || echo "") + echo "$_transport" | grep -q "usb" && continue # Skip disks smaller than 20GB (likely USB sticks) _size=$(cat /sys/block/$_bname/size 2>/dev/null || echo 0) [ "$_size" -lt 41943040 ] && continue