5

The following NFS exports file does not work on FreeBSD 9.0. How should I be specifying that I wish to share with the whole subnet?

mybox# cat /etc/exports 
 /storage/build 10.10.0.0/24(rw,no_root_squash)

Error from syslog:

mountd[1133]: bad exports list line /storage/build 
10.10.0.0/24(rw,no_root_squash)

/etc/rc.conf

rpcbind_enable="YES"
nfs_server_enable="YES"
mountd_flags="-r"

3 Answers 3

2

Your syntax isn't compatible with the FreeBSD implementation. Try this:

/storage/build -maproot=root -network 10.10.0 -mask 255.255.255.0

The -maproot=root option has the same meaning as no_root_squash in more Linux-centric implementations (it maps root on the client side to root on the server side). By default, FreeBSD nfs mounts are read/write, so you don't need to indicate it explicitly. Together, the -network and -mask options here tell the nfs server to allow mount requests from the 10.10.0/24 network. Alternatively, you can use CIDR notation (thanks to @Craig Sanders for pointing it out) and omit the -mask option.

Take a look at the exports manpage on your FreeBSD system. It goes into quite a bit of detail, and has several examples.

4
  • CIDR works according to the man page I linked to: [...] The third case is specified by the flag -network=netname[/prefixlength] and optionally -mask=netmask. might be new to FreeBSD 9.x....dunno.
    – cas
    Sep 26, 2012 at 23:33
  • You're right - CIDR is supported. I'd never spotted that before. I'll edit my answer accordingly. Thanks!
    – D_Bye
    Sep 27, 2012 at 6:29
  • Thanks for the tip. I'll try it out and mark the answer. I am learning that googling for advice with FreeBSD is not the best answer, looking at the manual pages is. There are just too many keywords in common with alternate implementations.
    – JonnyRo
    Sep 28, 2012 at 15:29
  • @JonnyRo - indeed! But it's not all bad - the FreeBSD documentation (handbook and man pages) is generally very good.
    – D_Bye
    Sep 28, 2012 at 15:43
0

There is a documentation available for exporting folders using NFS. You can have a look at this link : http://nixdoc.net/man-pages/hp-ux/man4/exports.4.html . This may be of some help to you .

" File /etc/exports describes the directories that can be exported to NFS clients."

0

That looks like a Linux style /etc/exports. FreeBSD's format is significantly different.

See http://www.freebsd.org/cgi/man.cgi?query=exports&sektion=5

You probably want something like:

/storage/build -network=10.10.0.0/24 -maproot=0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .