I'm trying to set up an nfs with two exported shares on voidlinux. My /etc/exports file looks like this:

/home/jeff/a *(ro,no_root_squash)
/home/jeff/b *(ro)

On my client I run sudo mount -t nfs4 /mnt/nas/ and that works just fine for both directories. However, if I change my /etc/exports to use the root_squash option for /home/jeff/a like this:

/home/jeff/a *(ro,root_squash)
/home/jeff/b *(ro)

and then run sudo exportfs -r to make that update real. I can then run the exact same command (sudo mount -t nfs4 /mnt/nas/), but now I get

mount.nfs4: access denied by server while mounting

I thought that it should have no effect because I was making changes to a different share, so I'm kind of lost at this point. showmount -e shows

Export list for
/home/jeff/b *
/home/jeff/a *

like I would expect in either case. I've tried restarting the nfs service on the server, I've tried enabling and disable statd on my client machine. I read in this guide by redhat that /etc/exports has a pretty sensitive syntax, but I didn't think that what I did introduced any syntax errors. I feel like I'm missing something about nfs. My question is: Why does it work in one of these configurations but not the other?

  • @KamilMaciorowski Mounting /home/jeff was allowed and not what I expected! However, adding subtree_check to both entries doesn't allow me to mount /home/jeff/a (or /home/jeff/b) and still allows for mounting /home/jeff, so I'm still unclear on what the solution is. Commented Apr 3, 2021 at 5:43


You must log in to answer this question.

Browse other questions tagged .