NFS share problem

beltet

Dabbler
Joined
Sep 24, 2013
Messages
26
Hi!

I'm trying to connect a NFS share to one of my VM's on another machine, so I can use the storage on my NAS for some services on the VM.

I think I have managed to set up the permissions correctly, and connected it correctly to the VM. But I still get permission error when trying to write to the share.

I have set up a user on my NAS. named user1 with uid 1000. And I use the group media gid 8675309
I also set up a user on the VM. named user2 with uid 1000. And created a group called media with gid 8675309.

I then gave the dataset I want to share the permission of user1 & media. And user and group write permissions.

And I changed the Mapall user and Mapall group to nobody:nobody as per TrueNAS documentation:
https://www.ixsystems.com/documentation/freenas/11.3-U5/sharing.html#example-configuration

I mounted the share with:
Code:
mount -t nfs true.nas.ip.adress:/path/to/nfs_share /path/on/vm


When I use ls on the VM, I see that the ownership is user2 and media, just as I set it up with uid/gid.

But when I try to write to the share I get permission denied.

The only thing I can see that may give some problem is that the usernames are not the same on both machines. But the uid is the same. Isn't that enough?
But the share have the exactly same gid on both machines. And both user and group can write to the share. That would enough, wouldn't it?

So any ideas and tips is welcome!
 
Joined
Dec 29, 2014
Messages
1,135
It is probably that you need to map the root user and group in the advanced NFS share properties. I have to do this to allow ESXi to mount NFS shares.
1623005530396.png
 

beltet

Dabbler
Joined
Sep 24, 2013
Messages
26
Hi. Sry for the late reply.
I mapped the mapall user and mapall group to the user/group that's supposed to have permissions. And it works.
I will do some more tests on another share and see if your solution works aswell. As now I have some troubles with mounting the NFS share with fstab on the client. It sometimes mounts on boot and sometime it doesn't. As these services writes tot the disk I would like them to mounted correctly on boot.
Any other suggestions on the mounting would be awesome aswell.
 

w3services

Cadet
Joined
Jun 9, 2021
Messages
2
@Elliot Dierksen

Here is one new problem.

Let's assume we created one dataset ( DATADISKA ) and assigned it to user X with a 1TB disk quota. Now, as per NSF, we did the required changes map root user and group to root.

After mounting this to CentOS server, what if -

1 ) user added more than 1 TB of data in DATADISKA? Will he able to add it ?
2 ) Owner is X but the root can add data which may create an issue.

Please guide.

The requirement is - create an account and limit it with quota and mount it to a linux server for file sharing. No on can add more than define limit data in this/
 
Joined
Dec 29, 2014
Messages
1,135
That is a different case which I haven't had to implement. In days gone by, that would have been a job for YP/NIS to manage users and groups across boxes, and then the user id's and group would be consistent across all systems. Then applying the quota would be just like a local file system. I'll have to defer to someone else since I haven't done that. At this point I only use NFS for ESXi to mount data sets.
 
Top