nfs4 and all_squash

all_squash does not work when directory/share is on the same filesystem. Example:



We have to mount folder with a bind to get this working. Move folder to new location, here I’m hiding it:

mv /media/mount/folder /media/mount/.folder
mkdir /media/mount/folder


/dev/sdb1 /media/mount ext4 defaults 0 0
/media/mount/.folder /media/mount/folder none bind 0 0

Mount and reload nfs exports:

mount /media/mount/folder
exportfs -r