Subject: Re: Problems with union mounting
To: David Brownlee <abs@anim.dreamworks.com>
From: Brian C. Grayson <bgrayson@ece.utexas.edu>
List: netbsd-help
Date: 09/29/1997 11:41:00
David Brownlee wrote:
> 
> On Sat, 27 Sep 1997, William O Ferry wrote:
> 
> > [ -- Union mounting local changes over /usr/src, then adding NFS -- ]
> >
> > If I NFS
> > mount the directories that make up the union mount and try to union
> > mount them together on the PC side, I get "mount_union: Operation not
> > supported".
> > 
> >     Is there some way to get NetBSD to export local mounts, such as
> > union mounts?  Or is there some way to get around mount_union's
> > complaint??
> > 
> 	From the BUGS section of 'mount_union'
> 	     "Without whiteout support from the filesystem backing the
> 	     upper layer, there is no way that delete and rename
> 	     operations on lower layer objects can be done.  An attempt
> 	     to mount a union directory under one which does not have
> 	     whiteout support will return EOPNOTSUPP (``Operation not
> 	     supported'')."
> 	NFS does not support whiteouts :(
> 	Providing you don't need to delete or rename anything in the
> 	union filesystem, it should be possible to make NetBSD allow
> 	union mounts from NFS filesystems, and simply fail on unlink()
> 	or rename() operations.

  Since your concern is in mounting versions of the source tree,
you could use OBJDIR stuff, and thus make your source tree
read-only, right?  If so, mount_union allows NFS mounts.
In other words, mount_union doesn't enforce the check for whiteout
support if the upper layer is mounted readonly.  Would that do
the trick?

  I just verified this (actually, I thought from the above
comment in the man page that it wouldn't work, but it did, and
I UTSL'd to make sure that it did for the right reasons...) by
doing `union_mount -oro' of a copy of my ~/bin (which is via
NFS) on top of ~/foo (which is also via NFS).  It works, even as
a mere user.  Of course, I can't unmount them -- ~/bin is
/home/orac/bgrayson/bin, whereas the _real_ path name is
/a/orac/home/orac/bgrayson/bin.  :|

  Should the man page be updated to mention in the bugs section
or elsewhere that whiteouts are only required for read-write
mounts?  If so, I'll send in a PR.

  Brian
-- 
Brian Grayson (bgrayson@ece.utexas.edu)
Graduate Student, Electrical and Computer Engineering
The University of Texas at Austin
Office:  ENS 406       (512) 471-8011
Finger bgrayson@orac.ece.utexas.edu for PGP key.