Contact for queries :

Login

  UpComing Live WebEx Workshop Series

Troubleshooting NFS Configuration in Linux

There are three management commands that help with troubleshooting NFS from both the server and client sides:

  • mountstats          Shows information about mounted NFS shares
  • nfsstat                  Shows statistics of exported resources
  • nfsiostat              Shows statistics of NFS mounted shares

First, let’s look at which resources are exported. For this, you can check the /var/lib/nfs/etab file.
Step 1. View exported resources (whether or not they are mounted):

# cat /var/lib/nfs/etab
/home *(ro,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,n
o_subtree_check,secure_locks,acl,anonuid=65534,anongid=65534)
/opt/data
*(rw,sync,wdelay,hide,nocrossmnt,secure,root_squash,no_all_squash,n
o_subtree_check,secure_locks,acl,anonuid=65534,anongid=65534)

Step 2. From the client side, you can use the nfsstat command for similar results.

Syntax: nfsstat [options]
Options:

  • -m   Shows statistics on mounted NFS file systems
  • -n    Shows NFS statistics
  • -v    Provides verbose output

Step 3. To display the exported resources from the client (mounted only), use the following:

# nfsstat -m
/mnt/home from 172.168.1.1:/home
Flags:
rw,relatime,vers=4,rsize=262144,wsize=262144,namlen=255,hard,proto=
tcp,timeo=6
00,retrans=2,sec=sys,clientaddr=172.168.1.10,minorversion=0,addr=17
2.168.1.1
/mnt/data from 172.168.1.1:/opt/data
Flags:
rw,relatime,vers=4,rsize=262144,wsize=262144,namlen=255,hard,proto=
tcp,port=0
,timeo=600,retrans=2,sec=sys,clientaddr=172.168.1.10,minorversion=0,a
ddr=172.16
8.1.1

After clients are connected to the server, you can again use the nfsstat command to get some statistical information.
Step 4. View NFS version 4 stats from connected clients:

# nfsstat
Server rpc stats:
calls badcalls badauth badclnt xdrcall
465 3 3 0 0
Server nfs v4:
null compound
19 4% 446 95%
Server nfs v4 operations:
op0-unused op1-unused op2-future access close commit
0 0% 0 0% 0 0% 39 3% 5 0% 0 0%
create delegpurge delegreturn getattr getfh link
0 0% 0 0% 0 0% 253 24% 55 5% 0 0%
lock lockt locku lookup lookup_root nverify
0 0% 0 0% 0 0% 64 6% 0 0% 0 0%
open openattr open_conf open_dgrd putfh putpubfh
45 4% 0 0% 5 0% 0 0% 403 38% 0 0%
putrootfh read readdir readlink remove rename
30 2% 0 0% 73 6% 0 0% 0 0% 0 0%
renew restorefh savefh secinfo setattr setcltid
0 0% 5 0% 45 4% 0 0% 6 0% 13 1%
setcltidconf verify write rellockowner bc_ctl bind_conn
13 1% 0 0% 0 0% 0 0% 0 0% 0 0%
exchange_id create_ses destroy_ses free_stateid getdirdeleg getdevinfo
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
getdevlist layoutcommit layoutget layoutreturn secinfononam sequence
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
set_ssv test_stateid want_deleg destroy_clid reclaim_comp
0 0% 0 0% 0 0% 0 0% 0 0%
Client rpc stats:
calls retrans authrefrsh
131 0 0

You can also use the nfsiostat command for similar statistics. In addition, if you want some detailed debug information about mounted NFS shares, you can use the mountstats command. This information would
be useful only if you are looking to fine-tune NFS or track down a serious problem, though.

November 15, 2015

0 responses on "Troubleshooting NFS Configuration in Linux"

Leave a Message

Your email address will not be published. Required fields are marked *

About iGURKUL

IGURKUL I.T. Training Hub offering various Career Certification courses in Computer Networking, Unix, Linux, Cloud Computing and DevOps Technologies. With its rich experience in IT training service sector, iGURKUL has been able to set Industry best practices in IT Training for the past five years.

In Past five years, more than 5000 professionals have been trained by iGURKUL for System administration, Cloud Computing and DevOps Skill set through our Online Training portal www.unixadminschool.com. And , each day , more than 10000 working professionals from all over the globe visiting our knowledge base www.unixadminschool.com/blog for the best practices and Knowledge learning.

top
copyright protected - 2011 © igurkul I.T. solutions. All rights reserved.