What happens when you temporarily disconnect a disk from a ZFS pool?
ZFS provides RAID-Z to prevent data loss in the event of a disk failure. I was recently surprised to learn that
I wonder what would happen under the following scenario:
Can you recover? Obviously the last write is toast. But can ZFS recover everything before that point? I'm not sure, but I found two easy (but incomplete) mitigations:
% sudo EDITOR=vim systemctl edit zfs-import-cache.service
[Service]
# Clear the original ExecStart
ExecStart=
# Replace it with an ExecStart that sets readonly=on
ExecStart=/sbin/zpool import -c /etc/zfs/zpool.cache -aN -o readonly=on
Another mitigation that's not always practical: mirror. If you have 2 disks, use RAID-Z1. If you have 3, RAID-Z2. If you have 4, RAID-Z3. That way any disk will work on its own.
If you enjoyed this post, please let me know on Twitter or Bluesky.
Posted September 24, 2025.