[comp.unix.questions] Files hidden by NFS mounts

ir@cel.co.uk (ian reid) (12/06/90)

Suppose you have a local directory on local machine /usr/me, and that this
directory has files in it.  Now what happens to these files if /usr/me
is used as a mount point for a remote file system.

That is if you unmount the remote file system are the files that were in the 
local directory /usr/me guaranteed to be as they were before.

I am primarily interested in this for ISC 2.2 on a 386 box, when using NFS,
but any discussion for other flavours would be welcome.  RTFM's accepted.
-- 
Ian Reid 					#include <std/disclaimer.h>
UUCP: ir@cel.uucp or ir@cel.co.uk or    ...!{ukc,mcsun,uunet}!cel!ir
"Computers..proof positive that no-one yet understands how to describe any real
 world situation in 0's and 1's."

n8743196@unicorn.cc.wwu.edu (Jeff Wandling) (12/07/90)

ir@cel.co.uk (ian reid) writes:


>Suppose you have a local directory on local machine /usr/me, and that this
>directory has files in it.  Now what happens to these files if /usr/me
>is used as a mount point for a remote file system.

>That is if you unmount the remote file system are the files that were in the 
>local directory /usr/me guaranteed to be as they were before.

>I am primarily interested in this for ISC 2.2 on a 386 box, when using NFS,
>but any discussion for other flavours would be welcome.  RTFM's accepted.
>-- 

On the RS-6000 model 520 we had, it worked the way you described. Files
that were in directory /usr/me remained there. This is something I'd
expect on other machines. Again, any comment?
 
-- 
jeff wandling | western washington university | inet: jeff@arthur.cs.wwu.edu
cs ugrad      | bellingham, wa 98225 USA      |  n8743196@unicorn.cc.wwu.edu

gwyn@smoke.brl.mil (Doug Gwyn) (12/08/90)

In article <7453@suns302.cel.co.uk> ir@cel.co.uk (ian reid) writes:
>That is if you unmount the remote file system are the files that were in the 
>local directory /usr/me guaranteed to be as they were before.

Well, that's SUPPOSED to be the standard UNIX semantics for "mount"ing.
Who knows what problems you might encounter in reality.  We uncover
NFS deficiencies almost daily.

geoff@dragon.ism.isc.com (Geoffrey Kimbrough) (12/08/90)

In article <7453@suns302.cel.co.uk> ir@cel.co.uk (ian reid) writes:
>
>Suppose you have a local directory on local machine /usr/me, and that this
>directory has files in it.  Now what happens to these files if /usr/me
>is used as a mount point for a remote file system.
	Nothing at all happens to them, except that you can't access them
	until you unmount the filesystem "covering" them.  This is precisely 
	the same thing that would happen if you used /usr/me as a mount point
	for a local filesystem.
>That is if you unmount the remote file system are the files that were in the 
>local directory /usr/me guaranteed to be as they were before.
	Yes, but "Guaranteed" is a strong word.  What gets interesting is that 
	the semantics of NFS don't allow you to cross more than one mount point.
	In the above case, suppose some other machine had your /usr mounted.
	Then users on that system (which could include yourself through rlogin)
	would see the *original* contents of your /usr/me directory, while users
	on your machine could not.  Endless opportunity for practical jokes.
>but any discussion for other flavours would be welcome.  RTFM's accepted.
	Ok, RTFM 8^). I don't know what volume though. I'm pretty sure that any
	flavor that did not behave as above should not be called a UNIX OS.
	The rationale for this restriction is to prevent circular topography,
	like if machine foo mounted bar:/usr/bin on /usr and machine bar
	mounted foo:/usr/bin on /usr.  Now think about letting college students
	do this 8^).  (BTW, RFS works pretty much the same way.)

Geoffrey Kimbrough -- Senior System Therapist
INTERACTIVE Systems Corporation -- A Kodak Company
I think machines and clocks have secret motives, but then again...
Maybe they're made that way.

wrwalke@prcrs.UUCP (William Walker) (12/19/90)

In article <1990Dec6.223032.18061@unicorn.cc.wwu.edu>, n8743196@unicorn.cc.wwu.edu (Jeff Wandling) writes:
> ir@cel.co.uk (ian reid) writes:
> >Suppose you have a local directory on local machine /usr/me, and that this
> >directory has files in it.  Now what happens to these files if /usr/me
> >is used as a mount point for a remote file system.
> 
> On the RS-6000 model 520 we had, it worked the way you described. Files
> that were in directory /usr/me remained there. This is something I'd
> expect on other machines. Again, any comment?

this happens on both NFS and hfs mounts.

on NFS, it is handy for keeping "necessary" files.  here at prc, we remote
mount the binaries for X11 from a spare uVax fileserver to the HP's.
so to install X safely, i can make /usr/bin/X11, copy xterm and xdm into it,
and then mount the NFS prcmvii:/usr/prc/X11/usr.bin-HP-7.0 on /usr/bin/X11.
if i lose a fileserver, xterm and xdm will still be available for my
xterminal-only users.

on hfs this is especially handy for keeping generics handy on machines where
the root passwd is considered "public" to developers without much SA
knowledge.  it is handy to keep an occasional backup of printcap, 
passwd, group, or any other file you may need.  if the machine gets royally
hosed, you can umount a file system, and copy the generic into place.
doesn't hurt to keep a spare kernel or restore binary around if you have the
space on the root partition.  ever had anyone remove /genvmunix??  it can
happen!

bill.