FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 09-12-2012, 02:25 AM
"Kevin O'Gorman"
 
Default Peeking at the contents of a mount point

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?

--
Kevin O'Gorman

programmer, n. an organism that transmutes caffeine into software.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 05:40 AM
Basil Chupin
 
Default Peeking at the contents of a mount point

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?


Would you like to rephrase all of this? :-) .

The "real mount point" is what you have mounted on it already. And I
don't know of any "fake" mount points :-) .


BC

--
Using openSUSE 12.2 x86_64 KDE 4.9.1 & kernel 3.5.3-1 on a system with-
AMD FX 8-core 3.6/4.2GHz processor
16GB PC14900/1866MHz Quad Channel Corsair "Vengeance" RAM
Gigabyte AMD3+ m/board; Gigabyte nVidia GTX550Ti 1GB DDR5 GPU


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 06:18 AM
Nils Kassube
 
Default Peeking at the contents of a mount point

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?

Have a look at the "--bind" option of the mount command. I haven't tried
it myself, but according to the info from the mount man page I would
assume that this is what you're after.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 07:57 AM
Karl Auer
 
Default Peeking at the contents of a mount point

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@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


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 02:53 PM
"Kevin O'Gorman"
 
Default Peeking at the contents of a mount point

On Wed, Sep 12, 2012 at 12:57 AM, Karl Auer <kauer@biplane.com.au> wrote:
> 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.


That's what I thought too, but it does not work. The --bind option
lets me place part of the heirarchy in multiple places, but does not
allow me to expose any underlying mount points.

For example, my home directory is mounted separately so that any
runaway experiments don't use up the disk space of other things, but
if I have root do
mount --bind /home/kevin /mnt
ls /mnt
I see the same thing as if I just did
ls /home/kevin

--
Kevin O'Gorman

programmer, n. an organism that transmutes caffeine into software.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 03:44 PM
Patrick Asselman
 
Default Peeking at the contents of a mount point

On 2012-09-12 16:53, Kevin O'Gorman wrote:
On Wed, Sep 12, 2012 at 12:57 AM, Karl Auer <kauer@biplane.com.au>
wrote:

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.



That's what I thought too, but it does not work. The --bind option
lets me place part of the heirarchy in multiple places, but does not
allow me to expose any underlying mount points.

For example, my home directory is mounted separately so that any
runaway experiments don't use up the disk space of other things, but
if I have root do
mount --bind /home/kevin /mnt
ls /mnt
I see the same thing as if I just did
ls /home/kevin



If you had files in /mnt and they are hidden due to something mounted
on /mnt then doing

mount --bind / /all
should show the original files under /all/mnt/

Best regards,
Patrick Asselman

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 04:01 PM
Karl Auer
 
Default Peeking at the contents of a mount point

On Wed, 2012-09-12 at 07:53 -0700, Kevin O'Gorman wrote:
> > 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.
>
>
> That's what I thought too, but it does not work. The --bind option
> lets me place part of the heirarchy in multiple places, but does not
> allow me to expose any underlying mount points.

You forced me to go check. As I stated it, I was indeed wrong. I should
have expressed myself more carefully. If you use --bind to "alias" a
directory, then the contents of that directory remain available under
the alias, even if the directory is later used as the mountpoint for
another filesystem.

That is, you can "protect" the contents of a directory so that they
remain accessible, but you have to do it before the directory is used as
a mountpoint:

kauer@karl:~$ ls /mnt
kauer@karl:~$ mkdir fred
kauer@karl:~$ touch fred/blah
kauer@karl:~$ ls fred
blah
kauer@karl:~$ sudo mount --bind /home/kauer/fred /mnt
kauer@karl:~$ ls /mnt
blah
kauer@karl:~$ sudo mount -o loop ubuntu.iso /home/kauer/fred
mount: warning: /home/kauer/fred seems to be mounted read-only.
kauer@karl:~$ ls fred
autorun.inf dists md5sum.txt preseed usb-creator.exe
boot install pics README.diskdefines wubi.exe
casper isolinux pool ubuntu
kauer@karl:~$ ls /mnt
blah

Regards, K.




> For example, my home directory is mounted separately so that any
> runaway experiments don't use up the disk space of other things, but
> if I have root do
> mount --bind /home/kevin /mnt
> ls /mnt
> I see the same thing as if I just did
> ls /home/kevin
>
> --
> Kevin O'Gorman
>
> programmer, n. an organism that transmutes caffeine into software.
>

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@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


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-12-2012, 04:11 PM
Karl Auer
 
Default Peeking at the contents of a mount point

On Wed, 2012-09-12 at 17:44 +0200, Patrick Asselman wrote:
> If you had files in /mnt and they are hidden due to something mounted
> on /mnt then doing
> mount --bind / /all
> should show the original files under /all/mnt/

Oh, very good! It does too! Nice one.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@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


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-13-2012, 04:24 AM
"Kevin O'Gorman"
 
Default Peeking at the contents of a mount point

On Wed, Sep 12, 2012 at 9:11 AM, Karl Auer <kauer@biplane.com.au> wrote:
> On Wed, 2012-09-12 at 17:44 +0200, Patrick Asselman wrote:
>> If you had files in /mnt and they are hidden due to something mounted
>> on /mnt then doing
>> mount --bind / /all
>> should show the original files under /all/mnt/
>
> Oh, very good! It does too! Nice one.
>
> Regards, K.

Oh! You're right! I tried with fresh directories, and it worked! So
I went back to figure out why I didn't think so at first.

I was trying to peek under /dev, and it seemed to fail because the
hidden stuff looks the same as the fake file system!

--
Kevin O'Gorman

programmer, n. an organism that transmutes caffeine into software.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 09-13-2012, 04:25 AM
"Kevin O'Gorman"
 
Default Peeking at the contents of a mount point

On Wed, Sep 12, 2012 at 8:44 AM, Patrick Asselman <iceblink@seti.nl> wrote:
> On 2012-09-12 16:53, Kevin O'Gorman wrote:
>>
>> On Wed, Sep 12, 2012 at 12:57 AM, Karl Auer <kauer@biplane.com.au> wrote:
>>>
>>> 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.
>>
>>
>>
>> That's what I thought too, but it does not work. The --bind option
>> lets me place part of the heirarchy in multiple places, but does not
>> allow me to expose any underlying mount points.
>>
>> For example, my home directory is mounted separately so that any
>> runaway experiments don't use up the disk space of other things, but
>> if I have root do
>> mount --bind /home/kevin /mnt
>> ls /mnt
>> I see the same thing as if I just did
>> ls /home/kevin
>>
>
> If you had files in /mnt and they are hidden due to something mounted on
> /mnt then doing
> mount --bind / /all
> should show the original files under /all/mnt/
>
> Best regards,
> Patrick Asselman

Does not work for me.
My /mnt is not a mount point for me, but /home is. When I
mkdir /all
mount --bind / /all
ls /all/home
I see the mounted stuff, including the giveaway lost+found

--
Kevin O'Gorman

programmer, n. an organism that transmutes caffeine into software.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 06:51 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org