nixos/palace: Hide guest NVMe disks from LVM by every name #19

Merged
dev merged 1 commits from palace-lvm-filter into master 2026-11-28 18:14:27 +00:00

palace's devices/global_filter is [ "r|^/dev/nvme|" "a|.*|" ]. LVM accepts a device if any of its names matches an accept pattern first, and slop-cannon's disk also has /dev/disk/by-* links, so the trailing a|.*| let it through. Running doas lvs main on palace today prints:

WARNING: VG name main is used by VGs MPW6o1-… and qPBpjc-…
Multiple VGs found with the same name: skipping main

So palace reads the guest's (agent-controlled) LVM metadata, and LVM commands naming main (creating a VM disk, for example) refuse to run while the disk is connected.

  • The filter is now [ "r|^/dev/nvme|" ]; names matching no pattern don't affect the decision. I checked both versions against a loop-device PV on slop-cannon: the old one still showed the VG, the new one hides it.
  • palace.md explains why there's no accept pattern.
  • After deploying, doas lvs main on palace should print no warnings. Activation doesn't need a reboot; the next LVM command reads the new lvm.conf.

🤖 Generated with Claude Code

`palace`'s `devices/global_filter` is `[ "r|^/dev/nvme|" "a|.*|" ]`. LVM accepts a device if *any* of its names matches an accept pattern first, and `slop-cannon`'s disk also has `/dev/disk/by-*` links, so the trailing `a|.*|` let it through. Running `doas lvs main` on `palace` today prints: ``` WARNING: VG name main is used by VGs MPW6o1-… and qPBpjc-… Multiple VGs found with the same name: skipping main ``` So `palace` reads the guest's (agent-controlled) LVM metadata, and LVM commands naming `main` (creating a VM disk, for example) refuse to run while the disk is connected. - The filter is now `[ "r|^/dev/nvme|" ]`; names matching no pattern don't affect the decision. I checked both versions against a loop-device PV on `slop-cannon`: the old one still showed the VG, the new one hides it. - `palace.md` explains why there's no accept pattern. - After deploying, `doas lvs main` on `palace` should print no warnings. Activation doesn't need a reboot; the next LVM command reads the new `lvm.conf`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
slop-cannon Bot added 1 commit 2026-11-28 16:26:34 +00:00
nixos/palace: Hide guest NVMe disks from LVM by every name
Build llm-agents / build (pull_request) Skipped
CI / Check, build and cache nixfiles (push) Canceled after 0s
Update docs / update (push) Canceled after 0s
5fcd2f29be
`global_filter` rejected `/dev/nvme*` but then accepted everything
else, and LVM accepts a device if any of its names is accepted: the
disk's `/dev/disk/by-*` links were. So `palace` saw `slop-cannon`'s
volume group, also called `main`, and LVM commands naming `main`
refused to run while the disk was connected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dev merged commit 5fcd2f29be into master 2026-11-28 18:14:27 +00:00
dev deleted branch palace-lvm-filter 2026-11-28 18:14:27 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/nixfiles#19