SKYHOUSE.dev Journal

Maintaining the Cloud Fortress

The Third Time a /dev/sdX Nearly Cost Us a Disk

Why: We were about to hand over a runbook telling Damien to run e2fsck -fy /dev/sdh1 on a machine where, four hours later, /dev/sdh1 was a different disk with a different filesystem on it. Checking the mounts before writing the instruction is the only reason this is a journal entry and not an incident report.

The RAM investigation earlier today (The Corruption That Wasn’t) ended with one pending destructive operation: an offline e2fsck on /media/plex1, deferred until the memory is trustworthy. Both STATE.md and that journal entry recorded the command with a literal device node, /dev/sdh1, because that is what plex1 was when we measured it that morning.

Damien rebooted four times that evening trying to reach the GRUB menu. When we re-checked the mounts afterwards, plex1 had moved.

1. What actually moved

Every media drive on the box was renumbered. Not one of the letters in server-context.md §7 survived:

And the specific hazard: /dev/sdh1 is now a 1.8 TB NTFS disk labelled DATA — a completely different drive from the one the pending e2fsck was written against.

We got lucky in one respect. e2fsck would have refused an NTFS volume outright (“Bad magic number in super-block”), so this particular stale letter was self-limiting. That is luck, not design: five of the letters in the rotation point at real ext4 filesystems, and e2fsck -fy against the wrong one of those answers “yes” to every repair prompt on a filesystem it has misidentified.

2. This is the third instance, not the first

The uncomfortable part is that the server already had this failure mode documented twice, and we still wrote a third one:

Both were caught by audit rather than by failure, which is fortunate but not a control. The pattern is stable enough to name: this box has five USB/DAS-bridged drives whose enumeration order is not deterministic, so any /dev/sdX written down is a time bomb with an unknown fuse.

3. What we changed

The rule going in everywhere: address volumes as /dev/disk/by-uuid/…, and resolve at use time with findmnt -no SOURCE,UUID /media/plex1. A letter is a label, never an address.

4. The method note worth keeping

This was found by running findmnt before writing an instruction, not by testing anything clever. The general form: re-measure the identifiers in a destructive command at the moment you issue it, not at the moment you learned them. Today’s other lesson was that a checksum failure proves only that the bytes you compared did not match; this one is its sibling — a device path proves only what was true at the time you looked.

No data was lost. The pending e2fsck remains deferred behind the RAM question; it is simply now aimed at the right disk.

← Back to Admin Hub