When I mount using the sync
option:
sudo mount -o vers=4,soft,sync,sec=none -t nfs 192.168.1.198:/js.js /mnt/self
the sync option doesn't seem to get applied:
$ cat /proc/mounts | grep nfs
192.168.1.198:/js.js /mnt/self nfs4 rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,soft,proto=tcp,port=0,timeo=600,retrans=2,sec=null,clientaddr=192.168.1.198,local_lock=none,addr=192.168.1.198 0 0
However, if I use the noac
option, which implies sync
:
sudo mount -o vers=4,soft,noac,sec=none -t nfs 192.168.1.198:/js.js /mnt/self
then I do see it being applied:
$ cat /proc/mounts | grep nfs
192.168.1.198:/js.js /mnt/self nfs4 rw,sync,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,acregmin=0,acregmax=0,acdirmin=0,acdirmax=0,soft,noac,proto=tcp,port=0,timeo=600,retrans=2,sec=null,clientaddr=192.168.1.198,local_lock=none,addr=192.168.1.198 0 0
Also, if I mount the root of the server instead of a subdirectory:
sudo mount -o vers=4,sync,sec=none -t nfs 192.168.1.198:/ /mnt/self
then I also see the sync option being applied:
$ cat /proc/mounts | grep nfs
192.168.1.198:/ /mnt/self nfs4 rw,sync,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=null,clientaddr=192.168.1.198,local_lock=none,addr=192.168.1.198 0 0
This is with kernel 3.8.0-28-generic on Ubuntu. When I try the same thing using 2.6.32 on CentOS, the sync option is applied in all cases.
How do I enable sync mode without noac mode in newer versions of the kernel and when mounting a subdirectory?