mounting NFS share with the same UID and GID from a user on the client, not the user from the NAS?

Status
Not open for further replies.

senior_hombre

Explorer
Joined
Feb 11, 2012
Messages
51
Hi,
i have o dataset on my freeNAS that is the home directory of the first created user (user1: uid=1001, gid=1001 on the NAS),
i want to use the NAS/dataset as a central storage of the home-directory of a user ona different pc (this pc has linux installed).
Thats why i created a NFS share for this dataset, the plan is to mount this over the home directory of the user on the different pc.

The problem is, the user on the linux pc has a different local uid=1000 and gid=100
when mounting the NFS share on the linux pc using this command:
Code:
sudo mount -t nfs 192.168.0.30:/mnt/volume1/user1 /home/paul

the directory gets mounted but the directory and its contents are all owned by 1001:1001.
Thats not what i want of course. What can i do to change that?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Best solution is to change the uid of the user on the Linux box
 

grep137

Dabbler
Joined
Mar 21, 2014
Messages
36
I'm having the same problem.

Here are a couple of more options which I've come across (I'm really new at this game, so take my ramblings with a grain of salt).

I haven't read it too closely yet, but I did see this blog post:
NFS mount with differing UID and GID
http://iansramblings.com/2009/02/25/nfs-mount-with-differing-uid-and-gid/

I also saw somewhere (can't seem to find where I read it at the moment) that there are force user id and force group id options which you can add to the mount command, not sure if these would be applicable.
 

senior_hombre

Explorer
Joined
Feb 11, 2012
Messages
51
My solution was to create a new user on the NAS with the correct uid and a new group with the gid 100 this works in my case, but this does not work if i had more than one remote home dir to provide on the same nas, it is possible that there are different local users on different pcs but all with the same uid (mostly 1000 because thats where new users start)

About the force uid and gid option, this is only possible when mounting CIFS shares but thats not what i want
 
Last edited:

grep137

Dabbler
Joined
Mar 21, 2014
Messages
36
I have multiple PCs all with users with uid 1000 and gid 1000. If I changed all of their uid's and gid's to 1001 to match my FreeNAS, would that cause any problems, so long as none of them were accessing the NAS at the same time? I have an NFS share on the NAS.
 

senior_hombre

Explorer
Joined
Feb 11, 2012
Messages
51
It would probably be possible but imagine a situation where you have to provide a network storage for different people all with their own pcs and linux variants. Maybe some of them using their configuration for a long time. I cannot force them to change the uid localy because that would include chowning all of their files and such. and there are differences in the user group paradigm too, not all distributions create a new group for each user, opensuse for example has one group called users with gid=100.

But if you ask for practicability each user should have/use its own share if you would like to give every user its own personal storage (a new/own directory for each user) and not having them sharing just the home directory of the freeNAS uid=1001 user.
Another problem would be that each user could mount every NFS share configured by freeNAS if you did not restrict each share for the distinct users IP
 
Last edited:

grep137

Dabbler
Joined
Mar 21, 2014
Messages
36
Oops, I'm sorry, I was actually trying to hijack your thread and ask you a question, not give a suggestion. :)
 

grep137

Dabbler
Joined
Mar 21, 2014
Messages
36
Thank you for the help.

Currently I'm really short on time, so I was just trying to find the quickest safest solution.
 
Status
Not open for further replies.
Top