Cannot Destroy "name" dataset is busy

Status
Not open for further replies.

Rybena

Dabbler
Joined
Jun 25, 2017
Messages
32
Im trying to destroy a zvol dataset but i get the error message "cannot destroy 'name of dataset' dataset is busy".
I can only delete it if i reboot my server the delete it, thats not ideal and is a pain in the backside.

Anyone had this issue before?
Any suggestions?


Thanks
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I've seen this before. The most common reasons are that NFS or iSCSI is using that dataset/zvol.

With iSCSi in particular, if iSCSI was sharing the zvol, and then you decide to unmount the iscsi disk, you still cannot remove the zvol because iSCSI will still have that zvol open. You have to remove the iSCSI disk settings from the WebGUI, then restart the iscsi service to recover from this if a zvol is locked.

With NFS in particular, if the NFS share exists in the WebGUI, and anyone has accessed it before, then the NFS service is likely locking it. Removing the share and cycling the NFS service has resolved this for me in the past.

It's non-intuitive that this is the problem because if you look for locked files and such, you'll find none. But I've seen it enough to know better.

Also, if you have an ssh session somewhere (even an old screen or tmux session) in that dataset you won't be able to delete it. PITA to recognize this if you don't know what to look for. I use tmux regularly, so I just do "tmux attach" to see what sessions I have open and close them appropriately.

Hope this helps you resolve the issue!
 

Rybena

Dabbler
Joined
Jun 25, 2017
Messages
32
I've seen this before. The most common reasons are that NFS or iSCSI is using that dataset/zvol.

With iSCSi in particular, if iSCSI was sharing the zvol, and then you decide to unmount the iscsi disk, you still cannot remove the zvol because iSCSI will still have that zvol open. You have to remove the iSCSI disk settings from the WebGUI, then restart the iscsi service to recover from this if a zvol is locked.

With NFS in particular, if the NFS share exists in the WebGUI, and anyone has accessed it before, then the NFS service is likely locking it. Removing the share and cycling the NFS service has resolved this for me in the past.

It's non-intuitive that this is the problem because if you look for locked files and such, you'll find none. But I've seen it enough to know better.

Also, if you have an ssh session somewhere (even an old screen or tmux session) in that dataset you won't be able to delete it. PITA to recognize this if you don't know what to look for. I use tmux regularly, so I just do "tmux attach" to see what sessions I have open and close them appropriately.

Hope this helps you resolve the issue!


Hi Thanks for the info.

I had made the zvol for a Ubuntu VM. I deleted the VM and then trying to delete the zvol was where i was having an issue. I had logged into this VM via VNC. I think it had something to do with iSCSI you mentioned but I couldnt figure it out so I ended up rebooting the server and then I had no issue deleting the zvol. Not the ideal solution but it worked.

Thanks for your help.
 
Status
Not open for further replies.
Top