SUSE11 NFSv4 help

Hi all,

I can’t get my OpenSUSE 11 client to mount an NFSv4 directory exported by my OpenSUSE 11 server.

Client (ebisu):

nathan@ebisu:~> tail /etc/fstab -n 1
10.10.10.2:/mnt/bigraid /mnt/raid       nfs4    noauto,soft,rw,user 0 0

nathan@ebisu:/mnt> mount raid
mount.nfs4: mounting 10.10.10.2:/mnt/bigraid failed, reason given by server:
  No such file or directory

Server (ark):

ark:/mnt # showmount -e
Export list for ark:
/mnt/bigraid gss/krb5p,gss/krb5i,gss/krb5,*

ark:/mnt # cat /etc/exports
/mnt/bigraid          *(rw,fsid=0,all_squash,insecure,no_subtree_check,sync)
/mnt/bigraid   gss/krb5(rw,fsid=0,all_squash,insecure,no_subtree_check,sync)
/mnt/bigraid  gss/krb5i(rw,fsid=0,all_squash,insecure,no_subtree_check,sync)
/mnt/bigraid  gss/krb5p(rw,fsid=0,all_squash,insecure,no_subtree_check,sync)


Help greatly appreciated.

Nathan

I don’t use v4, but out of curiosity I did a search. Looks like there are more steps involved for v4. Have you done the below (things may have changed slightly since coming out of factory)?

nfsv4 README.SUSE

To set up NFS4 server/client in openSUSE 11 is very easy. Here’s what I’ve done (hostname setup may not be required, but I have them for extra security in the router, only the specified hosts with specified IPs and MAC addresses can get through):

On the server:

  1. YAST -> Network Service -> Hostnames
  • Add a server host, eg. nfsserver.home 192.168.0.100
  • Add a client host, eg. nfsclient.home 192.168.0.101
  1. YAST -> NFS Server
  • NFS server Start
  • Open port in firewall
  • Enable NFSv4, domain name localdomain
  • Next
  • Add mount directory, eg. /mnt/NFSdata
  • Add host:
    Hostname: eg. nfsclient
    Options: fsid=0,rw,root_squash,sync,no_subtree_check
  • Finish
  1. YAST -> System -> System Services (Runlevel)
  • Make sure nfsserver and portmap are running

On the client:

  1. YAST -> Network Service -> Hostnames
  • Add a server host, eg. nfsserver.home 192.168.0.100
  • Add a client host, eg. nfsclient.home 192.168.0.101
  • Make sure they’re the same you made in the server setup

Now, I use autofs to automount the server folders, as I don’t want to wait forever to login if the server is OFF. It’s up to you, you can either use autofs or fstab. Play with both and see which one suits you more.

  1. Autofs
  • edit /etc/auto.master file:
    /mnt /etc/auto.misc --timeout=60
  • edit /etc/auto.misc file:
    dvd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
    NFSserver -fstype=nfs4,rw,hard,intr,nosuid,nodev,proto=tcp,retry=10,rsize=32768,wsize=32768 nfsserver.home:/
  1. Go to /mnt and create a new folder NFSserver
  2. YAST -> System -> System Services (Runlevel)
  • Make sure nfs, portmap and autofs are running
  1. Restart autofs with /etc/init.d/autofs restart
  2. Go to /mnt/NFSserver and you should see all the server exported folders there

If you want to use fstab and mount on boot, just add this line into fstab and reboot:
nfsserver.home:/ nfs4 rw,hard,intr,nosuid,nodev,proto=tcp,retry=10,rsize=32768,wsize=32768 0 0

There’s also a lot of options you can play around with. Read this as well: Linux Home Server HOWTO - Network File System

Hope it helps.

Still can’t get it working under nfs4. When I set the type option to nfs' it works fine, but nfs4’ causes the directory to be mounted, but it’s empty.

Client:

nathan@ebisu:~> tail /etc/fstab -n 1
ark:/mnt/bigraid    /mnt/raid    nfs4     rw,soft,intr,noauto,user,noatime,exec,async,nosuid,nodev,proto=tcp,retry=10,rsize=32768,wsize=32768 0 0

ebisu:/mnt/raid # tail /var/log/messages
Sep  1 10:41:26 ebisu su: (to root) nathan on /dev/pts/1
Sep  1 10:41:31 ebisu rpc.statd[3576]: Version 1.1.2 Starting
Sep  1 10:41:31 ebisu rpc.statd[3576]: Flags:
Sep  1 10:41:31 ebisu rpc.statd[3576]: statd running as root. chown /var/lib/nfs/sm to choose different user
Sep  1 10:41:31 ebisu rpc.idmapd[2570]: nss_getpwnam: name 'root@homebase' does not map into domain 'localdomain'
Sep  1 10:44:16 ebisu sudo:   nathan : TTY=pts/4 ; PWD=/home/nathan ; USER=root ; COMMAND=/bin/su
Sep  1 10:44:16 ebisu su: (to root) nathan on /dev/pts/4
Sep  1 10:53:35 ebisu rpc.idmapd[2570]: nss_getpwnam: name 'root@homebase' does not map into domain 'localdomain'

