Never pick a USB or removable device automatically while an internal disk exists - #177
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For FOGProject/fogproject#778. Replaces #176, which GitHub closed when its stacked base branch was deleted at the merge of #175.
The reporter's screenshot shows the deploy going to
/dev/sdaon a machine whose OS disk is NVMe, with sgdisk refusing every partition as too big for the disk. That/dev/sdais 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=usborRM=1) at the back of the pool and leaves them out of the automatic choice, whether that is first-enumerated,largesize=1orsmallsize=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.shgains 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.🤖 Generated with Claude Code
https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby