Pool and permission setup help

ThomasHall

Dabbler
Joined
Jun 5, 2019
Messages
14
I'm not overly experienced with TrueNAS CORE or FreeBSD in general and the days when I used Linux systems was long ago, so I could use some advice in how to set up my file server.

The scenario is this: I have a new file server equipped with 2x16TB HDDs and a 2TB SSD, in addition to 2 SSDs for the TrueNAS installation and various system stuff like jails respectively. It's running a fresh installation of TrueNAS CORE 13.0 U5.3. My goal is to use the server for two purposes: as an external drive for my Windows desktop, and as a torrent server using Deluge (it's not going to be overly utilized for that, but I want the option). My plan is to have 2 separate pools, the first using the HDDs where I'll store my files and the second the SSD where Deluge will do its thing. Deluge will run in a jail and will only have R/W access to the SSD, while my desktop is going to have R/W access to both. In the future, I would also like to be able to give R access to other devices to certain parts of the storage, but still let my desktop have full control of it and making it look like it's just part of the folder structure.

What I've done so far is to create the pools ("Downloads" and "Store"), as well as a dataset for each (also called "Downloads" and "Store", not sure if that's a bad idea). Under the Store dataset, I've created an additional 2 datasets ("Music" and "Video"). I've also created 2 groups (again with the creative names "Downloads" and "Store"), and 2 users ("deluge" and "desktop"). The deluge user has password login disabled is assigned the primary group Downloads and auxiliary groups builtin_users which it did by itself. The desktop user has Store as primary group and Downloads+builtin_users as aux groups. Samba authentication is enabled for both users and groups, not sure if that matters. On the storage pools, I've added an ACL for each dataset and their respective group (e.g. Downloads dataset got an ACL to allow the Downloads group). I have not done anything special for the music and video datasets yet, so they are basically identical to the parent store dataset with the same ACL. I have some ideas about maybe opening up the music share to the outside world so I can stream music away from home, and maybe creating some sort of media server that would be able to access the video and music files, but that's on hold until later so it's limited to just my desktop for now. In the long run, I'd create groups and users for those functions as well.

For Deluge, I've created a jail and installed Deluge in it. After a bit of a rough start, I think I finally got it working, with the daemon running as a "deluge" user I created in the jail with the same ID as the deluge user created in TrueNAS. Much of this I stole from a guide, with a few adaptations to get it working on the points that failed. The web UI works and I can interact with it, setting download paths etc.

Finally, I've set up Samba shares called "Downloads" and "Store" and mapped them to the paths "/mnt/Downloads" and "/mnt/Store" respectively. From my computer, I can go to "\\<TrueNAS IP\" and log in with the desktop user, and I see the shares and can browse them, and can also create and edit files there or on the server, and they show up on both ends. So far so good.

So here are my questions.
1) When I look at the paths generated, what I see is e.g. "/mnt/Store/Store/Music", and likewise on my computer with "\\<IP>\Store\Store\Music". While I suppose this is not the end of the world, it's somewhat annoying and I'm wondering how to avoid it. I assume it's because I have Pool (Store) > Dataset (Store) > Dataset (Store) > Dataset (Music), and I should remove one of those datasets, but if I do then TrueNAS tells me that I can't edit permissions for the root dataset. I feel like I'm being stupid here and I'm overlooking something obvious, but how would I go about fixing that? I mean, I would like to be able to set permissions on the root dataset to restrict it to specific users. I guess I could just mount it one level down on my computer and I wouldn't have to see it, but I'd rather understand what I'm doing wrong so it doesn't causes more issues down the line.

2) I'm having trouble with getting the jail to use my Downloads dataset, which is where I want it to, you know, download everything. I've set up a mount point for the jail using the source "/mnt/Downloads/Downloads" and the target "/mnt/System/iocage/jails/Deluge/root/mnt", with the result being that going to "/mnt/" inside the jail yields nothing whatsoever. Using the source "/mnt/Downloads" instead will give me a Downloads folder in there, but it seems to be entirely disconnected from the actual storage pool, and creating files in there will not show up anywhere else, and likewise files created in the pool will not show up in the jail. Obviously something is not working properly, but I don't know what. I'm not all that familiar with jails and how the permissions work with them, so my guess would be something related to that, but I wouldn't know what to do about it.

3) Setting aside the two previous problems, is my overall approach to this at all reasonable, or should I do it in some entirely different way? Like I said, I've got limited experience with FreeBSD rights and user management, so I wouldn't be surprised if I'm way off base here.
 

Davvo

MVP
Joined
Jul 12, 2022
Messages
3,222
I have a similar setup (DATA pool connected by SBM to a few users and a JAIL pool with qBittorrent). Here is how I have set it up:
ALPHA (DATA POOL):
Code:
ALPHA
    BACKUPS
        USER1
        USER2
        USER3
    MEDIA

I don't share the mnt/alpha datset (the main dataset), but the subsequent ones: /mnt/alpha/backups/userX and /mnt/alpha/media.

My qBit jail (inside my OMEGA pool, the one used by jails and VMs) has a mount point with source: /mnt/alpha/media and destination /mnt/omega/iocage/jails/qBit/root/media/completed.

I have given the qBit user basic permissions to modify the content of the MEDIA dataset (ACL filesystem).

The following thread shows its creation progress, as well as the helpful guidance I received.

I have no SMB link between my desktop and the omega pool, because when I (very rarely) need to move things I do so by SSH as the root user, which gives me a few advantages: I don't use my network bandwith, and I can just keep the process in tmux withouth the need of leaving my desktop powered.

Please tell me if you need any more informations, like how I have set up the SMB shares.
 
Last edited:

ThomasHall

Dabbler
Joined
Jun 5, 2019
Messages
14
Alright, thanks. I adjusted my pools a bit with better names and did what you did and just skipped sharing the top level. Seems to work out okay that way for now. I'll have to experiment with adding some new users for the subsets later on.

In regards to my Deluge jail issue, seems like the issue was that the target needed an extra level in it, so instead of "/mnt/System/iocage/jails/Deluge/root/mnt" I used "/mnt/System/iocage/jails/Deluge/root/mnt/Downloads", and that worked. It did however expose another issue, which was that my deluge user couldn't write to that share. After a bit of less than successful trial and error, I ended up setting the user attribute in the ACL of the dataset to the deluge user, so the whole dataset is now owned by deluge as verified by an ls -la command, while the owner prior to that was root. The Deluge daemon can write and move stuff around within the mounted folder in the jail, while I can also access it from my desktop, so I guess it does what I want it to. I'm a little bit iffy about whether that solution is the correct one though, I feel like it should be a permission issue rather than an ownership issue, but I don't know how to fix that.

Now I just need to figure out what's wrong with the autoload Deluge plugin for torrent files. It worked once, but now it refuses and changes the suffix on the .torrent file to .invalid...
 
Top