How can I recover data from a faulted pool?

Volodymyr Kostyrko arcade at
Sat Jul 15 13:53:15 UTC 2017

Александр Поволоцкий wrote:
> Hello
> FreeBSD 10.3. ZFS.
>  # zpool status
>   pool: database
>  state: UNAVAIL
> status: One or more devices are faulted in response to persistent
> errors.  There are insufficient replicas for the pool to
>         continue functioning.
> action: Destroy and re-create the pool from a backup source. Manually
> marking the device
>         repaired using 'zpool clear' may allow some data to be recovered.
>   scan: none requested
> config:
>         NAME               STATE     READ WRITE CKSUM
>         database           UNAVAIL      0     0     0
>           mirror-0         UNAVAIL      0     0     0
>             gpt/database0  FAULTED      0     0     0  too many errors
>             gpt/database1  FAULTED      0     0     0  too many errors
> disks can be read, can I somehow recover data from the pool?

For sure... First please describe what happened to both disks and what 
hardware you were using (chipset/controller). Please don't try to `zpool 
clear` yet.

1. ZFS *HEAVILY* relies on hardware to be stable, any hardware glitches 
may result in severe pool corruption. If you have any doubts in hardware 
first move the disks to the trusted box.

2. I assume both mirror parts were on different disks? ZFS doesn't like 
pools that have more then one chunk on any drive.

3. Try mounting pool R/O with transaction recovery. While this is mirror 
please do this for both disks and give it another try for single disks 
as results may differ:

`zpool import -N -O readonly=on -f -R /mnt/somezpoool …`

You can use mfsBSD for that.

If that doesn't help try:

`zpool import -N -O readonly=on -f -R /mnt/somezpoool -Fn …`

Both commands will try to import the pool without mounting file systems 
in r/o mode. If that would work, try mounting only required filesystem 
and copy some data from it.

Please post your results.

Sphinx of black quartz judge my vow.

More information about the freebsd-fs mailing list