Is NFS still broken in FreeBSD?

hw hw at
Fri Aug 9 14:26:07 UTC 2019

Erich Dollansky <freebsd.ed.lists at> writes:

> Hi,
> On Fri, 09 Aug 2019 01:46:27 +0200
> hw <hw at> wrote:
>> Hi,
>> according to [1], NFS in FreeBSD is broken, and I'm wondering if it
>> still is.
>> I need to export some directories rw and some ro with an /etc/exports
>> like this:
>> /b/tftpboot/FreeBSD/install -ro -maproot=root
>> /p/default
>> The "default" directory needs to be exported read-write.  That seems
>> to be impossible with FreeBSD --- if that is really so, NFS is totally
>> broken in FreeBSD.  To make it more strange, it worked as intended
>> until I restarted the server.  NFS v4 doesn't seem to work at all.
>> This has cost me a whole day now :(
>> [1]:
> I alkso learned recently that trusting FreeBSD's handbooks is wrong,
> but it looks to me that in you case, it would have helped.

I looked at the handbook and the manpage all the time, and neither does
help.  Look at the man exports, for example:

  Each line in the file (other than comment lines that begin with a #)
  specifies the mount point(s) and export flags within one local server
  file system or the NFSv4 tree root for one or more hosts.  A long line
  may be split over several lines by ending all but the last line with a
  backslash (`\').  A host may be specified only once for each local
  file or the NFSv4 tree root on the server and there may be only one
  default entry for each server file system that applies to all other
  hosts.  The latter exports the file system to the "world" and should
  be used only when the file system contains public information.

Can you write this more poorly, please?  And what the hell is it
supposed to mean?  Since when is NFS used to export single files?  Why
are hosts somehow being involved?  I thought I'd be exporting to
clients.  Or what do they mean? Then later it says:

  Mount points for a file system may appear on multiple lines each with
  different sets of hosts and export options.

Besides that this might contradict what has been said before, it is
definitely wrong.  If you think it's not you need to show how you can
export, for example, /directory-a read-only and then /directory-b

On top of that, noone expects NFS to only be able to export whole file
systems.  I have used NFS 25 years ago and even then it has been able to
export what you export and not just whole file systems with only a
single set of options.

Nobody expects NFS to be unable to export something with only the same
access permissions for all clients.  It makes NFS useless.  Access
permissions are usually set _per client_ and _per directory (tree)_ that
is being exported.

The handbook doesn't make this any more clear than the bad man page.

Now please show me how you make an NFS export from FreeBSD which you can
mount on Centos 7 using NFS version 4, which is the default for Centos
7.  Version 3 still works, but for how long?

It comes down to that in FreeBSD, NFS is implemented in some
anachronistic[1] and ideosynchratic way, and bad man pages and the handbook
don't help that no matter how long you look at them.  Either of them
could be entirely clear about it.  But NFS needs a major overhaul in
FreeBSD anyway.

[1]: Like the times when hard disks were so small that each node like
     /usr, /home, /var, /etc ... had to be placed on its own file system
     are long gone.

More information about the freebsd-questions mailing list