0

While mounting a share I had issues with idmapping. Mounting with

sudo mount -t nfs 192.168.0.23:/myshare ./myshare -o nolock

and listing its contents yielded this (note the nobody and 4294967294):

-rwx------ 1 nobody 4294967294   48 Sep 27  1998 somefile

When I actually expected this:

-rwx------ 1 1023 1023   48 Sep 27  1998 somefile

I tried using NFSv3 by specifying -t nfs3 without luck:

sudo mount -t nfs3 192.168.0.23:/myshare ./myshare -o nolock,nfsvers=3

After a bit of research, the nfsvers=3 option did the trick

sudo mount -t nfs 192.168.0.23:/myshare ./myshare -o nolock,nfsvers=3
ls -la myshare

...
-rwx------ 1 1023 1023   48 Sep 27  1998 somefile

My question is: what's the difference between the nfsvers=3 option and -t nfs3? Shouldn't they be the same thing?

gmelodie
  • 105
  • 5
  • 2
    For clarity, which os is this that has a "nfs3" mount type (I suppose, from a different perspective, which has a mount.nfs3 program)? I guess the question is related to some difference in behavior between the mount.nfs and mount.nfs3 programs in your environment that goes beyond just the nfs version (which you can pass to mount.nfs). – Håkan Lindqvist May 21 '21 at 20:54

1 Answers1

2

@håkan-lindqvist is onto the answer. I don't have a mount.nfs3 but I have a mount.nfs4 and it is just a symlink to mount.nfs. I looked at the source for mount.nfs and it doesn't do anything special based on the basename of argv[0] (except for unmounting). Thus mount -t nfs4 would not specify the version at all. I suspect the same for -t nfs3.

So, to answer your questions: they are not the same thing and -t nfs3 doesn't specify the nfs version.

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47
  • Interesting... makes me wonder why would `-t nfs3` and `-t nfs4` even exist. Perhaps some legacy backwards compatibility? – gmelodie May 21 '21 at 23:26