SOLVED Can't mount NFS shares on my linux machine

Status
Not open for further replies.

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
Looking for a bit of a reminder on how to do this. I've recently got a FreeNAS machine up and running and am trying to set it up in a similar way to my old Ubuntu server. My linux laptop is my main machine and using fstab in the past I've automated the mounting on boot of the the Ubuntu server, so I can always see it in my file manager.

I'm having trouble replicating this with my FreeNAS box. So far I've set up an NFS share on my FreeNAS box and made the owner and the group nobody and nogroup respectively, on my linux machine both nobody and nogroup exist and I've made sure that they have the same IDs. I thought that would be enough. That didn't work, so I've checked the 'allow non-root mount' option under NFS shares (though I don't think I should have to do this). Still no joy.

I have a vague recollection of when I set up my Ubuntu server 5 years ago of setting up a file call 'exports' (or something like that) and running exportfs on the server so it would 'allow' certain IPs to mount to it.

I'd be grateful if someone could jog my memory.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
make a user on freenas that has the same uid/gid as the user you are using to mount the export. Then make sure that dataset that is being exported has the same owner and group as your user on your laptop.
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
make a user on freenas that has the same uid/gid as the user you are using to mount the export. Then make sure that dataset that is being exported has the same owner and group as your user on your laptop.

Yep, as mentioned in my first post, that's exactly what I've done, with no joy.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Yep, as mentioned in my first post, that's exactly what I've done, with no joy.
Huh? That is not what you did. You created an export that has nobody:nogroup and is probably 755. So this means anyone can mount the export but only nobody can write to the export. What about this is failing? The mount or writing? Provide error messages please.

Sent from my Nexus 5X using Tapatalk
 

scwst

Explorer
Joined
Sep 23, 2016
Messages
59
Yep, as mentioned in my first post, that's exactly what I've done, with no joy.
I just went through the same pain. What it boiled down to for me is that you need to have everything on both machines owned by the same user by UID (not: name). So user "drwho" on your Linux box with UID 1000 needs to be matched with "drwho" with UID 1000 (!) on the FreeNAS system.

I ended up changing the UID of the user on the FreeNAS system (this is what testing is for, right) and then spent an hour figuring out that the ZFS dataset I had already created for the NFS share still had the old UIDs and was really, really unhappy (symptom was that owner:group on the Linux machine showed up as somebody completely different). I ended up deleting the dataset and creating a new one.

After that, most very happy with NFS.
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
So far I've set up an NFS share on my FreeNAS box and made the owner and the group nobody and nogroup respectively, on my linux machine both nobody and nogroup exist and I've made sure that they have the same IDs.

Mmm... it seems I wasn't explicit, I thought the above was clear. What I meant by the above was yes, I've got datasets and shares set up with the same ids in both name and number on both machines and set to 777 as suggested by the handy visual how to guide HERE (thanks to silentmonolith for this).

SweetAndLow, I'm not sure what you mean by 'created an export'.

I've looked into /etc/exports and using the exportfs command as I would under linux, but it is apparently not the way to go with FreeNAS.

The error I'm getting on my linux laptop is "Failed to mount 'Dataset'. mount: only root can mount 192.168.X.XX:/mnt/PoolName/ShareName/Dataset on /home/jim/folder"

If I try mounting it from the terminal on the linux laptop I get access denied by server error.

I'm guessing I'm missing something pretty trivial.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Mount using sudo?

Sent from my Nexus 5X using Tapatalk
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
OK. I'm getting closer now. Managed to mount the share. My mistake had been that I had tried to share the datasets and not the share, which it didn't like.

So now the problem is that I've got the FreeNAS share mounted, I can see the directories and open them, but they are empty, which they aren't on my server.

I'm guessing it's a permission thing, but, as mentioned above, at ids for groups and users match on both machines.

Help much appreciated.
 

scwst

Explorer
Joined
Sep 23, 2016
Messages
59
Just to be sure, can you create a new file from the main computer on the share ("touch foobar.txt" for instance)?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
OK. I'm getting closer now. Managed to mount the share. My mistake had been that I had tried to share the datasets and not the share, which it didn't like.

So now the problem is that I've got the FreeNAS share mounted, I can see the directories and open them, but they are empty, which they aren't on my server.

I'm guessing it's a permission thing, but, as mentioned above, at ids for groups and users match on both machines.

Help much appreciated.
Have you read the noob slide show? Your not making any sense. How it works is you create a dataset or some directories in your file system then you share/export that path so your client can map/mount it. This allows you see the data on your Nas assuming you have read permissions.

Sent from my Nexus 5X using Tapatalk
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
Just to be sure, can you create a new file from the main computer on the share ("touch foobar.txt" for instance)?

Thanks for replying. Yes, I can do that.
______

