Unable to delete dataset

hysel

Explorer
Joined
Apr 11, 2020
Messages
69
Hi

I am trying to delete a dataset and I can't make it to work.

I am running the latest version (12.0-U4.1).

I have tried the following without success:

  1. GUI - Delete data set:
    Code:
    [EFAULT] Failed to delete dataset: cannot unmount '/mnt/FR4G/Media': unmount failed
  2. CLI:
    Code:
    root@truenas[~]# root@truenas[~]# zfs list | grep MediaFR4G/Media 205K 16.7T 205K /mnt/FR4G/Media
    root@truenas[~]# zfs destroy -f FR4G/Media
    cannot unmount '/mnt/FR4G/Media': unmount failed
    root@truenas[~]# zfs destroy -f mnt/FR4G/Media
    cannot open 'mnt/FR4G/Media': dataset does not exist
    root@truenas[~]# rm -rf /mnt/FR4G/Media
    rm: /mnt/FR4G/Media: Device busy
    
I checked and there is no active share for this device (SMB/nfs)

Any ideas?

Thanks in advance

Itamar
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
lsof might help. Other than that, reboot, then try again.
 

hysel

Explorer
Joined
Apr 11, 2020
Messages
69
lsof might help. Other than that, reboot, then try again.

Thanks, I tried that and it didn't work

Code:
root@truenas[~]# lsof | egrep '^COMMAND|/mnt' | grep Media
lsof: WARNING: compiled for FreeBSD release 12.0-RELEASE; this is 12.2-RELEASE-p6.
root@truenas[~]# lsof | grep Media
lsof: WARNING: compiled for FreeBSD release 12.0-RELEASE; this is 12.2-RELEASE-p6.
root@truenas[~]# lsof | grep /mnt/FR4G/Media
lsof: WARNING: compiled for FreeBSD release 12.0-RELEASE; this is 12.2-RELEASE-p6.


Reboot didn't work as well :(
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
lsof +D /mnt/FR4G/Media?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
zfs list -t all -r FR4G/Media?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Strange ... sorry, out of ideas.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
rm -rf /mnt/FR4G/Media
You can't rm a dataset.

zfs destroy FR4G/Media should do it, but the unmount seems not to work, so maybe a reboot first?

How about zfs unmount FR4G/Media ?
 

hysel

Explorer
Joined
Apr 11, 2020
Messages
69
You can't rm a dataset.

zfs destroy FR4G/Media should do it, but the unmount seems not to work, so maybe a reboot first?

How about zfs unmount FR4G/Media ?

Ye I was being silly :cool:

doesn't work

Code:
root@truenas[~]# zfs destroy FR4G/Media
cannot unmount '/mnt/FR4G/Media': unmount failed
root@truenas[~]# zfs unmount FR4G/Media
cannot unmount '/mnt/FR4G/Media': unmount failed
root@truenas[~]# zfs destroy -f FR4G/Media
cannot unmount '/mnt/FR4G/Media': unmount failed
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
zfs unmount -f FR4G/Media ?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Did you try the reboot?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
zfs unshare FR4G/Media ?
 

hysel

Explorer
Joined
Apr 11, 2020
Messages
69
zfs unshare FR4G/Media ?

root@truenas[~]# zfs unshare FR4G/Media
cannot unshare 'FR4G/Media': legacy share
use exports(5) or smb.conf(5) to unshare this filesystem

But I don't have an SMB share on this folder:

1627994344738.png


Code:
root@truenas[~]# smbstatus

Samba version 4.12.15
PID     Username     Group        Machine                                   Protocol Version  Encryption           Signing
----------------------------------------------------------------------------------------------------------------------------------------

Service      pid     Machine       Connected at                     Encryption   Signing
---------------------------------------------------------------------------------------------
No locked files
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Can you stop all sharing services, then try again? Just to make sure?

You don't have a shell open with that dataset as your current working directory, do you?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Top