[plug] Funky NFS - Subdirectory exports

Adrian Chadd adrian at creative.net.au
Tue Jan 1 19:28:55 WST 2008


Which operating system?

You need to read up a little more on how NFS works and how NFS filehandles
are "discovered". ISTR that there's possible issues throwing in sub-mount exports
as the NFS server has to check each filehandle it not only in the exported FS,
but also under the subdirectory in question, and things like hardlinks make
things confusing.

(ZFS makes this nice - mount points are cheap, so you just create lots of them..)


Adrian

On Tue, Jan 01, 2008, Timothy White wrote:
> I'm trying to fix an issue with a "public" directory.
> I have /home/public which under samba, uses umasks and the like to
> force all files to be owned by public:users.
> Using the following line in exports I can achieve the same thing with NFS.[1]
> 
> /home/public
> *(rw,wdelay,nohide,insecure,root_squash,all_squash,anonuid=1005,anongid=100)
> 
> But, I have /home exported too, and ideally want to be able to just
> mount /home and have /home/public with the above options.
> So.... I have /home with the below line.
> 
> /home
> *(rw,wdelay,nohide,no_root_squash,mountpoint,anonuid=65534,anongid=65534)
> (Getting these lines from exportfs, so that's actually what the NFS
> server is seeing).
> 
> If I mount /home/public into a directory, it works as expected. If I
> mount /home into a directory, /home/public uses the same settings as
> /home instead of the settings I want it to use.
> Short of mounting /home then /home/public on top, does anyone know of
> a way to make this work? (/home/public is just a directory under /home
> on the server, not a mountpoint).
> 
> Thanks
> 
> Tim
> 
> [1] For anyone who plays with this, it can be a little unnerving to
> try setting this up, and mounting the filesystem, and thinking that it
> didn't work, because there are files owned by people other than
> public:users, basically, the all_squash,anon settings don't effect the
> UID/GID's already on the file system. So I have a file owned by
> tim:users in /home/public, and it still shows as tim:users with the
> /home/public mount settings. BUT, when I create a new file under those
> settings, it gets the public:users ownership, as expected. I spent a
> good hour or so before I worked this out!!
> 
> -- 
> Timothy White - Unable to stay still for too long
> Linux Counter user #273956
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au

-- 
- Xenion - http://www.xenion.com.au/ - VPS Hosting - Commercial Squid Support -
- $25/pm entry-level VPSes w/ capped bandwidth charges available in WA -



More information about the plug mailing list