NFS server /etc/exports bad export line

My machine is FreeBSD 9.2.

My /etc/exports :
Code:
/net/home   -maproot=nobody             saduty sabsd
/net/data    -ro                        saduty sabsd
/net/admin                              saduty
/usr/ports                              saduty sabsd

Then I run:
service mountd start

And it gives:
Code:
mountd[920]: can't change attributes for /net/data:  Invalid radix node head, rn: 0 0xc346ca00
mountd[920]: bad exports list line /net/data -ro                  saduty sabsd
And similar error for then next two line of /etc/exports. So only the first line of /etc/exports has no error.

I've read handbook, and I knew that "In /etc/exports, each line defines the export information for one file system to one or more clients." So I think the problem is, /net/home, /net/data, /net/admin and /usr/ports are in the same file system.

But I don't know what does "in the same file system" mean. How do I know which file system is the file in? Since the directory /net is create by myself with mkdir(), how do I make that in the file system differ from /usr/ports?

Or the problem isn't about file system, what's wrong with my /etc/exports?
 
You need to remember that it is filesystems that get exported, not directories. So if /net/home, /net/data and /net/admin are in the same filesystem (and they probably are) mounted on /net, you will need to combine them into a single line. Something like:
Code:
/net/home /net/data /net/admin -options saduty
/ports                              saduty sabsd
Again, any options are at the filesystem level, not directory level. See the first line of EXAMPLES in exports(5), which exports /usr and /usr/local, which are in the same filesystem.

EDIT: The mount(8) command will show the mounted filesystems at any given point in time.
 
But I can't combine them into a single line. For example:
/net/data is exported to saduty and sabsd with option -ro , and /net/admin is only exported to saduty without option.
How do I combine them?

Or I should make /net/data and /net/admin in different file system?
How to do that?
 
It's been a long time since I've used NFS, so I don't know if there is some clever way to do what you want to do. The best approach is to put them in separate filesystems.

To create a filesystem:

  • 1. Find a disk with available space
    2. Create a new partition
    3. Create a filesystem on the partition
    4. Mount the filesystem
    5. Move all data from (for example) /net/data to /new/mount/point
    6. Repeat for the /net/admin directory
Then you can put each of them: /net/home, /net/data and /net/admin on separate lines in /etc/exports with associated options as required. Also, you'll want to include a line for each new filesystem in /etc/fstab so it gets mounted when the system comes up.
 
Back
Top