Monday to Saturday 8:00–19:00, Sunday closedFree courier collection throughout Switzerland · drop-off in Lugano, Zurich and Sant'Antonino

Business

ZFS pool will not import: reading the messages and rewinding safely

ZFS is built never to overwrite live data, so a pool that will not import has almost always kept an older, consistent state on the disks. The question is how far back that state is, and whether the steps taken to reach it destroy the newer one. The import options that promise to fix the pool are exactly the ones that discard data.

Published 3 min readBy Mirush Murataj

Cover of the RecDati guide: ZFS pool will not import: reading the messages and rewinding safely
Import read-only first: zpool import -o readonly=on.

In short

  • Import read-only first: zpool import -o readonly=on.
  • -F and -X rewind the pool to an older transaction group and throw away everything written after it.
  • Most failed imports come from missing devices or the controller, not from damaged data.

Reading what zpool import says

Run zpool import without arguments: it scans the disks and lists the pools it finds, without importing them.

MessageUsual meaning
one or more devices is missing / UNAVAILA disk, a partition or a whole vdev is not visible: cable, HBA, device names
pool was last accessed by another systemThe host ID differs, typically after a reinstall or on new hardware
The pool metadata is corruptedThe newest metadata is damaged; an older state may still be usable
I/O error during importA disk returns read errors, or the controller hides part of the disk

Use zpool import -d /dev/disk/by-id so the disks are found by serial number rather than by sdX names that may have changed.

Uberblocks and transaction groups

ZFS writes in transaction groups (TXGs), every few seconds. At the end of each one it writes a new uberblock, the root pointer to the whole pool, into a ring of slots in the four labels of every disk. On import, ZFS takes the newest valid uberblock. If the data it points to is damaged, older uberblocks still point to complete, older versions of the pool.

zdb -lu /dev/disk/by-id/... lists the labels of a disk and the uberblocks they contain, with their TXG numbers and timestamps. It reads only.

The order to follow

  1. Check the hardware. Every disk visible, the HBA in IT (pass-through) mode, no RAID controller presenting virtual disks.
  2. Import read-only: zpool import -o readonly=on -d /dev/disk/by-id poolname. If it works, copy the data off before anything else.
  3. If the only complaint is the host ID, -f is acceptable, together with read-only.
  4. Only on clones or images of the disks, consider rewinding.

What -F, -X and -T really do

  • -F (recovery mode) tries the last few TXGs and imports the pool at the newest one that works. What was written in the discarded TXGs is lost. -n together with -F shows what would happen without doing it.
  • -X (extreme rewind, with -F) goes much further back and can take hours. It may import a pool in a state from minutes or hours earlier.
  • -T txg imports at a chosen transaction group. It is not documented for everyday use and is used in recovery on images.

Once a rewound pool is imported read-write, new TXGs overwrite the slots and blocks that held the newer state. That is why rewinding belongs on copies.

Cases that need a lab

  • A vdev missing completely (a mirror or RAIDZ group where too many disks failed).
  • Labels damaged on several disks, for example after the disks were "initialised" by another system.
  • A pool built on a hardware RAID controller, where ZFS never saw the real disks.
  • Repeated I/O errors during import: the disks need imaging first.

We image the disks, read the labels and uberblocks offline and choose the newest consistent state, often newer than what -F would reach on its own.

Preventing it

  • HBAs in IT mode, never a RAID controller under ZFS.
  • ECC memory on systems that hold important pools.
  • Regular scrubs, and alerts when one reports errors.
  • Snapshots replicated to another system: they are your backup, not a substitute for one.

See server data recovery, NAS data recovery and virtual machines data recovery.

Frequently asked questions

Is zpool import -F safe?

It is safe in the sense that it does not damage the older state it imports. It does discard every change made after that state, permanently once the pool is used read-write.

TrueNAS shows the pool as offline after a reboot. Is it lost?

Rarely. Check first that every disk is visible and that the controller was not reconfigured.

Can a ZFS pool be read on another computer?

Yes, on any system with a recent OpenZFS, as long as it supports the pool's feature flags. Import it read-only.

Official sources and useful links

  • OpenZFS documentation: Official documentation of OpenZFS: zpool and zfs commands, vdev types, pool features and troubleshooting.

Is your data important?

Do not try anything that could make the fault worse. The diagnosis is free and you get a fixed quote before any work starts.

Request a free diagnosis Server data recovery

Device not responding any more? Unplug it and let us take a look.

Get a price