Completely lost with network share between TrueNAS Scale and Docker/Portainer in a VM.

Need Help

I've been working on solving this for the last few days to no luck. Hoping someone can point out where I'm going wrong.

​

Right now I have TrueNAS Scale running on the bare metal of my server with a few datasets shared. I am able to access those datasets from my Windows PC.

In TN I have a VM running Ubuntu Server with Docker and Portainer installed.

​

Steps I have taken so far:

  1. Create dataset in TN, edit user permissions, enable SMB and NFS shares.
  2. Create bridge so VM and host can talk to each other. Able to ping between the two.
  3. Add Volume in Portainer following the instructions from this comment.
    1. Name: Vol1
    2. Local Driver
    3. Use CIFS Volume
    4. 192.xxx.x.x
    5. /tank/downloads
    6. User: {user} (Same user I use to access the folder in Windows)
    7. Password: {password} (Same password I use to access the folder in Windows)

The problem (I think) is Portainer shows the mount point as /var/lib/docker/volumes/{folder name}/_data which seems to me to be mounting inside the VM disk, not accessing the network share. When I cd into that folder none of the expected contents are there.

​

Any insight would be greatly appreciated.

Posted Sep 8, 2023, 3:51 PM UTC

17
thekrautboy•

Dont use SMB/CIFS unless you absolutely have to, usually when Windows is involved.

Use a NFS share from TN and add that as a Docker volume, Docker natively can handle NFS. Then mount that volume to whatever containers you want. Of course you need to make sure that permissions are done correctly.

1
TetrarcOP•

For the NFS Volume settings would it be:

  • Name: Vol1
  • Local Driver
  • Address: 192.xxx.x.x
  • NFS Version: NFS4
  • /tank/downloads
  • Options: rw,noatime,rsize=8192,wsize=8192,tcp,timeo=14

?

​

Using those options I end up with the same mount point as above: /var/lib/docker/volumes/Vol1/_data and still show no files in the terminal.

1
thekrautboy•

For the NFS Volume settings would it be:

Looks alright but i cant say for sure, i dont use Portainer for things like this. Imo its not good to purely rely on a GUI based tool like this without knowing how Docker underneath works.

Using those options I end up with the same mount point as above: /var/lib/docker/volumes/Vol1/_data

Where else would it be? That is the default path for volumes. That doesnt mean the data isnt there through the share.

You should probably ask in r/portainer and r/docker

1
TetrarcOP•

Maybe I'm confused. Going to that folder in the terminal doesn't list any of the files from the network folder. Creating a new text file doesn't create the file in the share either.

I'll cross-post to those two. Thanks.

1
apco666•

If the containers weren't running, the volume directories were empty until they were started.

I've just moved most of my *arr containers back off NFS volumes for their config volumes, I found performance abysmal even on 2.5g links with small collections. I think it's more to do with the sqlite DBs not liking it. I might test it at some stage with an iscsi volume in the VM

1
flaming_m0e•

Why not just mount your NFS volume IN the VM and then use normal bind mounts inside docker/portainer?

Seems like you're overcomplicating it.

1
TetrarcOP•

I've started reading up on that. My understanding is for the mount to happen automatically on boot it involves editing the fstab file?

1
flaming_m0e•

Yep

1
james-portainer•

Once you've created the volume in Portainer, have you mounted it to a container? Before you do that you won't be able to see anything in the share.

1