SOLVED TrueNAS as a network client

marshalleq

Explorer
Joined
Mar 12, 2016
Messages
88
Hi, are there any plans to add this funcationity to scale? I have two boxes (one currently with unraid on it) and and have come back to look at the state of TrueNAS on my dev box. Looking very nice I have to say!

However, I don't seem to be able to connect it to network storage (other than iscsi). I can't as far as I know even connect it via NFS, but anything even SMB would be a bonus.

So, does anyone know if it is on the roadmap to add TrueNAS as a network client i.e. mounting a foreign existing file system into unraid somewhere? Unraid has this and it's pretty essential in my setup.

Many thanks,

Marshalleq.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
However, I don't seem to be able to connect it to network storage (other than iscsi). I can't as far as I know even connect it via NFS, but anything even SMB would be a bonus.

So, does anyone know if it is on the roadmap to add TrueNAS as a network client i.e. mounting a foreign existing file system into unraid somewhere? Unraid has this and it's pretty essential in my setup.

Hi Marshall, I think it depends on how you plan to mount and then use the storage?
Can you describe the use-case more fully?
Are you trying to sync or migrate data?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I have, for example, attached storage to my SCALE box from my CORE box in order to have Plex accessing the media library.

I do it like this:

Create a Post-Init script under System Settings | Advanced to run this script:

Code:
#! /bin/sh

mount 192.168.1.2:/mnt/tank/videos /mnt/truenascore/videos


I needed to create /mnt/truenascore/videos first and give it the appropriate permissions.

My TrueNAS core is sharing the path via NFS.

I then use that path to mount into the Plex app.
 
Last edited:

marshalleq

Explorer
Joined
Mar 12, 2016
Messages
88
Well, one use case is tdarr. I need to mount a remote cache that is shared between the host and nodes. On top of that the source material is on another host. This system is just a remote node.

In addition there are remote document stores and other media that would need mounting. These have multiple nodes that require access.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
Well, one use case is tdarr. I need to mount a remote cache that is shared between the host and nodes. On top of that the source material is on another host. This system is just a remote node.

In addition there are remote document stores and other media that would need mounting. These have multiple nodes that require access.
So, you want specific Apps to be able to mount local and remote "datasets"?
Does @sretalla advice work for you?
 

marshalleq

Explorer
Joined
Mar 12, 2016
Messages
88
Hi, yes I hadn't thought of using a script to do it. Of course it would be much better if I could get this outcome in a less clunky way, but the outcome will work just fine.

Thanks everyone and thanks to @sretalla for posting the example.

Marshalleq.
 

Selassie

Dabbler
Joined
Jun 22, 2018
Messages
46
I have, for example, attached storage to my SCALE box from my CORE box in order to have Plex accessing the media library.

I do it like this:

Create a Post-Init script under System Settings | Advanced to run this script:

Code:
#! /bin/sh

mount 192.168.1.2:/mnt/tank/videos /mnt/truenascore/videos


I needed to create /mnt/truenascore/videos first and give it the appropriate permissions.

My TrueNAS core is sharing the path via NFS.

I then use that path to mount into the Plex app.
I need some assistance to configure the automounting of a share from my storage box running Truenas Core to be seen by App on Truenas Scale. I can mount the drive manually via the shell but get errors when I try to enter the credentials in the Fstab file. Your suggestion above seems like a much better way.
I'm using this command to mount manually, mount.cifs //192.168.1.56/smb01/data /mnt/tv -o user=***, Pass=*** 0 0
The error I get when mounting this manually is it asks me for a password in the shell, but then it mounts. when I put the same line in the Fstab file (minus the mount.cifs) if get an error and it ignores the line completely. I have attached a screenshot of the add Init/Shutdown Script dialog box, but not sure how to enter the information you have provided above. The mount point is in place etc so almost good to go.
 

Attachments

  • 2021-11-26_23-45-10.jpg
    2021-11-26_23-45-10.jpg
    39.1 KB · Views: 524

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I don't think the Pass= argument should have a capital P... Probably why it prompts for the password at the cli.

I use NFS, so don't specify a password to mount, but rather set the user at the NFS share end.
 

Selassie

Dabbler
Joined
Jun 22, 2018
Messages
46
I don't think the Pass= argument should have a capital P... Probably why it prompts for the password at the cli.

I use NFS, so don't specify a password to mount, but rather set the user at the NFS share end.
Thanks, I double-checked the Fstab file again just now and I did not have a capital P, it was a typo in the message I sent. How would I enter the credentials in the Post-Init script, I came to the dialog box and wants sure if you can enter more than one line at a time.
 

Selassie

Dabbler
Joined
Jun 22, 2018
Messages
46
I have, for example, attached storage to my SCALE box from my CORE box in order to have Plex accessing the media library.

I do it like this:

