Score:0

Can't mount exported directory as NFS version 4

de flag

I'm trying to create a simple NFSv4 export. What I did so far:

My exports file:

/srv/nfs4 <myipnet>/255.255.255.0(rw,sync,fsid=0,no_subtree_check)
/srv/nfs4/homes <myipnet>/255.255.255.0(rw,sync,no_subtree_check)

I also created a bind like it should be done for NFSv4 in fstab:

/home/nfshomes /srv/nfs4/homes none  bind  0 0

Then on my client I added this line to the fstab file:

server.example.org:/srv/nfs4/homes /media/nfshomes nfs rw,nfsvers=4 0 0

The mount works, I can see the files and everything; BUT it's mounted as NFSv3! The output from nfsstat -m:

/media/nfsv4homes from server.example.org:/srv/nfs4/homes
 Flags: rw,relatime,vers=3,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=<ipaddr1>,mountvers=3,mountport=55778,mountproto=udp,local_lock=none,addr=<ipaddr2>

So can you tell me what I did wrong?

Manual mounting doesn't work either:

root@client:/media/nfsv4homes# mount -t nfs –o vers=4 server.example.org:/srv/homes /mnt/nfshomes
mount: bad usage
Try 'mount --help' for more information.

edit: After setting RPCMOUNTDOPTS="--manage-gids --no-nfs-version 3" in the /etc/default/nfs-kernel-server file the mount is not working anymore (or empty). So it seems that the server falls back to NFSv3, which I disabled, hence no exports at all. So why does the server fall back?

Score:0
de flag

Okay the solution is quite simple. The fstab line should be like this:

server.example.org:/homes /media/nfsv4homes nfs4 rw,defaults 0 0

Mounting works too:

mount server.example.org:/homes /mnt/nfshomes
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.