Mount external NFS shares in TrueNAS SCALE

Norumen

Dabbler
Joined
Dec 23, 2020
Messages
18
Hi.
Have a Synology NAS with some shares I would like to mount on my TrueNAS SCALE. The TrueNAS containers need the data on the shares
Sometimes I succeed to mount the shares, other times I got errors.
This is the code I use:
mount 192.xxx.x.xxx:/volume4/sharename /mnt/foldername

Trying manually and getting this error: "access denied by server while mounting 192.xxx.x.xxx:/volume4/sharename" half the time I try to run.

What is best practice to mount external shares in TrueNAS? And how to do this so the share stay mounted.
 

dracozny

Dabbler
Joined
May 31, 2017
Messages
10
The linux way would be to add a new line to /etc/fstab
Code:
host.myserver.com:/home /mnt/home nfs rw,hard,intr,rsize=8192,wsize=8192,timeo=14 0 0

you might put in a ticket for a feature request to add mounting NFS volumes in the UI
 

Norumen

Dabbler
Joined
Dec 23, 2020
Messages
18
I know how to add this into /etc/fstab. But is this going to be gone if I updateTrueNAS? As I understand, all manual config in the OS is wiped when I update TrueNAS.
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
I know how to add this into /etc/fstab. But is this going to be gone if I updateTrueNAS? As I understand, all manual config in the OS is wiped when I update TrueNAS.
HassOS has a quite significantly sized list of different supported formats, all OVA formats are for VM's ;-)
It's really a shame they don't just provide an ISO installer though, would make your life a lot easier.

You could make a zvol, mount it on your PC using ISCSI and write the disk image to said ISCSI disk.
There is also a whole lot of info converting volumes, but I think SCALE defaults to zvol...

 

Norumen

Dabbler
Joined
Dec 23, 2020
Messages
18
HassOS has a quite significantly sized list of different supported formats, all OVA formats are for VM's ;-)
It's really a shame they don't just provide an ISO installer though, would make your life a lot easier.

You could make a zvol, mount it on your PC using ISCSI and write the disk image to said ISCSI disk.
There is also a whole lot of info converting volumes, but I think SCALE defaults to zvol...

Thank you for your answer.
I totally agree, they should have provided an ISO installer.
See what I find out.

PS: You answered me on the wrong thread ;)
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Thank you for your answer.
I totally agree, they should have provided an ISO installer.
See what I find out.

PS: You answered me on the wrong thread ;)
SHOOTS.
Sorry, you where the top notification the first time I clicked and the top notification the second time I clicked :P >.<
 

Norumen

Dabbler
Joined
Dec 23, 2020
Messages
18
SHOOTS.
Sorry, you where the top notification the first time I clicked and the top notification the second time I clicked :P >.<
I'm busy :P

You don't have any idea on how to mount external shares inside TrueNAS?
 

shadofall

Contributor
Joined
Jun 2, 2020
Messages
100
I'm busy :P

You don't have any idea on how to mount external shares inside TrueNAS?

best way would probably be to call the mount from an init/shutdown scripts under Data Protection in the SCALE ui, haven't tried it my self but worth a shot i'd think since you can pass commands or scripts there.

course still need to figure out why it sometimes errors/some times mounts fine. Might be something with the export settings that maybe your SCALE setup doesn't sometimes match after a reboot?
 
Last edited:

Kieeps

Dabbler
Joined
Jun 17, 2018
Messages
30
The fstab isnt persistent through updates as you said, atleast it wasnt when i tried it a while back.

I ended up adding a nfs-client container to my docker-compose file, that way i could make sure the container that needed access started after the share was mounted.

Cant remember what container i used, i just searched dockerhub for nfs-client iirc
 

Norumen

Dabbler
Joined
Dec 23, 2020
Messages
18
best way would probably be to call the mount from an init/shutdown scripts under Data Protection in the SCALE ui, haven't tried it my self but worth a shot i'd think since you can pass commands or scripts there.

course still need to figure out why it sometimes errors/some times mounts fine. Might be something with the export settings that maybe your SCALE setup doesn't sometimes match after a reboot?

Tried the init script. The script created a folder and then mounted the NFS share inside the folder. When I activated the init script, nothing happened under boot. Ran the script manually, and everything worked, except that the mount did fail more often than not.
 

majerus

Contributor
Joined
Dec 21, 2012
Messages
126

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
@majerus External NFS mounts for containers (the new jails in SCALE) are already possible with Democratic CSI, like I explained.
So maybe adjust your issue accordingly?
 

majerus

Contributor
Joined
Dec 21, 2012
Messages
126
crap this is a scale thing.. Eitherway still think this would be useful for Truenas outside of the container/jail space
 

ecomstock

Cadet
Joined
Nov 25, 2018
Messages
7
So I'm late to the party. In SCALE, will updates to the etc/fstab file persist between reboots? After two quick tests, it seems like it is overwritten every time the system is rebooted.
 

shadofall

Contributor
Joined
Jun 2, 2020
Messages
100
So I'm late to the party. In SCALE, will updates to the etc/fstab file persist between reboots? After two quick tests, it seems like it is overwritten every time the system is rebooted.

No they won't. Don't expect anything that can't be modified from the webui to be persistent through reboots/updates
 

ecomstock

Cadet
Joined
Nov 25, 2018
Messages
7
shadofall, I just wanted to follow up with your suggestion using init scripts under Data Protection. I tried this out using both commands and scripts and was not able to mount any shares using the 'mount' command. The same command worked when using the UI shell. I've upvoted majerus's feature request, so maybe we'll see some additional UI options for this in the future. Thanks!
 

ecomstock

Cadet
Joined
Nov 25, 2018
Messages
7
@ornias, you previously said

External NFS mounts for containers (the new jails in SCALE) are already possible with Democratic CSI


Can you offer some advice, guidance, links as to how one might do this? I'm not familiar with Democratic CSI at all and I've made 0 progress with this.

Thanks!
 

ornias

Wizard
Joined
Mar 6, 2020
Messages
1,458
Can you offer some advice, guidance, links as to how one might do this? I'm not familiar with Democratic CSI at all and I've made 0 progress with this.
Well, as it delves into deploying custom Helm Charts and k8s storage providers, I will refrain from doing so because both are not officially supported.
Also you (most likely) would need to start learning k8s and helm basics before deploying custom storage providers anyway.

What I tried to say with that quote is that it is theoretically possible without host-system changes.
 
Top