I have some nfs shares on a server that are mounted on my workstation, if I reboot the workstation then on startup when mounting the nfs shares the system hangs for a couple of minutes and spits out this message:
Code:
mount server0:/home can't read superblock
But once I get a prompt I can mount the nfs filesystem.
If I shutdown the workstation for five minutes or so then boot up normally the nfs shares mount fine during the boot process.
The server runs FreeBSD 6.0 Release-p6 and I'm using nfs that comes with the system (not the one from ports). The workstation runs arch current.
This is a home network so most of the time there is only one workstation mounting these nfs shares and never more than 3.
The relevant part of /etc/fstab from the workstation goes like this:
Code:
server0:/home /home nfs defaults 0 0
server0:/disk1/music /mnt/music nfs defaults 0 0
server0:/disk1/films /mnt/films nfs defaults 0 0
/etc/exports from the server is:
Code:
/home -maproot=nobody -network 192.168.10.0 -mask 255.255.255.240
/disk1/music /disk1/films \
-maproot=nobody -network 192.168.10.0 -mask 255.255.255.240
I am not running the statd or lockd daemons, on the server but I am running nfsd, rpcbind and mountd. The output of rpcinfo -p from the server is
Code:
program vers proto port service
100000 4 tcp 111 rpcbind
100000 3 tcp 111 rpcbind
100000 2 tcp 111 rpcbind
100000 4 udp 111 rpcbind
100000 3 udp 111 rpcbind
100000 2 udp 111 rpcbind
100000 4 local 111 rpcbind
100000 3 local 111 rpcbind
100000 2 local 111 rpcbind
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100005 1 udp 891 mountd
100005 3 udp 891 mountd
100005 1 tcp 900 mountd
100005 3 tcp 900 mountd
Code:
showmount -e server0
issued from the workstation correctly displays all the nfs shares on the server
On the workstation I made sure the network was initialised and the portmap daemon started before mounting the nfs shares.
When running mountd and rpcbind in debug mode on the server mountd reports mount successful when the workstation tries to mount the first nfs share even though 2 mins later the client says can't read superblock. On the server /var/db/mountdtab reckons the share is mounted even though it isn't. On shutting down the client the appropriate entries are removed from /var/db/mountdtab as I would expect. rpcbind remains silent.
I have tried using nfs version 3 on the client, using tcp instead of udp, I've tried using 1 and 2 for dump and pass respectively in /etc/fstab on the client. I've tried using the IP address of the server rather than it's hostname. There are 3 nfs shares that are mounted and I've tried changing the order in which they are mounted.
I've replaced network cables, cards, and the switch just in case it was some bizarre hardware problem, but the problem persists.
Finally if I shutdown the client and start up again after 30 seconds then mounting the first nfs share takes about a minute but is successful.
Once the nfs shares are mounted they work flawlessly
It seems to me, there is some timeout value, or some thing isn't properly registering when the client shuts down, I've run out of ideas and can't seem to find anything useful in the man pages. If I umount an nfs share from the command line then immediately mount it again it works no problem and with no hesitation.
Rarely when I boot up the client even though it has been turned off for a night ~8 hours mounting the nfs share fails with the same message, I'm hoping its related and fixing one will fix the other.
OK, the actual question: How do I get the nfs shares to mount properly after a reboot of the client?