Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: how to get at the files "under" a mount point?

18 views
Skip to first unread message
Message has been deleted

Kenny McCormack

unread,
Jun 2, 2009, 9:43:58 AM6/2/09
to
In article <875BD6K83996...@reece.net.au>,
Bob F Nord <b...@example.com> wrote:
>Is there any way to see what's in the /tmp directory (for
>example) on the / filesystem while another filesystem (tmpfs in
>this case) is mounted on /tmp?
>
>Or do I have to change fstab, reboot, poke around in there,
>change fstab back, and reboot, in order to do this?

man umount

jellybean stonerfish

unread,
Jun 2, 2009, 9:45:21 AM6/2/09
to
On Tue, 02 Jun 2009 13:41:35 +0000, Bob F Nord wrote:

> Is there any way to see what's in the /tmp directory (for example) on
> the / filesystem while another filesystem (tmpfs in this case) is
> mounted on /tmp?
>
> Or do I have to change fstab, reboot, poke around in there, change fstab
> back, and reboot, in order to do this?

Have you tried as root.

umount /tmp

ls /tmp

Message has been deleted

Kenny McCormack

unread,
Jun 2, 2009, 11:58:13 AM6/2/09
to
In article <INOU31VP3996...@reece.net.au>,

Bob F Nord <b...@example.com> wrote:
>You can't umount /tmp on a running system, can you?

Probably not - although I can certainly imagine (and could easily setup)
a system on which you could.

Anyway, I was satirizing people who give those kinds of answers, which
are almost always as useless as mine was.

Message has been deleted

Stephane CHAZELAS

unread,
Jun 2, 2009, 12:08:37 PM6/2/09
to
2009-06-2, 13:41(-00), Bob F Nord:

> Is there any way to see what's in the /tmp directory (for
> example) on the / filesystem while another filesystem (tmpfs in
> this case) is mounted on /tmp?
>
> Or do I have to change fstab, reboot, poke around in there,
> change fstab back, and reboot, in order to do this?
[...]

On Linux, you can do:

mount --bind / /somewhere

Then the /somewhere/tmp will not have any FS mounted on it.

--
Stᅵphane

Message has been deleted

Keith Keller

unread,
Jun 2, 2009, 7:17:22 PM6/2/09
to
On 2009-06-02, Bob F Nord <b...@example.com> wrote:

> jellybean stonerfish <stone...@geocities.com> wrote:
>
>> On Tue, 02 Jun 2009 13:41:35 +0000, Bob F Nord wrote:
>>
>> > Is there any way to see what's in the /tmp directory (for example) on
>> > the / filesystem while another filesystem (tmpfs in this case) is
>> > mounted on /tmp?
>>
>> Have you tried as root.
>>
>> umount /tmp
>>
>> ls /tmp
>
> I don't think you can umount /tmp on a running system because
> there are open files on it.

You can (usually) if you are in runlevel 1, unless you've explicitly
started a program that opens files in /tmp. But Stephane's solution is
much more elegant!

--keith


--
kkeller...@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information

jellybean stonerfish

unread,
Jun 2, 2009, 10:55:30 PM6/2/09
to
On Tue, 02 Jun 2009 16:08:37 +0000, Stephane CHAZELAS wrote:

> On Linux, you can do:
>
> mount --bind / /somewhere
>
> Then the /somewhere/tmp will not have any FS mounted on it.

Just when I started to think I had a clue, I tried

mount --bind / /mnt/new/

And I get some interesting results. I guess I have a bit of learning to
do.

ls /var
backups crash lib lock lost+found opt spool
cache games local log mail run tmp

ls /mnt/new/var
lock run


Marcel Bruinsma

unread,
Jun 3, 2009, 1:17:08 AM6/3/09
to
jellybean stonerfish wrote:

> Just when I started to think I had a clue, I tried
>
> mount --bind / /mnt/new/
>
> And I get some interesting results. I guess I have a bit of learning
> to do.
>
> ls /var
> backups crash lib lock lost+found opt spool
> cache games local log mail run tmp
>
> ls /mnt/new/var
> lock run

When you boot in single user mode (kernel option single) the file
systems listed in /etc/fstab won't be mounted, including /var. You
might, however, need /var/{lock,run} for some commands; if they
wouldn't exist on the root fs, such commands would fail to run.

jellybean stonerfish

unread,
Jun 3, 2009, 2:42:55 AM6/3/09
to

I think I have a clue again... I have /var on a different partition,
so I would need to use "mount --rbind / /mnt/new to be able to access the
stuff on the var partition through /mnt/new/var. I thought the tempfs
mounts "lock" and "run" came through with the --bind option, but on
looking deeper, I see they are just empty folders in /var used to mount
the tempfs mounts.
So I tried "mount --rbind / /mnt/new" Now "ls /mnt/new/var" shows the
same output as "ls /var" The problem is I can't unmount /mnt/new.
"device is busy" Oh well, I am turning it off soon so it doesn't really
matter. But, maybe someone can point out how I can unmount /mnt/new if
it is mounted in this way? For informational reasons only. I don't plan
on doing "mount --bind / /mnt/new" again. Well maybe I will, just to see
if I can unmount it.

stonerfish

0 new messages