Thanks,
Nathan

Have you created a new folder in /mnt: eg. /mnt/raid?

Can you put this exact line in fstab:
ark:/ nfs4 rw,hard,intr,nosuid,nodev,proto=tcp,retry=10,rsize =32768,wsize=32768 0 0

and mount the folder with:
#>mount /mnt/raid

You can change your options later. Some options may even be redundant (TCP, for example, I think NFSv4 uses TCP by default), but I didn’t have a chance to look into this more.

Remember that the NFSv4 server exports the root and you should not specify the server exact mount location, just try the ‘ark:/’.

And if you mount with ‘hard’, you can have long delays if the server is down, looks like this may be a bug: How to use autofs in KDE4? - openSUSE Forums. But mounting with ‘soft’ can cause file corruptions but should not hang your file manager when the server is down. I used to use the ‘soft’ option before, never had any problems, but I don’t want to take any chances, now that I have a lot of data on the server.

Ah, just in case, root can’t access the NFS server because it’s been (I hope) 'root_squash’ed.

Hello, I have a similar problem with nfs4.
Under NFS (v3) I can mount folders succesfully, but my main problem is Openoffice; Openoffice (version 3) cannot handle files well in mounted folders and opens them in read-only. NFSv4 should solve this problem, but I only can see at the client-side the mounted folder, but the folder remains empty. Here an output of de configurations of the server and workstation:

CONFIGS OF SERVER (opensuse 11.0 32 bit):

cat /etc/exports:
##########
/NFS4exports 192.168.x.x(rw,insecure,sync,wdelay,no_subtree_check,no_root_squash,fsid=0)
/NFS4exports/globaldoc 192.168.x.x(rw,insecure,sync,wdelay,no_subtree_check,no_root_squash)
##########

mount
##########
/reserve/mydo on /NFS4exports/globaldoc type none (rw,bind)
##########

cat /etc/idmapd.conf
##########
[General]

Verbosity=0
Pipefs-Directory=/var/lib/nfs/rpc_pipefs
Domain=server_nfs

[Mapping]

Nobody-User=nobody
Nobody-Group=nobody
##########

showmount -e
##########
Export list for server:
/NFS4exports 192.168.x.x
/NFS4exports/globaldoc 192.168.x.x
##########

ls -l /NFS4exports/
##########
total 8
drwxrwxrwx 13 root root 4096 Jan 8 10:21 globaldoc
##########

CONFIGS OF WORKSTATION (opensuse 11.1 64 bit)

cat /etc/fstab
##########
server:/ /home/XXXX/server/ nfs4 auto,rw,nodev,sync,_netdev,proto=tcp,retry=10,rsize=32768,wsize=32768,hard,intr 0 0
##########

cat /etc/idmapd.conf
##########
[General]

Verbosity=0
Pipefs-Directory=/var/lib/nfs/rpc_pipefs
Domain=server_nfs

[Mapping]

Nobody-User=nobody
Nobody-Group=nobody
##########

showmount -e server
##########
Export list for lodey:
/NFS4exports 192.168.x.x
/NFS4exports/globaldoc 192.168.x.x
##########

ls -l /home/XXXX/server/
##########
total 8
drwxrwxrwt 2 root root 4096 Feb 7 16:21 globaldoc
##########

ls -l /home/XXXX/server/globaldoc/
##########
total 0
##########

Anybody having a clue? I think it is something simple, but what?

Thanks already for your attention!

Yoram

to SurplusIquana:

With NFS 4, you have a ‘pseudo root’ at the top of the nfs4 file structure. When you mount with nfs4, you do not specify the server’s true full path to the export, you go with the pseudo root.

More specifically: From your server’s exports file, the root of your nfs4 file system appears to be /mnt/bigraid. So on your client, you would not try to mount server:/mnt/bigraid, you just try to mount server:/.

Similarly, if the server exported /mnt/bigraid, but also had a subdirectory /mnt/bigraid/sub1, and the client wanted to mount /mnt/bigraid/sub1 instead of mounting the parent, the client would mount server:/sub1

One way of looking at it: The client mount command leaves off the absolute path to the nfs4 export area, and acts as through the nfs4 export area is ‘chrooted’ on the server.