Cannot create a dataset with previous name. Dataset already exists

alveolina

Dabbler
Joined
Jan 8, 2023
Messages
11
Hi, some weird problem here. I tried to search through the forums and on google for similar problems but couldn't find any.

Running TrueNAS-SCALE-22.12.4.2.

Hi deleted a dataset "backup" and in fact "zfs list" says its not there and its not showing in the gui. However, if i go to the /mnt/zeus2p1 and do a "ls -l" the folder is there.

The create command is failing probably because the folder/dataset is still there.

admin@zeus2[~]# sudo zfs create backup cannot create 'backup': missing dataset name

Clearly for the operating system, the folder is there:

admin@zeus2[/mnt/zeus2p1]# ls -al total 100 drwxr-xr-x 10 root root 10 Nov 25 18:55 . drwxr-xr-x 3 root root 3 Nov 25 09:15 .. [COLOR=rgb(184, 49, 47)]drwxr-xr-x 2 root root 2 Nov 25 18:10 backup[/COLOR] drwxr-xr-x 2 root root 2 Jan 27 2023 gis drwxr-xr-x 4 root root 6 Nov 26 00:51 ix-applications

Why can't I simply rm the folder like I would on a normal Debian system?

admin@zeus2[/mnt/zeus2p1]# sudo rm -Rf backup rm: cannot remove 'backup': Operation not permitted

Any thoughts? Of course I could call the folder another name but its annoying to not understand why there is a problem. BTW, i got rid of all share, replications, snapshot jobs, everything related to this dataset. Its not showing in /etc/mtab.

Thanks
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
First off, in general, you want to use the GUI or CLI, (TrueNAS' command line interface to the middleware), for all creates and removals. Many things can be done safely in the Linux SHELL, but this is one that can be problematic.

Next, the error is clear. Any ZFS dataset creation requires both pool name AND dataset name, (or path to name). For example;
sudo zfs create zeus2p1/backup

Last, a mount point in use can not be removed. It is possible that you have a SMB, NFS or iSCSI share still using that dataset name or path.

Please supply the output of the following command in code tags to confirm that the dataset is gone;
zfs list -t all -r zeus2p1
 

alveolina

Dabbler
Joined
Jan 8, 2023
Messages
11
Wow, that is annoying! I'm sure I tried the full pool name + dataset and it didn't work but it did work just now. Still doesn't explain why I could still

As you asked the output of the above command, its below. I see it lists all snapshots too so I cut off all the bits after the backup dataset. Unfortunately, this is after I ran sudo zfs create zeus2p1/backup. Thanks for your help.

admin@zeus2[~]# sudo zfs list -t all -r zeus2p1 [sudo] password for admin: NAME USED AVAIL REFER MOUNTPOINT zeus2p1 828G 2.70T 304M /mnt/zeus2p1 zeus2p1@auto-2023-02-04_15-32 0B - 426K - zeus2p1@auto-2023-02-04_15-33 0B - 426K - zeus2p1/.system 1.48G 2.70T 1.35G legacy zeus2p1/.system@auto-2023-02-04_15-32 0B - 373K - zeus2p1/.system@auto-2023-02-04_15-33 0B - 373K - zeus2p1/.system/configs-5a0a2a47cd884dbcbe527966286bfc29 4.31M 2.70T 4.07M legacy zeus2p1/.system/configs-5a0a2a47cd884dbcbe527966286bfc29@auto-2023-02-04_15-32 0B - 2.84M - zeus2p1/.system/configs-5a0a2a47cd884dbcbe527966286bfc29@auto-2023-02-04_15-33 0B - 2.84M - zeus2p1/.system/cores 330K 1024M 234K legacy zeus2p1/.system/cores@auto-2023-02-04_15-32 0B - 234K - zeus2p1/.system/cores@auto-2023-02-04_15-33 0B - 234K - zeus2p1/.system/ctdb_shared_vol 234K 2.70T 234K legacy zeus2p1/.system/ctdb_shared_vol@auto-2023-02-04_15-32 0B - 234K - zeus2p1/.system/ctdb_shared_vol@auto-2023-02-04_15-33 0B - 234K - zeus2p1/.system/glusterd 378K 2.70T 282K legacy zeus2p1/.system/glusterd@auto-2023-02-04_15-32 0B - 282K - zeus2p1/.system/glusterd@auto-2023-02-04_15-33 0B - 282K - zeus2p1/.system/rrd-5a0a2a47cd884dbcbe527966286bfc29 59.7M 2.70T 21.3M legacy zeus2p1/.system/rrd-5a0a2a47cd884dbcbe527966286bfc29@auto-2023-02-04_15-32 3.92M - 34.4M - zeus2p1/.system/rrd-5a0a2a47cd884dbcbe527966286bfc29@auto-2023-02-04_15-33 3.98M - 34.5M - zeus2p1/.system/samba4 1.30M 2.70T 629K legacy zeus2p1/.system/samba4@auto-2023-02-04_15-32 0B - 533K - zeus2p1/.system/samba4@auto-2023-02-04_15-33 0B - 533K - zeus2p1/.system/samba4@update--2023-11-25-08-12--SCALE-22.12.0 325K - 565K - zeus2p1/.system/services 234K 2.70T 234K legacy zeus2p1/.system/services@auto-2023-02-04_15-32 0B - 234K - zeus2p1/.system/services@auto-2023-02-04_15-33 0B - 234K - zeus2p1/.system/syslog-5a0a2a47cd884dbcbe527966286bfc29 63.9M 2.70T 51.6M legacy zeus2p1/.system/syslog-5a0a2a47cd884dbcbe527966286bfc29@auto-2023-02-04_15-32 405K - 15.4M - zeus2p1/.system/syslog-5a0a2a47cd884dbcbe527966286bfc29@auto-2023-02-04_15-33 416K - 15.4M - zeus2p1/.system/webui 234K 2.70T 234K legacy zeus2p1/.system/webui@auto-2023-02-04_15-32 0B - 234K - zeus2p1/.system/webui@auto-2023-02-04_15-33 0B - 234K - zeus2p1/backup 234K 2.70T 234K /mnt/zeus2p1/backup zeus2p1/gis 228G 2.70T 228G /mnt/zeus2p1/gis
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
As long as your GUI now shows the "backup" dataset, you should be good to make any SMB or NFS shares.
 
Top