• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

UnixArena

  • Home
  • kubernetes
  • DevOps
    • Terraform
    • Jenkins
    • Docker
    • Openshift
      • OKD
    • Ansible engine
    • Ansible Tower
      • AWX
    • Puppet
  • Cloud
    • Azure
    • AWS
    • Openstack
    • Docker
  • VMware
    • vCloud Director
    • VMware-Guests
    • Vcenter Appliance 5.5
    • vC OPS
    • VMware SDDC
    • VMware vSphere 5.x
      • vSphere Network
      • vSphere DS
      • vShield Suite
    • VMware vSphere 6.0
    • VSAN
    • VMware Free Tools
  • Backup
    • Vembu BDR
    • Veeam
    • Nakivo
    • Azure Backup
    • Altaro VMBackup
    • Spinbackup
  • Tutorials
    • Openstack Tutorial
    • Openstack Beginner’s Guide
    • VXVM-Training
    • ZFS-Tutorials
    • NetApp cDot
    • LVM
    • Cisco UCS
    • LDOM
    • Oracle VM for x86
  • Linux
    • How to Articles
    • Q&A
    • Networking
    • RHEL7
  • DevOps Instructor-led Training
  • Contact

How to recover a destroyed zfs storage pool

July 10, 2012 By Cloud_Devops Leave a Comment

ZFS has one of the cool features that we can recover the destroyed pool if the zpool disk is not used or removed from the system for other purpose. Once we issue the command to destroy the particular pool, Solaris will put the zpool in destroyed mode and it won’t remove any data from those zpool disks.

Note:Zpool destroy is very dangerous command since it destroys the zpool even if it contains mounted datasets.

So the bottom line is accidentally deleted zpool can be re-imported using the below method.
I am destroying the zpool using destroy command. 

# zpool destroy data_pool

Verifying that pool has been removed from system or not.

# zpool list |grep –i data_pool

Checking the destroyed pools on this system

# zpool import -D
pool: data_pool
id: 9205677892434161971
state: ONLINE (DESTROYED)
action: The pool can be imported using its name or numeric identifier.
config:
data_pool ONLINE
mirror-0 ONLINE
c1t9d0 ONLINE
c2t11d0 ONLINE

Here we are trying to import the destroyed zpool.

# zpool import -D data_pool
# zpool status -x
all pools are healthy

If the above command, may fail, import the zpool forcefully and bring the missing devices online. Go ahead with this, if you have valid replicas in the zpool.

# zpool import -D
pool: data_pool
id: 9205677892434161971
state: ONLINE (DESTROYED)
action: The pool can be imported using its name or numeric identifier.
config:
data_pool ONLINE
c1t9d0 ONLINE
c2t11d0 UNAVAIL

Importing forcefully

# zpool import -Df data_pool
# zpool status -x
pool: data_pool
state: DEGRADED
status: One or more devices could not be opened. Sufficient replicas exist for the pool to continue functioning in a degraded state.
action: Attach the missing device and online it using 'zpool online'.
see: http://www.sun.com/msg/ZFS-8000-2Q
scrub: scrub completed after 0h0m with 0 errors on Thu July 10 15:38:48 2012
config:

NAME STATE READ WRITE CKSUM
data_pool DEGRADED 0 0 0
mirror
c1t9d0 ONLINE 0 0 0
c2t11d0 UNAVAIL 0 37 0 cannot open
errors: No known data errors
# zpool online data_pool c2t11d0
Bringing device c2t11d0 online
# zpool status -x
all pools are healthy
So before importing the zpool ,just make sure that disks/luns are visible from OS side. By doing that you no need to import the zpool forcefully.

Thank for reading this article. please leave a comment if you have any doubt.I will get back you .

Filed Under: Solaris 10, ZFS

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow UnixArena

  • Facebook
  • LinkedIn
  • Twitter

Copyright © 2025 · UnixArena ·

Go to mobile version