brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: showmount -e lists the folders an NFS server exports

Linux
~/tips/tip-nfs-showmount-exports

showmount -e server

Shows which folders an NFS server exports and to whom, before you mount anything.

NFS mounts fail with errors that say very little. When a mount gives access denied or No such file or directory, my first question is what the server actually exports. showmount asks it directly.

showmount -e server

The -e option shows the NFS server’s export list. A few related options from the man page:

  • -a lists both the client and the directory it mounted, in host:dir form.
  • -d lists only the directories that some client has mounted.
  • --no-headers drops the descriptive headings, which is easier for scripts.

Compare the path in the output with the one in your mount command, character for character. A typo or a path whose parent is the thing that is exported would explain a refused mount. Then use the same path:

sudo mount -t nfs server:/exported/path /mnt/share

Caveats, and they are in the manual’s BUGS section. showmount works by contacting the server’s MNT service directly. A server that only speaks NFSv4 does not need to advertise its exports that way and may not expose that service, so an empty or failing answer does not prove that nothing is exported. The -a and -d lists are also called unreliable, because the server only knows what clients told it earlier. Treat them as hints. For the options a server really applies, look at exportfs -v on the server itself.

Further reading: showmount(8) man page

Going deeper: Guide: your Unraid cache is full and Docker stopped, how to find out why and fix it

More Linux tips notify-send -r "$id" "Backup" "Done" pgrep -af 'sleep 301' smbstatus -L msmtp --serverinfo --tls --tls-certcheck=off --host=smtp.example.com --port=587 smbclient //server/share -U user -Tc backup.tar "*" All Linux tips (283) All topics

Link