Permissions have me scratching my head

Loren Zimmer

Dabbler
Joined
May 6, 2017
Messages
25
My Freenas box is hosting several shares. A few weeks ago I noticed that a ubuntu VM (hosted on another machine) was throwing an error that it couldn't write to a folder. I thought that this was a perfect opportunity to reorganize a little and try and gain a clearer understanding of permissions and sharing.

After a little reading I thought it would be better for me to use a NFS share for the linux machine that was trying to access and write to the pool on the freenas system. I created the share, ensured that the linux machine user was a member of the group that owns the folder that's being shared, and that the group has permission to read and write. After that I followed this tutorial on how to mount the share on the linux box.

I connected to the linux machine via ssh and created the folder /mnt/backupsNFS/. Then I mounted the share like this:
sudo mount -t nfs "ipofFreenas":/path/to/NFSshare /mnt/backupsNFS
Now when I try and enter the directory I get this error:
-bash: cd: backupsNFS: Permission denied
When I check the permissions of the backupsNFS folder this is what is returned:
drwxrwxr-- 13 820 821 13 Jan 11 12:34 backupsNFS
Based on the permissions that are returned, I should be able to read, write and execute, right?

What am I doing wrong or what is the next step to get the linux machine the ability to write to the /mnt/backupsNFS folder.

Any suggestions or help would be greatly appreciated.

Loren
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
What are the linux perms on "/mnt/backupsNFS" before and after the NFS mount? What are the perms on the dataset ( or directory) you are sharing via NFS? Have you created an NFS share on a dataset that is also being shared via SMB, and/or was created as a "Windows type" dataset? Do you have accounts on both FreeNAS and Ubuntu with matching user & group ids?
 

Loren Zimmer

Dabbler
Joined
May 6, 2017
Messages
25
@KrisBee thanks for taking the time to respond. See answers below:

What are the linux perms on "/mnt/backupsNFS" before and after the NFS mount?
before the mount on ubuntu:
drwxrwxrwx 2 root root 4096 Jan 11 12:22 backupNFS

after the mount on ubuntu:
drwxrwxr-- 13 820 821 13 Jan 11 12:34 backupNFS


What are the perms on the dataset ( or directory) you are sharing via NFS?
Both group and owner have rwx

Have you created an NFS share on a dataset that is also being shared via SMB, and/or was created as a "Windows type" dataset?
It is also being shared via SMB


I changed the user ID on ubuntu to match the freenas ID then tried to remount with the permission results listed in response to your questions about permissions prior to mount and following mounting the storage.
 

KrisBee

Wizard
Joined
Mar 20, 2017
Messages
1,288
If you want predictable results it's not generally a good idea to share the same dataset using both SMB and NFS. A "windows type" dataset has its "aclmode" property set to "restricted" and a default ACL set. If you are using FreeNAS 11.2-U7, then https://www.ixsystems.com/blog/library/freenas-11-2-u7/ shows how this idefault ACL is set.

If you need both linux and Windows clients to access the same data on FreeNAS, it's better to stick to using SMB shares only and mount those in linux. Is the Ubuntu VM a server or desktop install?

Unless you llsted with "ls -ln", the fact that you're seeing numeric values of "820:821", rather than names, on "backupNFS" after that mount in linux suggests the corresponding user and group in FreeNAS have no match in your Ubuntu VM.
 

Loren Zimmer

Dabbler
Joined
May 6, 2017
Messages
25
@KrisBee Thank you again for your assistance!
If you want predictable results it's not generally a good idea to share the same dataset using both SMB and NFS.

I’ve reverted back to a SMB share and am working to get user IDs and groups to match up on the Linux box. I am now on a Buisness trip and may not be able to make progress right away. I’ll let you know how things go.
 

Loren Zimmer

Dabbler
Joined
May 6, 2017
Messages
25
It took me a while but I think I got the issue sorted out. I didn't have the uid and gid listed in the line mounting my share within my /etc/fstab file.
 
Top