Files
hermenix/modules
ariandClaude Sonnet 5 5ea64e88d5 Fix two disk-setup bugs: byte/gigabyte size mix-up, wrong ownership
1. truncate -s treats a bare number as bytes, not gigabytes - typing
   "50" at the size prompt (instead of "50G") silently made a 50-byte
   file, which then failed mkfs.ext4 with "Device size reported to be
   zero." Added normalize-size: a bare integer answer now gets a "G"
   suffix appended (matching what the prompts' own defaults imply),
   anything with an existing suffix passes through unchanged.

2. Every disk-creation step runs through `priv` (sudo/root), so
   subvolumes and disk images always ended up root-owned - but
   hermes-vm.service runs as the unprivileged hermes-vm account, which
   only had read access via the "other" bits. QEMU failed to open
   system.raw for read-write. Added explicit `chown hermes-vm:hermes-vm`
   after every creation point (both make-subvol branches, and after
   each truncate/mkfs) - also self-heals already-existing
   wrongly-owned disks on a re-run, not just fresh ones.

Both confirmed live on hl-fwdesk during tonight's incident. Verified
with a unit test of normalize-size and a full sandboxed interactive
dry run of `setup` (fake sudo/btrfs/truncate/chown/mkfs.ext4) showing
the correct truncate -> chown ordering for both disks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 22:33:09 -04:00
..