I am using SUSE 11.2. And I am really baffled with a strange NFS problem. I hope some experts can help me here.
I have set up the fstab on the client and exports on the server correctly, because if I manually run
/etc/init.d/nfs start
Starting NFS client services: sm-notify done
I can see and use the NFS partition perfectly, there is no problem at all.
But nfs cannot successfully start at boot. In yast, I have enabled nfs in “System Services (Runlevel)” at runlevel 3 and 5. So it should run automatically, but I always get the following error message:
/var/log/message:
Apr 10 20:07:56 hubble kernel: 33.654768] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
Apr 10 20:07:56 hubble rpc.statd[2262]: Version 1.1.3 Starting
Apr 10 20:07:56 hubble rpc.statd[2262]: Flags:
Apr 10 20:07:56 hubble rpc.statd[2262]: statd running as root. chown /var/lib/nfs/sm to choose different user
Apr 10 20:07:56 hubble kernel: 33.802662] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
Apr 10 20:07:56 hubble kernel: 33.806946] NFSD: starting 90-second grace period
Apr 10 20:07:56 hubble sm-notify[2271]: Already notifying clients; Exiting!
PS: There are two services: nfsserver, which is for NFS exports (server) and where those messages you reported come from, and nfs, which is for NFS imports (client). Make sure you have enabled the right one(s).
/etc/init.d/nfsserver status
/etc/init.d/nfs status
It’s still not clear to me whether you are running your machine as a server or a client, or both. If as a client, you have not specified any imports in /etc/fstab.
I am running my machine as both a server and a client. I do have proper imports from /etc/fstab, otherwise the manual nfs start would not work. Thanks.
I seem to recall the NFS client is rather fiddly to get to work at boot, seems to need to be run at the right sequence point or need a delay after something, not sure what. I decided a while back the way to do it is using autofs which has the advantage of unmounting the NFS after inactivity. Also works with NM, provided the NFS is only used by users not system processes. So that’s the solution I’ve adopted.
I used yast2 to make the fstab entry instead of doing it manually. Someone suggested that in newer version of SUSE fstab entry has to be added with yast’s “NSF client”.
There is a suggestion in /etc/init.d/nfs that if run too soon after the network comes up, it may not work. I have added some delays in nfs script:
if test "$nfs" = yes ; then
sleep 9 && mount -at nfs,nfs4 > /dev/null 2>&1
sleep 9
mount -at nfs,nfs4 > /dev/null 2>&1
fi
I tried both and NFS will still not mount at boot. My IP is manually set, not DHCP.
So I really don’t understand why it still does not work.
In the client’s fstab, replace the server’s hostname by it’s IP. I have an NFS/NIS combo running at home and at some networks I manage, don’t have the booting problem. Just to make sure, here’s the lines from /etc/exports and from /etc/fstab from server and client.
Server: