Monday to Saturday 8:00–19:00, Sunday closedFree courier pickup all over Austria · drop-off point in Vienna by appointment

NAS and RAID

ZFS pool will not import: from read-only import to recovery

ZFS is designed so that a pool is either consistent or not imported at all. That protects the data, but it also means a single message such as "The pool metadata is corrupted" stands between you and everything on it. The tools to go further exist, and some of them discard data on purpose. Here is the order in which to use them.

Published 3 min readBy Mirush Murataj

Cover of the RecData guide: ZFS pool will not import: from read-only import to recovery
Start with zpool import (list only) and zdb -l on each disk: they write nothing.

In short

  • Start with zpool import (list only) and zdb -l on each disk: they write nothing.
  • Import read-only first; -F rewinds and discards the last transactions, -X goes much further.
  • Never labelclear, create or replace disks in a pool that will not import.

First look, without writing

  • zpool import with no pool name only lists what it finds: pool name, ID, state and each vdev with its status (ONLINE, DEGRADED, UNAVAIL, FAULTED). Save the output.
  • zdb -l /dev/sdX2 (or the partition that holds ZFS) shows the labels of one disk: pool name, GUID, txg and the vdev tree it belongs to. Compare across disks; a disk with a much older txg has been out of the pool for a while.
  • On TrueNAS, the disks usually carry a small swap partition and the ZFS partition; check lsblk to pick the right one.

Messages and their meaning

MessageWhat it usually means
one or more devices is currently unavailableToo many disks of one vdev missing; find them before anything else
The pool metadata is corruptedThe newest uberblocks point to damaged metadata
I/O errorRead errors on a disk, or a controller or cable problem
pool was previously in use from another systemThe pool was not exported; importing with -f is normal after moving disks
missing log deviceA separate SLOG device is gone; -m imports without it

The import ladder

  1. Read-only, no mounts: zpool import -o readonly=on -N -d /dev/disk/by-id tank. Nothing is written. If it works, mount the datasets read-only and copy the data off.
  2. Recovery dry run: zpool import -F -n tank reports whether discarding the last few transaction groups would make the pool importable, and how much time of writes would be lost. Nothing is written.
  3. Recovery import: zpool import -o readonly=on -F tank. ZFS goes back to an earlier consistent state and discards the newest transactions. Typically a few seconds of writes before the failure.
  4. Extreme rewind (-X with -F) searches much further back and can take hours; in read-write mode it can make things worse. It belongs on copies of the disks.

Before step 3, image the disks if any of them shows read errors. Every import attempt reads the whole metadata tree; a weak disk does not improve with repetition.

What not to do

  • zpool labelclear, zpool create or a TrueNAS "wipe" on any member.
  • zpool replace or resilvering while the pool is not importable or a second disk of the same vdev is weak.
  • Importing read-write on the original disks after an -F that failed.
  • Changing the order or controller of the disks without noting serial numbers. ZFS finds disks by label, but the notes help the diagnosis.

How we recover a pool that will not import

The disks are imaged, damaged ones after repair. On the images, the labels and uberblocks of every disk are read, the newest consistent transaction group is located, and the pool is imported read-only at that point, or the datasets are reconstructed directly from the object sets when the higher-level metadata is damaged. RAIDZ parity covers gaps on single disks. Encrypted datasets need the passphrase or key file.

Example: RAIDZ2 after an HBA failure

A video production company in Wien runs TrueNAS with eight disks in RAIDZ2. The HBA fails; after the replacement, the pool reports "The pool metadata is corrupted". zdb -l shows identical txg values on six disks and older values on two, which had been dropping out intermittently for days. zpool import -F -n would discard about thirty seconds of writes. On images of all eight disks, the read-only rewind import works, and the 60 TB of project data are copied off intact.

See NAS data recovery, RAID data recovery and NAS failure: what breaks, what to do first, how to protect the next one.

Frequently asked questions

Does zpool import -F lose data?

Yes, deliberately: it discards the most recent transaction groups, usually seconds of writes. Run it with -n first to see the result, and read-only if possible.

Can a pool with a missing SLOG be imported?

Yes, with -m. Only the last synchronous writes not yet written to the pool can be lost.

Is ZFS recovery possible without the original server?

Yes. We need the disks; the server is not needed. For encrypted datasets we also need the passphrase or key file.

Official sources and useful links

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 NAS data recovery

Your device has stopped responding? Switch it off and talk to us.

Calculate the cost