Subject: Re: nfs - export file
To: None <port-i386@netbsd.org>
From: Alan Barrett <apb@cequrux.com>
List: port-i386
Date: 09/25/2001 16:48:23
On Tue, 25 Sep 2001, dkwok wrote:
> My /etc/exports file :
> 
> /export/client/root  -maproot=root:wheel nfs.client.com.au
> /export/client/swap -maproot=root:wheel nfs.client.com.au
> /export/client/usr    -maproot=usr nfs.client.com.au

As several other people have mentioned, if you try to export multiple
directories on the same filesystem then you have to use the same options
for all of them (for example, they may not have different maproot
options).

NetBSD's nullfs seems to work reliably now, and you can export a nullfs
filesystem via NFS, so you could try something like this:

  * Store the actual data in a staging area that will NOT be directly
    exported, e.g.
	/export-data/client/root
	/export-data/client/usr

  * Set up an empty directory for each mount point that WILL be exported,
    e.g.
	mkdir /exports/client/root
	mkdir /exports/client/usr

  * Set up a nullfs mount for each of the subdirectories that
    you want to export, e.g.
	mount -t null /export-data/client/root /export/client/root
	mount -t null /export-data/client/usr /export/client/usr

  * Now that /export/client/root and /export/client/usr are in
    separate filesystems, you should be able to export them
    separately, with different options.

--apb (Alan Barrett)