NFS and ZFS

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
jave
Level 4
Level 4
Posts: 227
Joined: Mon Dec 02, 2019 6:53 am

NFS and ZFS

Post by jave »

Hi
I'm getting a little bit confused here with NFS.

On my server I've set up a ZFS pool on a server with 3 drives - all good there.
The ZFS pool has a mount point of /media/nas

Now on the server I have my /etc/exports file:

Code: Select all

/media/nas	192.168.1.0/24(rw,all_squash)
So does this mean I'll accept all connections on the subnet for the mount point /media/nas? And give them rw access?

On the client I have in my /etc/fstab file:

Code: Select all

192.168.1.48:/media/nas  /media/nas  nfs  noauto,user 0 0
This all works, I can see the mount "nas" BUT I can't read/write to it from the client.

All input appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: NFS and ZFS

Post by Moonstone Man »

jave wrote: Mon Feb 22, 2021 11:27 pm This all works, I can see the mount "nas" BUT I can't read/write to it from the client.
You will not be able to read or write from the client unless your client-side user has the same UID as the owner of the files on the server.

Code: Select all

sudo chown -R nobody:nogroup /server/nas/
https://devopscube.com/how-to-set-up-a- ... nd-client/

You might also try these fstab settings:

Code: Select all

...        ...    nfs4     defaults,bg,user,noatime,_netdev,nofail    0      0
bg will force the mount into the background where it will keep trying to connect until the server becomes available. You'll see connection attempts in dmesg.

_netdev informs the system that it's a network device and may be a little slow to respond.

nofail will prevent your system locking up for 90 seconds or more during boot if something goes wrong with the mount.

Optionally add exec if executing files is required.
User avatar
jave
Level 4
Level 4
Posts: 227
Joined: Mon Dec 02, 2019 6:53 am

Re: NFS and ZFS

Post by jave »

You will not be able to read or write from the client unless your client-side user has the same UID as the owner of the files on the server.
So my client UID is "jave" and on the server "nas". They won't talk at all unless I have a user "jave" on the server also?

Even with...

Code: Select all

sudo chown -R nobody:nogroup /server/nas/
That still won't work?
Locked

Return to “Networking”