From 5fcd2f29beea7bb81bc0392f9fc38197477d79e8 Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sat, 28 Nov 2026 16:26:07 +0000 Subject: [PATCH] nixos/palace: Hide guest NVMe disks from LVM by every name `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 --- docs/sites/home/palace.md | 4 ++++ nixos/boxes/home/palace/default.nix | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/sites/home/palace.md b/docs/sites/home/palace.md index e0fc3f2..9213250 100644 --- a/docs/sites/home/palace.md +++ b/docs/sites/home/palace.md @@ -176,6 +176,10 @@ SPDK only checks the host NQN, which root in the guest could forge. I/O errors, instead of the kernel retrying forever. - `devices/global_filter` rejects `/dev/nvme*` in `lvm.conf`, so `palace` never activates the guest's volume group (also called `main`). `palace` has no NVMe of its own. + - The filter has no accept pattern: LVM accepts a device if any of its names matches one, and + the disk's `/dev/disk/by-*` links would. + - Without it, `palace` sees two VGs called `main`, and LVM commands naming `main` refuse to + run. ## `slop-broker` diff --git a/nixos/boxes/home/palace/default.nix b/nixos/boxes/home/palace/default.nix index dde5299..c44bd5a 100644 --- a/nixos/boxes/home/palace/default.nix +++ b/nixos/boxes/home/palace/default.nix @@ -86,9 +86,10 @@ in }; # NVMe-oF disks connected here belong to guests (`palace` has no NVMe of its own; its - # drives are passed to `cellar`); never activate their volume groups + # drives are passed to `cellar`); never activate their volume groups. No accept pattern: + # LVM accepts a device if any of its other names (`/dev/disk/by-*`) is accepted. environment.etc."lvm/lvm.conf".text = '' - devices/global_filter = [ "r|^/dev/nvme|" "a|.*|" ] + devices/global_filter = [ "r|^/dev/nvme|" ] ''; services = {