Skip to content

Drop a matched Host Primary Disk from the pool so it is not captured twice - #173

Merged
mastacontrola merged 1 commit into
masterfrom
fix/fogproject-743-primary-disk-dedup
Sep 2, 2026
Merged

Drop a matched Host Primary Disk from the pool so it is not captured twice#173
mastacontrola merged 1 commit into
masterfrom
fix/fogproject-743-primary-disk-dedup

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Fixes the last open symptom in FOGProject/fogproject#743: with a multi-disk-all image and Host Primary Disk set to /dev/sda, FOS captured /dev/sda twice and on deploy wrote it back twice.

getHardDisk() lists the device pool one device per line, then tried to remove a matched device with a sed that only matched it with a space on each side. That never matched, the device stayed in the pool, and the "add unmatched devices" step appended it again.

  • One-line fix: match whole lines with grep -vx.
  • tests/checks/primary-disk-dedup.sh drives the function over a stubbed three-disk machine. Against the old code it reports /dev/sda /dev/sda /dev/sdb /dev/nvme0n1; against the fix, each disk once with the named one first. Full suite: 20 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby

…twice

getHardDisk() lists the device pool one device per line, then tried to
remove a matched device with a sed that only matched it with a space on
each side. The pattern never matched, the device stayed in the pool, and
the "add unmatched devices" step appended it again. With a multi-disk
image and Host Primary Disk set, that disk was captured twice and on
deploy written back twice (fogproject #743).

Match whole lines instead. tests/checks/primary-disk-dedup.sh drives the
function over a stubbed three-disk machine and fails on the old code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0131h4axUaE3VJZphvKRdDby
@mastacontrola
mastacontrola merged commit 386f14f into master Sep 2, 2026
1 check passed
@mastacontrola
mastacontrola deleted the fix/fogproject-743-primary-disk-dedup branch September 2, 2026 19:38
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