3

I'm trying to use ZFS NFS export on my small home network. So far I've managed to export and to mount, but the mounted directory is mapped to user 'nobody' and it is readonly. I'd like to be able to write to the mount.

The server is running Solaris 11.3 and I exported my home directory using

zfs set share.nfs=on pool/export/home/nfs

On this system I have a uid of 1001 and a gid of 10.

I've tried mounting on Linux and macOS. On Linux my uid/gid are both 1000 and on macOS they are 501/20. Mounting from FreeBSD works read/write as the uid is the same.

I'm assuming that the issue is due to the uids (and gids) being different. A couple of things that I have tried

  • client side, mount as NVSv3 using -o vers=3
  • server side, export with anon=1001

Neither had any effect.

I see two possible solutions:

  1. Harmonize the uid/gids. I don't mind doing that on the Linux/FreeBSD systems as I don't have that much stuff on them. I'm a bit more reluctant to attempt that on my MacBook.
  2. Find some way to map

EDIT: Here is the info requested

# share
rpool_export_home_paulf /export/home/paulf      nfs     sec=sys,rw  

and

# sharectl get nfs
servers=1024
lockd_listen_backlog=32
lockd_servers=1024
lockd_retransmit_timeout=5
grace_period=90
server_versmin=2
server_versmax=4
client_versmin=2
client_versmax=4
server_delegation=on
nfsmapid_domain=
max_connections=-1
protocol=ALL
listen_backlog=32
device=
showmount_info=full
server_authz_cache_refresh=600
netgroup_refresh=600
resvport=false
3
  • What's the output from both share and sharectl get nfs? Also check your NFSv4 default domain on the Solaris server: docs.oracle.com/cd/E23824_01/html/821-1454/… You may find it easier to just force NFSv3 as the min/max NFS version shared by your server. I think that's also done using sharectl on Solaris 11.3. NFSv2 doesn't support large files, and the improvements in NFSv4 probably aren't worth the additional admin overhead for a small home network. Mixed OS NFSv4 networks can be a real pain. IME Solaris sticks really, really closely to the NFS standards. Mar 11, 2018 at 13:28
  • I've added some info to the question. I did think that there could be domain issues. Solaris is set to lan and is using static IP. My Mac using DHCP and has local as its domain.
    – Paul Floyd
    Mar 11, 2018 at 16:09
  • As far as a "domain" issue, the only thing I can think of is that if you're using NFS v4 as it appears you are, you'll need to have the same NFS v4 domain on both--usually set by the site in DNS. You can see the domain used by Solaris via: cat /var/run/nfs4_domain Mar 12, 2018 at 22:36

1 Answer 1

1

The issue with you not being able to write to the share is because of the different UID and GID as you stated yourself.

The easiest way to do it is to create a group on both machines with the same GID, change the ownership of the share to the group, and then add the users to the group.

On the both the Solaris server and Linux machine:

groupadd -u GID nfsgroup

On the Solaris server:

chown :nfsgroup /nfs/share

On the Linux machine.

usermod -aG nfsgroup linuxuser

You can also do it by changing the UID but that's a bit more complicated. The above commands will give you what you want.

1
  • On Linux I ended up changing uid. For mac/Solaris I'll give this a go,
    – Paul Floyd
    Mar 13, 2018 at 10:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .