Back to Engineering Blog
Infrastructure & Reliability 3 min read

Rebuilding a Corrupted USB ZFS Mirror as Plain ext4

After weeks of silent corruption, checksum errors on both drives and I/O hangs, we destroyed the USB ZFS mirror and rebuilt the datastores as plain ext4 on by-id paths, with fstab options that make a missing drive visible instead of silent.

Jason NevillBy , Houston, TX
#Backups#ZFS#ext4#USB#Storage

Key Architectural Takeaways

  • Mirroring two flaky USB drives does not make them reliable; ZFS made the corruption visible but could not fix the transport.
  • Use /dev/disk/by-id or UUID paths so drive letters cannot shift under you.
  • Mount external drives with nofail and a device timeout so a missing drive is loud and the host still boots.

The background

The primary backup store ran on a Mac mini: a mirror of two 4 TB external USB drives under ZFS, mounted at /backup-mirror. Over several weeks it showed chronic silent corruption, recurring checksum errors on both drives and I/O hangs that stalled nightly snapshots. We had already written up the transport corruption that started this. The decision here was what to do about it.

The decision

With the owner's explicit authorisation we:

  1. Destroyed the corrupted ZFS pool.
  2. Formatted the attached 1 TB external drive as an ext4 datastore for low-frequency, lightweight retention, keeping the datastore name backup-mirror.
  3. Re-onboarded one 4 TB drive as a standalone ext4 datastore, with a benchmark to follow.

Note what the name now means: the datastore is called "mirror" but is no longer a mirror. We recorded that rather than let the name mislead.

The execution

We stopped the PBS proxy and API services, ran zpool destroy -f backup and confirmed zpool status said "no pools available". Then, for each drive:

  • mkfs.ext4 with a label, on the drive's /dev/disk/by-id/usb-... path. Drive letters on this lab have shifted more than once after reboots or reconnects, so by-id paths and filesystem UUIDs are the rule.
  • A persistent /etc/fstab entry by UUID with nofail,x-systemd.device-timeout=30. A silent, un-remounted drive once caused a two-month backup gap. With nofail the host still boots, and the timeout makes the missing drive show up as a failed mount, not a hang.
  • Ownership set to the backup user, and the datastore registered in the PBS datastore configuration.

Why not just fix ZFS

ZFS did its job: it detected the corruption through checksums. It could not repair a transport that corrupts data in flight, and a mirror of two such transports gives two chances to be wrong. Plain ext4 on a single drive loses ZFS's checksumming, which we accepted for this tier. The other copies, on separate hardware, stay the source of truth.

Verification

The datastores mounted from fstab by UUID and were registered in PBS, and the drives identified by stable by-id paths.

Takeaway

Fix the layer that is failing. Redundancy over an unreliable bus adds complexity without adding safety, and external drives need mount options that make failure loud.

Follow the build on LinkedIn or by RSS.

All Articles

Follow the build

Questions about the build, or spotted something we got wrong? Find us on LinkedIn and GitHub.