4

I want to mount a nfs volume with nolock option, and it does mount success. But, the result seem that, the nolock option doesn't work.

[root@k8s-worker-2 opt]# umount nfs-test1/ [root@k8s-worker-2 opt]# mount -t nfs -o nolock,local_lock=all 369d24acc5-iba25.cn-shanghai.nas.aliyuncs.com:/ /opt/nfs-test1/ [root@k8s-worker-2 opt]# mount | grep nfs-test1 369d24acc5-iba25.cn-shanghai.nas.aliyuncs.com:/ on /opt/nfs-test1 type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.83.54,local_lock=none,addr=192.168.83.57) 

even the local_lock option doesn't seems ok.

0

1 Answer 1

7

By default mount begins from upper NFS protocol version and descends to lower. In your case NFS server supports version 4 therefore version 4 will be used. But NFS4 doesn't support lock/nolock and local_lock options. man 5 nfs. If you want to use this lock options, then you need append vers=3 option to your mount command.

1
  • I've just forgotten to add that NFS 4 has builtin locking mechanism instead of RPC lock mechanism in NFS2/3. Commented Mar 16, 2018 at 10:12

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.