man umount
> 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
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.
On Linux, you can do:
mount --bind / /somewhere
Then the /somewhere/tmp will not have any FS mounted on it.
--
Stᅵphane
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
> 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
> 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.
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