An irritation with Linux's 'mount -t nfs' output

May 6, 2009

The problem with 'mount -t nfs' is that it can't make up its mind about what NFS mount options it lists. Is its purpose to list all of the NFS mount options, or is its purpose to list only user-supplied ones? Right now the answer is some peculiar mixed blend; most of the time it lists only user-supplied options, but sometimes it will also list additional ones.

I care about this because I have programs that parse mount's output to see if we need to remount NFS filesystems to update their mount options. When mount -t nfs starts throwing in random additional options, the code explodes; it always thinks that the state is different and so always does remounts (which has various consequences).

I can deal with this in code, and have, but it's irritatingly inconsistent, especially because the list of sometimes-added mount options changes between different versions of mount. This is clearly going to make system upgrades somewhat more exciting in the future.

(And my code has to be somewhat complicated, because included in the extra options that mount can list are options that we sometimes set ourselves, so I can't just pretend that those mount options don't exist at all.)

Sidebar: what extra NFS mount options get added

The ones that I know of so far are:

  • addr=..., for the IP address of the NFS server; always added.
  • proto=udp, listed on Ubuntu 8.04 if the NFS server only supports NFS over UDP. (This doesn't happen on Ubuntu 6.06.)
Written on 06 May 2009.
« How we periodically scrub our ZFS pools
How to set up your xorg.conf for RandR-based dual-headed systems »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Wed May 6 01:39:14 2009
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.