Verify that the directory actually is exported with no_root_squash
:
grep git /proc/fs/nfs/exports
Do you have SELinux enabled on client or server? If so, try disabling it (or set the policy to permissive
), then restart nfsd
and remount the share.
What do your logs (client and server) say about this?
Edit:
Do you see the mounts/exports when you run showmount -a server
and showmount -e server
on the client?
Do you get ready and waiting
responses when running the following three commands on the client?
rpcinfo -T udp server nfs
rpcinfo -T udp server mountd
rpcinfo -T udp server nlockmgr
Edit: Since the problem only occurs when the NFS server goes down AFTER the share has already been successfully mounted, the previous answer does not help.
My only suggestion now is to use autofs
to mount the NFS shares on-demand, instead of mounting them on boot. This way, the system will only attempt to mount the NFS shares when you try to access them, and will automatically unmount them after a period of inactivity.
There is a guide on how to use autofs
available here, but below I will list the steps you should need to follow to get something running.
Make sure autofs
is installed. The package is usually just called 'autofs'
On Ubuntu, you can install it by running apt-get install autofs
as root.
Add the following entry (as root) to /etc/auto.master
/home/Shares /etc/auto.shares
Create the file /etc/auto.shares
(as root), with the following content:
TV_SHOWS -rsize=8192,wsize=8292,timeo=14,intr,rw 192.168.1.200:/mnt/Raid/TV_SHOWS
Movies -rsize=8192,wsize=8292,timeo=14,intr,rw 192.168.1.200:/mnt/Raid/MOVIES
DocuTV -rsize=8192,wsize=8292,timeo=14,intr,rw 192.168.1.200:/mnt/Raid/DocuTV
Remove the static mount points for these directories from /etc/fstab
Reload the autofs service. On Ubuntu, you can run service reload autofs
as root to do this.
Test to make sure it works. Run ls /home/Shares/TV_SHOWS
and see if it lists your files.
Note: Due to additional information added to the question, the following answer no longer applies. I will leave it here, however, in case it helps someone in the future.
You could try adding the nofail
option to the entires in /etc/fstab.
From the mount manpage:
nofail
Do not report errors for this device if it does not exist.
This should cause the system to attempt to mount the device on boot, but give up if it is unable to do so. You can then manually attempt to mount the device later.
There is another option that may be useful: retry
(nfs manpage)
retry=n
The number of minutes that the mount(8) command retries an NFS mount
operation in the foreground or background before giving up. If this
option is not specified, the default value for foreground mounts is 2
minutes, and the default value for background mounts is 10000 minutes
(80 minutes shy of one week). If a value of zero is specified, the
mount(8) command exits immediately after the first failure.
By default, NFS mounts are foreground mounts, and thus should fail after 2 minutes of attempts. You could always manually set this to a certain amount of time to cause it to fail more quickly if the NFS server is unavailable, which combined with the nofail
option, could get it to work as you want.
Best Answer
This is a bug that has been fixed in dpkg 1.10.21 (i.e. instead of dying with a fatal error a warning is emitted, since this configuration file is optional). If you can't fix the permission error, upgrading dpkg should mitigate the issue. Since you'll need to run dpkg to upgrade itself you might need to unmount the nfs home for that.