How do I delete and remove sub-directories under a dataset?

user07072023

Cadet
Joined
Jul 7, 2023
Messages
3
Hello. My first post. Thank you in advance. Alternate title consideredwas "Directories return in UI after deleting them from /mnt/<system-dataset>/ via shell"

On a fresh install, with a brand new pool I shared the System dataset via NFS to my ProxMox Back-up Server (PBS) and began testing it. I now realize what I should have done was create a sub-dataset under the System Dataset named "ProxMox Back-up Server" and shared only that dataset.

By the time I realized this, PBS, it appears, had systematically created some directories under the System DataSet.

1688735171804.png


Finding no way via the UI to remove these directories ("dump", "images", et al), I opened the shell and removed them from /mnt/truenas-pool-1 via rm -rf.

I confirmed their deletion with an immediate
Code:
ls -altr
which showed only ProxMox Back-up Server as the only remaining directory (dataset) underneath the system data set.

To confrim my success and obvious mastery of command line arguments, I returned to the UI and browsed to Sharing > NFS > Add... however I still saw the sub-directories. I refreshed the page, logged back in, and then ran a Scrub (because why not?).

After some research, I decided to post and was going to paste a screener of the directory, only to find that the once-deleted directory folders reappeared!

1688735703711.png


::But, the Cat Came Back vibes::

I now hypothesize the the SCRUB restored the folders.

However, I am back at square one: How do I delete and remove sub-directories under a dataset?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You delete sub-directories just as you did.

It's baffling why you would be placing anything that you manage under the system dataset structure... that's for the system, not for you.

Stick to your lane... anywhere else on the pool.
 

user07072023

Cadet
Joined
Jul 7, 2023
Messages
3
You delete sub-directories just as you did.
Thank you for your response.

Can you please help me understand how or why the sub-directories ("private", "images" ,et al) I deleted via shell were re-created? Perhaps TrueNAS intends those directories to be there and I mistakenly thought PBS created them during my experimentation.

It's baffling why you would be placing anything that you manage under the system dataset structure... that's for the system, not for you.
I believe I initially conflated directories as synonymous with datasets AND did not, at the time, understand that there is both a pool and default dataset with the same name.

My go forward will be to have nothing living under the default dataset and have purpose-driven datasets nested underneath as shown here.

1688738087573.png
 
Joined
Oct 22, 2019
Messages
3,641
"System Dataset" is a specific term in TrueNAS, and the GUI might cause confusion.

When you refer to your "System Dataset", you are actually referring to your main pool which happens to also house the ("hidden") System Dataset (".system").

It sounds like you shared your top-level root dataset of your pool ("truenas-pool-1"), and thus subdirectories were created inside (from the other end of your NFS share, i.e, the "client side").

Did you try removing this share and stopping the NFS service, and then deleting these directories?

Somewhat related: I think it's a poor deign to slap a label on a storage pool with "(System Dataset Pool)". It's a misnomer and causes confusion. The label should instead read: "(The hidden System Dataset resides in this pool)"
 
Last edited:

user07072023

Cadet
Joined
Jul 7, 2023
Messages
3
"System Dataset" is a specific term in TrueNAS, and the GUI might cause confusion.

When you refer to your "System Dataset", you are actually referring to your main pool which happens to also house the ("hidden") System Dataset (".system").

It sounds like you shared your top-level root dataset of your pool ("truenas-pool-1"), and thus subdirectories were created inside (from the other end of your NFS share).
Correct. Thank you for putting this together in spite of my misnomer; while in the original post I wrote "System Dataset" I meant "top-level root dataset of my pool" Apologies for the confusion I caused, sretalla!
Did you try removing this share and stopping the NFS service, and then deleting these directories?
This worked!
 
Top