1

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 192.168.0.253:/home/jeff/b /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 192.168.0.253:/home/jeff/b /mnt/nas/), but now I get

mount.nfs4: access denied by server while mounting 192.168.0.253:/home/jeff/b

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 192.168.0.253 shows

Export list for 192.168.0.253:
/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?

1
  • @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. Apr 3, 2021 at 5:43

0

You must log in to answer this question.

Browse other questions tagged .