Import and Export
conceptThe fear is an old and reasonable one: with traditional storage setups, the description of how disks fit together often lives in the machine—in a special controller card or a settings file—and when the machine dies, the disks become a jigsaw puzzle with no picture on the box. Actually, a ZFS pool writes its entire self-description onto the disks themselves: how they're teamed, what datasets exist, every setting, every location. A dead computer is a hardware errand, not a data emergency: move the disks into any machine running ZFS, type one import command, and everything arrives—including where it all shows up in your folders.
The verbs:
zpool export tank—the polite handoff: unmount, flush, mark released. Do this before planned moves.zpool import—with no arguments, it scans attached disks and reports every importable pool it finds; thenzpool import tanktakes one. After an unplanned death there's no export on record, so the new machine asks for-f(force)—that's the expected flow after a hardware failure, not a danger sign by itself.- The disks don't even need the same names, ports, or order—ZFS
identifies members by label, not location. (This is also why building
pools against
/dev/disk/by-idis kindness to future-you: the display stays legible.)
⚠ The one sharp edge: importing a pool on two machines at once (shared
disk shelves, iSCSI, VM passthrough mistakes) corrupts it—the -f flag
can override the "looks active elsewhere" warning, so make sure "elsewhere"
is actually dead before forcing.
What this dissolves, and what it doesn't:
- vs mdadm.conf / hardware RAID controllers—the horror story this
node exists to retire: proprietary metadata married to a controller
model. ZFS's on-disk labels make pools portable by construction, across
machines and even across OSes (a FreeBSD pool imports on Linux, feature
flags permitting—check
zpool upgrade -vcompatibility when hopping). - vs send/recv—import/export moves the pool itself (no copying, no second storage); send/recv copies datasets between pools. Migration vs replication.
- What still lives on the host—almost nothing: which pools to import
at boot (the cachefile machinery), and any keys for encrypted datasets.
The honest disaster checklist for a homelab is therefore short: the
disks, the keys, and the offsite replica. Everything else is
reconstructable by
zpool importon fresh metal.