You can use the zpool import –D command to recover a storage pool that has been destroyed. For example:
# zpool destroy tank # zpool import -D pool: tank id: 5154272182900538157 state: ONLINE (DESTROYED) action: The pool can be imported using its name or numeric identifier. config: tank ONLINE mirror-0 ONLINE c1t0d0 ONLINE c1t1d0 ONLINE
In this zpool import output, you can identify the tank pool as the destroyed pool because of the following state information:
state: ONLINE (DESTROYED)
To recover the destroyed pool, run the zpool import –D command again with the pool to be recovered. For example:
# zpool import -D tank # zpool status tank pool: tank state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM tank ONLINE mirror-0 ONLINE c1t0d0 ONLINE c1t1d0 ONLINE errors: No known data errors
If one of the devices in the destroyed pool is unavailable, you might be able to recover the destroyed pool anyway 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 destroy dozer # 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 c8t4d0 # zpool status -x all pools are healthy