If the damage is in pool metadata that damage prevents the pool from being opened or imported, then the following options are available:
Attempt to recover the pool by using the zpool clear -F command or zpool import -F command. These commands attempt to roll back the last few pool transactions to an operational state. You can use the zpool status command to review a damaged pool and the recommended. recovery steps. For example:
# zpool status pool: dbpool state: FAULTED status: The pool metadata is corrupted and the pool cannot be opened. action: Recovery is possible, but will result in some data loss. Returning the pool to its state as of Sat Nov 07 09:53:20 2009 should correct the problem. Approximately 49 seconds of data must be discarded, irreversibly. Recovery can be attempted by executing 'zpool clear -F dbpool'. A scrub of the pool is strongly recommended after recovery. see: http://www.sun.com/msg/ZFS-8000-72 scrub: none requested config: NAME STATE READ WRITE CKSUM dbpool FAULTED 0 0 1 corrupted data c1t1d0 ONLINE 0 0 2 c1t3d0 ONLINE 0 0 4 |
The recovery process as described above is to use the following command:
# zpool clear -F dbpool |
If you attempt to import a damaged storage pool, you will see messages similar to the following:
# zpool import dpool cannot import 'dbpool': I/O error Recovery is possible, but will result in some data loss. Returning the pool to its state as of Sat Nov 07 09:53:20 2009 should correct the problem. Approximately 49 seconds of data must be discarded, irreversibly. Recovery can be attempted by executing 'zpool import -F dbpool'. A scrub of the pool is strongly recommended after recovery. |
The recovery process as described above is to use the following command:
# zpool import -F dbpool Pool dbpool returned to its state as of Sat Nov 07 09:53:20 2009. Discarded approximately 49 seconds of transactions |
If the damaged pool is in the zpool.cache file, the problem is discovered when the system is booted, and the damaged pool is reported in the zpool status command. If the pool isn't in the zpool.cache file, it won't successfully import or open and you'll see the damaged pool messages when you attempt to import the pool.
If the pool cannot be recovered by the pool recovery method described above, you must restore the pool and all its data from backup. The mechanism you use varies widely by the pool configuration and backup strategy. First, save the configuration as displayed by zpool status so that you can recreate it once the pool is destroyed. Then, use zpool destroy -f to destroy the pool. Also, keep a file describing the layout of the datasets and the various locally set properties somewhere safe, as this information will become inaccessible if the pool is ever rendered inaccessible. With the pool configuration and dataset layout, you can reconstruct your complete configuration after destroying the pool. The data can then be populated by using whatever backup or restoration strategy you use.