public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* _reliable_ way to get the dev for a mount point?
@ 2002-05-06  9:55 Pozsar Balazs
  2002-05-06 17:38 ` Erik Andersen
  0 siblings, 1 reply; 4+ messages in thread
From: Pozsar Balazs @ 2002-05-06  9:55 UTC (permalink / raw)
  To: linux-kernel


Hi all!

I found that in a chrooted environment the /proc/mounts file is
messed up badly. For example, if I do a
 chroot /path/to/somewhere
then in the chrooted environment's proc/mounts file will truncate
the /path/to/somewhere string from those mount point it can, and leaves
the rest as they are. (something like s|/path/to/somewhere|| )
Consequently you will have at least two devices showns as mounted to /.
But it can get worse (i know its extreme), if the directory of the
chrooted environment is overmounted.

For example, here's an output from inside the chroot environment:
# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw 0 0
none /dev devfs rw 0 0
none /proc proc rw 0 0
none /proc/bus/usb usbdevfs rw 0 0
none /root/chroot1/proc proc rw 0 0
/dev/cdrom / iso9660 ro 0 0
none /proc proc rw 0 0
/dev/hda2 / ext3 rw 0 0

As you can see, there are 3 devices shown as mounted to / (in reality,
only 2 in the chrooted env), and you cannot know from this which of these
3 is your real rootdir.


So, my question is there a way to get back the device for a directory,
_reliably_. (I want to know which devices holds the files my process sees
under an arbitrary /path/to/somewhere).

Thanks,
-- 
Balazs Pozsar



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-05-08  5:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-06  9:55 _reliable_ way to get the dev for a mount point? Pozsar Balazs
2002-05-06 17:38 ` Erik Andersen
2002-05-06 18:10   ` Xavier Bestel
2002-05-08 10:28     ` Denis Vlasenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox