Peeking at the contents of a mount point
Karl Auer
kauer at biplane.com.au
Wed Sep 12 07:57:07 UTC 2012
On Wed, 2012-09-12 at 15:40 +1000, Basil Chupin wrote:
> On 12/09/12 12:25, Kevin O'Gorman wrote:
> > I recall some time ago seeing a command -- a variant or argument to
> > 'mount' I think -- which allowed you to see the real contents of a
> > mount point while something else was still mounted on it.
> > I've looked back through 2 years of postings and can't find it.
> > Anybody have a clue?
>
> The "real mount point" is what you have mounted on it already. And I
> don't know of any "fake" mount points :-) .
A mount point is a directory - like "/". A mount point can contain
files, just like any other directory. If a filesystem is mounted on a
directory that contains files, any files below the mount point are
hidden by the mounted filesystem. If you unmount the filesystem, the
files below the mount point become visible again.
Try it - put a file in (say) /mnt, then mount something on /mnt. The
file you created will "disappear" - to reappear unharmed when you
unmount the filesystem.
You can see the contents of the mountpoint under a mounted filesystem by
binding the mount point to another name:
mount --bind /mnt /mnt_view
... then "ls /mnt_view" should show you the "hidden" files.
This is from memory, so do please test carefully.
Regards, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://www.biplane.com.au/blog
GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687
More information about the ubuntu-users
mailing list