Web lists-archives.com

A Basic Mount Observation




This Summer will mark 30 years since I first laid hands on a
unix-like system.  I probably was introduced to unix mount points
very shortly after starting in the unix world which reminded me a
lot of MSDOS except that there aren't nearly as many gotchas and
things worked like one would dream they should work so I was
probably introduced to the concept of the mount point somewhere
in those early days.

	I may just be remembering things the wrong way but it
seems like that for most of my memory, one could be root and, if
you cd'd to a mount point, one could mount /dev/whatever on that
mount point and immediately see the top of the new tree you had
just mounted.  If you cd'd in to that tree and tried to umount,
you got the error that the file system was busy which makes sense
because you are trying to saw off the limb you are sitting on, so
to speak.

	If you cd'd out of the mount point and nobody else was in
it, you could umount and all was well.

	I accidentally discovered now that I can become the root
user, cd to a mount point and mount something with a subsequent
ls of my current directory yielding nothing new.  One doesn't see
the new mount.

	If you open another session and look at the mount point,
the new mount is there.  You can even create a file under the new
mount which is only visible to you if you didn't cd out of the
mount point.  Everybody else who looks at that point will see
what's mounted there and not the test file slipped in under the
mount.

	Has this always been the normal behavior of mount or has
there been a change?

	I see this behavior as being useful like self-modifying
code which is usually a huge thing to avoid but it was kind of
interesting to notice.

Martin McCormick