Linux NFS Troubleshooting: Difference between revisions
(12 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
</blockquote> | </blockquote> | ||
= | =List Filesystems Mounted by a NFS Client= | ||
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;"> | <blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;"> | ||
:<tt> | :[[Mount#List_Filesystems_Mounted_by_a_NFS_Client|<tt>mount</tt>: list filesystems mounted by a NFS client]] | ||
</blockquote> | </blockquote> | ||
= | =Useful Commands= | ||
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;"> | <blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;"> | ||
:verbose mount <tt>[[Mount#-v|mount -v]]</tt> | |||
:<tt>[[showmount]]</tt> | |||
:<tt>[[rpcinfo]]</tt> | |||
:<tt>[[exportfs]]</tt> | :<tt>[[exportfs]]</tt> | ||
</blockquote> | </blockquote> | ||
Line 75: | Line 64: | ||
This error means that the NFS client host is not getting a TCP/IP ACK back from the NFS server. | This error means that the NFS client host is not getting a TCP/IP ACK back from the NFS server. | ||
The problem went away after configuring <tt>[[iptables]]</tt> to allow all outbound traffic (see [[Iptables#iptables_Service_Configuration|<tt>iptables Service Configuration]]). | The problem went away after configuring <tt>[[iptables]]</tt> to allow all outbound traffic (see [[Iptables#iptables_Service_Configuration|<tt>iptables</tt> Service Configuration]]). | ||
==<tt>mount(2): Permission denied</tt>== | |||
<tt>mount -v</tt> yields: | |||
<pre> | |||
mount -v -t nfs 192.168.1.4:/volume3/dropbox /mnt/tmp | |||
... | |||
mount.nfs: mount(2): Permission denied | |||
mount.nfs: access denied by server while mounting 192.168.1.4:/volume3/dropbox | |||
</pre> | |||
The error is paired with the following on the server-side: | |||
<pre> | |||
Aug 21 01:35:58 RackStation mountd[11206]: refused mount request from 192.168.1.9 for /volume3/dropbox (/volume3/dropbox): unmatched host | |||
</pre> | |||
The root cause was the fact 192.168.1.9 was not specifically allowed access in the server's [[/etc/exports|<tt>/etc/exports</tt>]]. | |||
==<tt>mount: wrong fs type, bad option, bad superblock on ...</tt>== | |||
mount: wrong fs type, bad option, bad superblock on 192.168.1.4:/volume1/nfstest, | |||
missing codepage or helper program, or other error | |||
(for several filesystems (e.g. nfs, cifs) you might | |||
need a /sbin/mount.<type> helper program) | |||
Usually caused by the fact that the client libraries have not been installed. Fix it by [[Linux_NFS_Installation#Install_Client_Packages|installing client packages]]. | |||
==<tt>fcntl() failed with file ...: No locks available</tt>== | |||
{{Internal|Docker_Storage_Operations#NFS_Volume_Troubles|Docker Storage Operations - NFS Volume Troubles}} |
Latest revision as of 04:02, 21 May 2018
Internal
List Filesystems Exported by a NFS Server
List Filesystems Mounted by a NFS Client
Useful Commands
Failures
mount hangs
I've seen cases when trying to mount a filesystem from other machine hangs if nfs is not started on that machine (service nfs start).
mount.nfs: access denied by server while mounting
I've also seen cases when I get the following error message when not using -t nfs, so use -t nfs:
mount.nfs: access denied by server while mounting f01:/opt/shared
mount(2): No such file or directory
mount -v yields:
mount.nfs: trying text-based options 'bg,vers=4,addr=172.31.20.184,clientaddr=172.31.21.24' mount.nfs: mount(2): No such file or directory ...
I get this because I use the wrong exported path in /etc/fstab.
mount(2): No route to host
mount -v yields:
mount -v -t nfs 192.168.1.2:/volume3/dropbox /mnt/tmp mount.nfs: timeout set for Sun Aug 21 00:44:48 2016 mount.nfs: trying text-based options 'vers=4,addr=192.168.1.2,clientaddr=192.168.1.9' mount.nfs: mount(2): No route to host
This error means that the NFS client host is not getting a TCP/IP ACK back from the NFS server.
The problem went away after configuring iptables to allow all outbound traffic (see iptables Service Configuration).
mount(2): Permission denied
mount -v yields:
mount -v -t nfs 192.168.1.4:/volume3/dropbox /mnt/tmp ... mount.nfs: mount(2): Permission denied mount.nfs: access denied by server while mounting 192.168.1.4:/volume3/dropbox
The error is paired with the following on the server-side:
Aug 21 01:35:58 RackStation mountd[11206]: refused mount request from 192.168.1.9 for /volume3/dropbox (/volume3/dropbox): unmatched host
The root cause was the fact 192.168.1.9 was not specifically allowed access in the server's /etc/exports.
mount: wrong fs type, bad option, bad superblock on ...
mount: wrong fs type, bad option, bad superblock on 192.168.1.4:/volume1/nfstest, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount.<type> helper program)
Usually caused by the fact that the client libraries have not been installed. Fix it by installing client packages.