Chmod 777 should Never be done…

Valid opinion, but, as mentioned above, I followed this graphic in the How Tos section on setting up permissions for a common folder.
_______

Have you read the noob slide show? Your not making any sense. How it works is you create a dataset or some directories in your file system then you share/export that path so your client can map/mount it. This allows you see the data on your Nas assuming you have read permissions.

Thanks again for your input on this. Yes, I had a good look at the noob slide, perhaps it’s my three kids BBQing my head. I’m having trouble with being able to see my files on my laptop using NFS share, but I have successfully set up and am running both Transmission and Plex in their own jails. The storage for both jails is mounted to the same datasets that I want my linux laptop to mount to, so I must be doing something right.
_______


I was hoping for a quick solution, which is why I didn’t post much detail initially, time now to give some more detail.

On my linux laptop I’m using this command to mount the FreeNAS share:

Code:
sudo mount 192.168.x.xxx:/mnt/poolname/media /home/username/media


(I’ve tried with mount -t nfs, but no difference)

This mounts the directories (and shows me the remaining space in the directory!), so that if I open the media directory on my laptop I can see the directories

cartoons
children
movies
music
torrents
tv

Unfortunately, if I click any of them, they appear to be empty (whereas if I run ls in the shell on the webgui the files appear), so I guess it’s a permissions issue.

As mentioned above, I’ve set up the media share as in the How To graphic on changing permissions to nobody and nogroup, checked all nine boxes and matched them on my laptop. Here’s the output from both machines:

FreeNAS:

Code:
[root@billynumbnuts ~]# id nobody 
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
[root@billynumbnuts ~]# getent group nobody 
nobody:*:65534:jim 
[root@billynumbnuts ~]# getent group nogroup 
nogroup:*:65533:jim 
[root@billynumbnuts ~]# id jim 
uid=1000(jim) gid=0(wheel) groups=0(wheel),65533(nogroup),65534(nobody),816(media)



Linux laptop:

Code:
jim@jim-Aspire-4830T:~$ id nobody
uid=65534(nobody) gid=65534(nobody) groups=65534(nobody)
jim@jim-Aspire-4830T:~$ getent group nobody
nobody:x:65534:jim
jim@jim-Aspire-4830T:~$ getent group nogroup
nogroup:x:65533:jim
jim@jim-Aspire-4830T:~$ id jim
uid=1000(jim) gid=1000(jim) groups=1000(jim),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),65533(nogroup),108(netdev),65534(nobody)



Unless I’m missing something, they look like they match to me, though I don’t what the difference is between the ‘x’ and the ‘*’ in the outputs of the getent commands.

Think I must be close, but...
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Are the different types of media separate datasets within your pool?
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
Yes, the share is media and the cartoons, childrens, movies etc are separate datasets.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Well that's why it doesn't work.

Each dataset is a separate filesystem. You will have to share each on via NFS and mount each individually.

See what happens when you provide all the info? ;)
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
OK. If that means that the share & dataset I have set up is okay, then I take you mean that I should do something like this:

sudo mount 192.168.x.xxx:/mnt/poolname/media/cartoons /home/username/cartoons

and then repeat it with each of the datasets? If so, I tried that sometime back and have just tried it again and get access denied by the server.

Or do you mean that I need to set up a different share for each dataset? Though I understand datasets to be akin to folders/directories and didn't think that shares themselves could contain data.

EDIT: btw, in the webgui under Sharing > NFS shares > media, I've had the 'allow directories' checked all along, which I thought would do it.
 

pirateghost

Unintelligible Geek
Joined
Feb 29, 2012
Messages
4,219
Each dataset is a separate filesystem. When you mount the root dataset, you can see the directories (mount points on FreeNAS), but not the data contained within.

You need to create a NEW share for each dataset you want to mount, and mount each one individually. Mounting the root dataset is useless unless there are directories that aren't datasets.


I don't know what you mean that shares can't contain data, as that's the point of the share...
 

tumblingthrough

Dabbler
Joined
Aug 29, 2014
Messages
30
Each dataset is a separate filesystem. When you mount the root dataset, you can see the directories (mount points on FreeNAS), but not the data contained within.

You need to create a NEW share for each dataset you want to mount, and mount each one individually. Mounting the root dataset is useless unless there are directories that aren't datasets.

I don't know what you mean that shares can't contain data, as that's the point of the share...

Right, so conceptually I haven't understood the structure at all, though I've managed to set up transmission and plex and fill datasets with data. I've got in my head that somewhere I read that firstly you create shares and then create datasets underneath them, which is what I've done and has worked so far. I guess it must have been luck. I'll have to sleep on it and try and get my head around this over the rest of the weekend and go back through that nook slide show again.

Will report back.
 
Status
Not open for further replies.
Top