Skip to content

Never pick a USB or removable device automatically while an internal disk exists - #176

Closed
mastacontrola wants to merge 1 commit into
feat/fogproject-817-smallsizefrom
fix/fogproject-778-usb-last
Closed

Never pick a USB or removable device automatically while an internal disk exists#176
mastacontrola wants to merge 1 commit into
feat/fogproject-817-smallsizefrom
fix/fogproject-778-usb-last

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

For FOGProject/fogproject#778. Stacked on #175, since both change getHardDisk() and its harness; it retargets to master when #175 merges.

The reporter's screenshot shows the deploy going to /dev/sda on a machine whose OS disk is NVMe, with sgdisk refusing every partition as too big for the disk. That /dev/sda is the Focusrite Scarlett's USB storage, which exposes its driver files as a small disk and enumerates ahead of the NVMe.

getHardDisk() now puts USB-transport and removable devices (lsblk TRAN=usb or RM=1) at the back of the pool and leaves them out of the automatic choice, whether that is first-enumerated, largesize=1 or smallsize=1, unless they are the only disks present. Host Primary Disk still matches them by name, so a deliberate USB target keeps working, and a machine whose only disk is USB or an SD card still images.

  • tests/checks/primary-disk-dedup.sh gains a 32 GB USB device enumerated first and cases for each rule: never chosen automatically, last in the pool, matched by name, chosen when alone. Five of eight cases fail on the old code.
  • Full suite: 20 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby

…disk exists

A USB audio interface that exposes its driver files as a small disk
enumerated as /dev/sda ahead of the NVMe, so a single-disk deploy with
no Host Primary Disk wrote to it and sgdisk refused every partition as
too big for the disk (fogproject #778).

getHardDisk() now puts USB-transport and removable devices at the back
of the pool and leaves them out of the automatic choice, whether that is
first-enumerated, largesize=1 or smallsize=1, unless they are the only
disks present. Host Primary Disk still matches them by name, so a
deliberate USB target keeps working.

tests/checks/primary-disk-dedup.sh gains a USB device enumerated first
and cases for each rule.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant