Please note the new address for this forum : forum.excito.org. The old address redirects here but I don't know for how long. Thanks !
New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

nfs4

Got problems with your B2 or B3? Share and get helped!
jhr
Posts: 7
Joined: 29 May 2011, 07:04

nfs4

Post 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
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: nfs4

Post 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
jhr
Posts: 7
Joined: 29 May 2011, 07:04

Re: nfs4

Post by jhr »

But that doesn't necessarily make it nfs4. Have you tried mount it as such, i.e.

Code: Select all

mount -t nfs4 b3:/data /data
or similar?
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: nfs4

Post by DanielM »

jhr wrote:But that doesn't necessarily make it nfs4. Have you tried mount it as such, i.e.

Code: Select all

mount -t nfs4 b3:/data /data
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
jhr
Posts: 7
Joined: 29 May 2011, 07:04

Re: nfs4

Post 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... :/
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: nfs4

Post 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
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: nfs4

Post 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.
jhr
Posts: 7
Joined: 29 May 2011, 07:04

Re: nfs4

Post 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
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: nfs4

Post 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...
jhr
Posts: 7
Joined: 29 May 2011, 07:04

Re: nfs4

Post 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?
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: nfs4

Post 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
jhr
Posts: 7
Joined: 29 May 2011, 07:04

Re: nfs4

Post 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.
Ancan
Posts: 16
Joined: 17 May 2011, 11:52

Re: nfs4

Post 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.
DanielM
Posts: 637
Joined: 28 Mar 2008, 06:37
Location: Sweden

Re: nfs4

Post 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
Cheeseboy
Posts: 789
Joined: 08 Apr 2007, 12:16

Re: nfs4

Post 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 :oops:

EDIT:
Sorry, that was unfair, I tried a similar recipe I found on the web yesterday, not exactly Ancan's above.
Post Reply