zpool import –D 명령을 사용하여 삭제된 저장소 풀을 복구할 수 있습니다. 예를 들면 다음과 같습니다.
# 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
이 zpool import 출력에서는 다음 상태 정보 덕분에 tank 풀을 삭제된 풀로 식별할 수 있습니다.
state: ONLINE (DESTROYED)
삭제된 풀을 복구하려면 복구할 풀과 함께 zpool import –D 명령을 다시 실행합니다. 예를 들면 다음과 같습니다.
# 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
삭제된 풀에서 장치 중 하나를 사용할 수 없는 경우 –f 옵션을 포함하면 삭제된 풀을 강제로 복구할 수 있습니다. 이 시나리오에서는 결함이 있는 풀을 가져온 다음 장치 실패 수정을 시도합니다. 예를 들면 다음과 같습니다.
# 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