Blog/NFS Server Logging

From Forza's ramblings

2020-10-16: NFS Server Logging

Realtek 8029 PCI Ethernet network card
Realtek 8029 PCI Ethernet network card.

Ever wondered how to enable logging on your Linux NFS server? By default there is very few bits of information logged in kernel log/dmesg or in syslog/systemd.

So to enable loggin on the NFS server you would first find out what debug options you have using rpcdebug -vh

# rpcdebug -vh
usage: rpcdebug [-v] [-h] [-m module] [-s flags...|-c flags...]
       set or cancel debug flags.

Module     Valid flags
rpc        xprt call debug nfs auth bind sched trans svcsock svcdsp misc cache all
nfs        vfs dircache lookupcache pagecache proc xdr file root callback client mount fscache pnfs pnfs_ld state all
nfsd       sock fh export svc proc fileop auth repcache xdr lockd all
nlm        svc client clntlock svclock monitor clntsubs svcsubs hostcache xdr all


And to enable enable all debugging options for the NFS server (nfsd) you use the all keyword (warning, gives a lot of output in dmesg)

#  rpcdebug -m nfsd all
nfsd       sock fh export svc proc fileop auth repcache xdr lockd

Stop or remove debugging options:

#  rpcdebug -m nfsd -c all
nfsd      <no flags set>