How to destroy a ZFS pool while the pool is busy?

zfs
Vasiliy Schitov picture Vasiliy Schitov · Nov 16, 2016 · Viewed 7.3k times · Source

I have zfs pool:

$ sudo zpool status lxd
  pool: lxd
 state: ONLINE
  scan: none requested
config:

    NAME                    STATE     READ WRITE CKSUM
    lxd                     ONLINE       0     0     0
      /var/lib/lxd/zfs.img  ONLINE       0     0     0

I've tried:

$ sudo zpool destroy -f lxd 
cannot destroy 'lxd': pool is busy

How can I unmount zpool img

Answer

user121391 picture user121391 · Nov 16, 2016

I would try these things in this order:

  • Stop all read/write IO from programs on the pool and its file systems (check with zpool iostat for current read/write)
  • Stop all sharing services (SMB, NFS, AFP, iSCSI) that use this pool or remove the sharing properties on the file systems
  • Unmount (zfs unmount) all file systems of the pool