Page 1 of 2
nfs4
Posted: 29 May 2011, 07:08
by jhr
Hi everyone,
I'm currently setting up the b3 and when trying to use nfs4, I got a 'protocol not supported' at the client. Since I'm pretty sure the client supports nfs4, I'm wondering... has anyone nfs4 running? Was there any need for modofications?
jhr
Re: nfs4
Posted: 29 May 2011, 08:02
by DanielM
jhr wrote:I'm currently setting up the b3 and when trying to use nfs4, I got a 'protocol not supported' at the client. Since I'm pretty sure the client supports nfs4, I'm wondering... has anyone nfs4 running? Was there any need for modofications?
I'm running nfs on my B3. Can't remember exactly what I did to set it up, but I've got the packages nfs-common and nfs-kernel-server installed. I think I just installed them, set up a share in /etc/exports and started the daemon.
/Daniel
Re: nfs4
Posted: 29 May 2011, 08:05
by jhr
But that doesn't necessarily make it nfs4. Have you tried mount it as such, i.e.
or similar?
Re: nfs4
Posted: 29 May 2011, 13:19
by DanielM
jhr wrote:But that doesn't necessarily make it nfs4. Have you tried mount it as such, i.e.
or similar?
Darn. You're very right. I'm apparently using nfs3, when saying explicitly I want nfs4 I also get "Protocol not supported". Guess I need to read up on differences between nfs versions...
/Daniel
Re: nfs4
Posted: 29 May 2011, 13:38
by jhr
DanielM wrote:Darn. You're very right. I'm apparently using nfs3, when saying explicitly I want nfs4 I also get "Protocol not supported". Guess I need to read up on differences between nfs versions...
Well, what I'd like to have is the uid and gid mapping tha's possible with nfs4. If someone knows anything, tell me...
Modifying the kernel might be more problematic... :/
Re: nfs4
Posted: 31 May 2011, 14:53
by Cheeseboy
I'm most likely talking out of my arse here, but I thought version 4 was now the default. It caused my problems when upgrading from Bubba2 to B3.
From b3 /etc/exports:
Code: Select all
# Example for NFSv4:
# /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check)
Trying to mount a NFS share from a much older server on the B3 (that used to work fine on Bubba2), it would always fail until I added the vers=3 option to fstab on the B3:
Code: Select all
popcorn:/opt/sybhttpd/localhost.drives/HARD_DISK/Video /home/storage/mounts/popcorn nfs vers=3,user,rw,async 0 1
Cheers,
Cheeseboy
Re: nfs4
Posted: 31 May 2011, 14:57
by Cheeseboy
from man nfsd:
-N or --no-nfs-version vers
This option can be used to request that rpc.nfsd does not offer certain versions of NFS. The current version of rpc.nfsd can support both NFS version 2,3 and the newer version 4.
Re: nfs4
Posted: 31 May 2011, 15:13
by jhr
And as it turns out, b3 doesn't seem to know about version 4:
Code: Select all
root@b3 [~] # rpcinfo -u localhost nfs 3
program 100003 version 3 ready and waiting
root@b3 [~] # rpcinfo -u localhost nfs 4
rpcinfo: RPC: Program/version mismatch; low version = 2, high version = 3program 100003 version 4 is not available
Re: nfs4
Posted: 31 May 2011, 15:48
by Cheeseboy
Hi again,
I think it is a configuration issue:
Code: Select all
aptitude show nfs-kernel-server
Package: nfs-kernel-server
State: installed
Automatically installed: no
Version: 1:1.2.2-4
......
The NFS kernel server is currently the recommended NFS server for use with Linux, featuring features such as NFSv3 and NFSv4
Perhaps this:
https://help.ubuntu.com/community/NFSv4Howto
Again, I haven't tried this, I'm just a google-monkey at this time...
Re: nfs4
Posted: 31 May 2011, 16:22
by jhr
No, this issue lies deeper. The Debian package starts NFS for version 2, 3, and 4. It omits versions if they're not supported. NFS4 seems not to be supported. The issue may lie anywhere... More hints?
Re: nfs4
Posted: 31 May 2011, 16:24
by Cheeseboy
I was currently reading up, but as you obviously know more than I do in the first place I will give up guessing for you and go back to watching TV

Please let us know if you find the answer.
Cheers,
Cheeseboy
Re: nfs4
Posted: 01 Jun 2011, 03:10
by jhr
Cheeseboy wrote:I was currently reading up, but as you obviously know more than I do in the first place I will give up guessing for you and go back to watching TV

Haha, thanks for your time!
Please let us know if you find the answer.
Will do.
Re: nfs4
Posted: 01 Jun 2011, 07:54
by Ancan
Hope this will help:
There's some completely new things to consider with nfs v4.
First, you'll mount it using mount.nfs4, so the type should be "nfs4" rather than "nfs".
Secondly, the exports need to be reworked on the server side. nfs4 first need to export a "root" directory that you have to set up. You then export sub-directories to this root, which you can bind-mount to different locations in the server file system. Yes, a bit more complicated, I'd say.
So you start with a "dummy" directory holding links to the shared directories. For example
mkdir /nfs4root
That directory should be exported with the option "fsid=0" marking it as a nfs-root
exports:
/nfs4root 10.0.0.0/16(rw,async,no_wdelay,no_root_squash,insecure_locks,fsid=0)
Under the root, you create directories for each of the other paths you'd like to export
mkdir /nfs4root/pr0n
mkdir /nfs4root/moarpr0n
Then you bind-mount the proper directories to these:
mount --bind /data/pr0n /nfs4root/pr0n
mount --bind /data2/moarpr0n /nfs4root/moarpr0n
(The mount should ofc go in the fstab on the server so they're persistent)
These directories also need to go in the exports-file, and exported with the "nohide" option.
exports:
/nfs4root/pr0n 10.0.0.0/16(rw,nohide,async,no_wdelay,no_root_squash,insecure_locks) 0 0
/nfs4root/moarpr0n 10.0.0.0/16(rw,nohide,async,no_wdelay,no_root_squash,insecure_locks) 0 0
To mount them, you omit the root-part of the path. The corresponding entries in fstab would be:
/10.0.0.42:/pr0n /storage/pr0n nfs4 user,rw,async 0 0
/10.0.0.42:/moarpr0n /storage/moarpr0n nfs4 user,rw,async 0 0
Restart the nfsd, and if you're lucky they'll be mountable on the client.
Re: nfs4
Posted: 01 Jun 2011, 08:01
by DanielM
Very much thanks for your good explanation! I'll look into this and see if I succeed in sharing my stuff ass nfs4 instead of nfs3.
But why the h*ck did they make it so complicated?
/Daniel
Re: nfs4
Posted: 01 Jun 2011, 08:08
by Cheeseboy
DO NOT try to remove the directory you idiotically --bind mounted to your home directory just because it doesn't show up under mounts...
That's what I did when I couldn't get it to work the way described above
EDIT:
Sorry, that was unfair, I tried a similar recipe I found on the web yesterday, not exactly Ancan's above.