Create a Post-Init script under System Settings | Advanced to run this script:

Code:
#! /bin/sh

mount 192.168.1.2:/mnt/tank/videos /mnt/truenascore/videos


I needed to create /mnt/truenascore/videos first and give it the appropriate permissions.

My TrueNAS core is sharing the path via NFS.

I then use that path to mount into the Plex app.
sretalla, if I am understanding correctly, what you have done above is create and script that has the mount command and put it in the /bin/sh folder. Change the permissions to make it executable and point to it using Init/Shutdown command/Script. Is this correct or have I overcomplicated it?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The #! /bin/sh line tells the system which shell to use to run the script.

The next line (and others if you wanted) just run as if at the sh prompt.

I put that script in the /root directory, but it can also be somewhere on one of your pools, those scripts come after pools are mounted.

Otherwise all good.

Normally you would specify the password by having a file that contains it with restricted permissions and pointing the mount command at it.
 

Selassie

Dabbler
Joined
Jun 22, 2018
Messages
46
The #! /bin/sh line tells the system which shell to use to run the script.

The next line (and others if you wanted) just run as if at the sh prompt.

I put that script in the /root directory, but it can also be somewhere on one of your pools, those scripts come after pools are mounted.

Otherwise all good.

Normally you would specify the password by having a file that contains it with restricted permissions and pointing the mount command at it.
Thanks, I decided to move everything to Ubuntu Server and use Docker and Protainers it was much less headache than Truenas Scale and everything just works. I will look at Scale again maybe when it is officially released.
 

dbb12345

Dabbler
Joined
Jan 14, 2022
Messages
45
I am so close and think it is a permission issue. I get "Mount.nfs: access denied by server while mounting 192.168.1.236://volume1/movies" when I type into shell. I haven't tried doing it in a preinit yet assuming since shell does not work neither will a script. Any advice on permissions?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
I am so close and think it is a permission issue. I get "Mount.nfs: access denied by server while mounting 192.168.1.236://volume1/movies" when I type into shell. I haven't tried doing it in a preinit yet assuming since shell does not work neither will a script. Any advice on permissions?
I would start by changing the path to a real one... like ip.address:/mnt/volume1/movies

Then look at how you're allowing the NFS share to be connected to... you may just need to set a user on the share who has the needed permission.
 

dbb12345

Dabbler
Joined
Jan 14, 2022
Messages
45
so current code is:
mount 192.168.1.236:/volume1/movies /mnt/Server/myshared

I made the dataset and getting the error:
Mount.nfs: access denied by server while mounting 192.168.1.236:/volume1/movies

This implies the permission problem is with the NFS server? Sorry if not clear I am learning.
 

dbb12345

Dabbler
Joined
Jan 14, 2022
Messages
45
Sorry I semi fixed it! movies had a capital M

I mapped it to my plex but plex shows nothing in the folder. So on to the next problem but thx to this post I am through the front door :)
 

dbb12345

Dabbler
Joined
Jan 14, 2022
Messages
45
So I can see the folder in Truenas and the files inside of it. When I mount folder in the container, I get access denied when I try to LS the directory in the container shell and no files shown in Plex? How does one give access to the container. PS SO sorry to open this old post but the context is needed to understand my issue.

Again.. thank you sooo much for your time and klnowledge.
 

otpi

Contributor
Joined
Feb 23, 2017
Messages
117
I managed to mount my FreeNAS smb media share using:

mount.cifs //10.0.0.8/media /mnt/wdmirror/mediaonfreenas --verbose -o ro, user=myusername

Could not get it to accept pass=mypassword, but it's only a stopgap solution before I physically migrate drives, so I'm fine typing this inn manually.

Worked perfect in plex app
 

gnolnos

Cadet
Joined
Mar 6, 2022
Messages
1
This command works for me
mount -t cifs -o username='myusername',password='mypassword',domain=WORKGROUP //192.168.100.100/sharepoint /mnt/ssd-pool/mountpoint
 

Marcelofs1

Dabbler
Joined
Jul 17, 2015
Messages
24
I am facing a similar issue. I used to have my NAS2 properly mounted into my NAS1 using mount -t nfs 192.168.0.22:/mnt/NASII/Shows /mnt/NAS/NASII/Shows
Due a hardwar failure, I have to recreate the NAS2 and booted up with TrueNAS-13.0-U2 and I got "permission denied" when trying to mount. I tried booting up on a previous version 12.1 with no success. I even have tested changing the share to 777 but still getting permission denied.
Weird enough, from other windows machine the share seems OK with capability to read/write into the share. I never faced such problem before and I do not know how to proper troubleshoot why I am having this permission denied message.
I've been also searching other threads with no luck on the suggested way forward. Any guidance will be higly appreciated.

Thank you
Marcelo
 
Top