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: exportfs -v shows the NFS export options the server really uses

Linux
~/tips/tip-nfs-exportfs-verbose

sudo exportfs -v

Prints the active NFS exports with all their options, including defaults you never wrote.

I never trust an /etc/exports file just because it looks right. NFS fills in defaults for everything you do not write, and a typo in the options can change the meaning. exportfs can show the result.

sudo exportfs -v

When it displays the current export list, -v also prints the options of every export. The man page lists the defaults as sync,ro,root_squash,wdelay, and these apply unless an entry in /etc/exports or in a file under /etc/exports.d overrides them. That makes it a quick check on whether rw or no_root_squash really arrived.

After you edit the file, apply it with:

sudo exportfs -ra

That re-exports everything and synchronises the export table with the files, which also removes entries you deleted. Restarting the NFS server does the same, according to the exports man page.

Here is a line in the format the manual shows:

/srv/data  192.0.2.0/24(rw,sync)

The caveat sits in the syntax. The exports man page says no whitespace is permitted between a client and its option list, so 192.0.2.0/24(rw) is one thing and a space before the bracket is something else. This is the main reason to run exportfs -v after every edit. If you want the list in a form you can paste back into /etc/exports, use exportfs -s.

Further reading: exportfs(8) man page, exports(5) 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