Recovering Destroyed ZFS Storage Pools
You can use the zpool import -D
command to recover a storage pool that has been destroyed.
In the following example, the pool system1
is indicated as destroyed.
$ zpool import -D
pool: system1
id: 5154272182900538157
state: ONLINE (DESTROYED)
action: The pool can be imported using its name or numeric identifier.
config:
system1 ONLINE
mirror-0 ONLINE
c1t0d0 ONLINE
c1t1d0 ONLINE
To recover the destroyed pool, import it with the -D
option.
$ zpool import -D system1 $ zpool status system1 pool: system1 state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM system1 ONLINE 0 0 0 mirror-0 ONLINE 0 0 0 c1t0d0 ONLINE 0 0 0 c1t1d0 ONLINE 0 0 0 errors: No known data errors
If one of the devices in the destroyed pool is unavailable, you might still recover the destroyed pool by including the -f
option. In this scenario, you would import the degraded pool and then attempt to fix the device failure. For example:
$ zpool import -D pool: dozer id: 4107023015970708695 state: DEGRADED (DESTROYED) status: One or more devices are unavailable. action: The pool can be imported despite missing or damaged devices. The fault tolerance of the pool may be compromised if imported. config: dozer DEGRADED raidz2-0 DEGRADED c8t0d0 ONLINE c8t1d0 ONLINE c8t2d0 ONLINE c8t3d0 UNAVAIL cannot open c8t4d0 ONLINE device details: c8t3d0 UNAVAIL cannot open status: ZFS detected errors on this device. The device was missing. $ zpool import -Df dozer $ zpool status -x pool: dozer state: DEGRADED status: One or more devices are unavailable in response to persistent errors. Sufficient replicas exist for the pool to continue functioning in a degraded state. action: Determine if the device needs to be replaced, and clear the errors using 'zpool clear' or 'fmadm repaired', or replace the device with 'zpool replace'. Run 'zpool status -v' to see device specific details. scan: none requested config: NAME STATE READ WRITE CKSUM dozer DEGRADED 0 0 0 raidz2-0 DEGRADED 0 0 0 c8t0d0 ONLINE 0 0 0 c8t1d0 ONLINE 0 0 0 c8t2d0 ONLINE 0 0 0 4881130428504041127 UNAVAIL 0 0 0 c8t4d0 ONLINE 0 0 0 errors: No known data errors $ zpool online dozer c8t3d0 $ zpool status -x all pools are healthy