[UFO Chicago] Multiple mounts of the same device.

Jesse Becker jesse_becker@yahoo.com
Fri, 13 Sep 2002 16:14:36 -0700 (PDT)


--- Sean Neakums <sneakums@ufo.chicago.il.us> wrote:
> commence  Jesse Becker quotation:
> It's perfectly safe.  It's the same FS instance,

That's good to hear.  As I mentioned, I've not really
played with this before, and where my files are concerned,
I am *very* cautious.

> > B writes to /var/lib/foo, then who gets to write?
> 
> It's the same file, so both of them "get to write". 
> It'll be exactly as if both programs wrote 
> to /usr/lib/foo or /var/lib/foo.  I assume
> for this example that you have the same FS mounted at
> both /usr and /var.

Fair enough.  You just have to hope that the programs don't
truncate. :-)

> > Furthermore, if you read data, it may be 'correct' for
> > one process, but compeltely wrong for another.
> 
> It's the same file.  So if the programs in question were
> not designed to be able to write to the same file then 
> yes, you will have a mess.

This is actually my bigest concern about this.  While a
conflict isn't likely, when it happens, you're screwed.

> Unless you want getcwd(2) to return correct results,
> which will not happen for all cases when symlinks enter
> the picture.

True.  Some program seem to handle this better, or perhaps
just 'differently', than others.  Shells are a good
example.  Given /var --> /usr/slash/var, 'cd /var; pwd' may
give you either /var or /usr/slash/var -- I've seen both
results.

> Or instead of this last step you could just do
> 
> # mkdir /var
> # mount -o bind /usr/slash/var /var

Sure, but that uses the hitherto unknown 'bind' option to
mount, and I'm cautious with this stuff. :)

--Jesse


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com