On Sat, Jan 21, 2006 at 07:09:43PM +0200, karl shaul wrote:
>   I have /dev/fd0 both in and out a chroot environment. Obviuosly this is
> on the same hardware. Are there any bad outcomes that could arise and
> how to avoid them? If I chroot and mount a floppy, which /dev/fd0 will be
> used? Can I just issue a chroot command or should I use some 
> preliminaries like mount -t proc chroot-env/proc /proc and why?

I suspect you somehow got it wrong. /dev/fd0 is the same device in both
the chroot and outside of it. There is no difference between trying to
mount it both outside and inside the chroot and trying to mount it twice
outside the chroot. Whether this will work or not depends on several
things, including kernel version and mount options used - e.g. in
certain circumstances you might want to use 'mount --bind'.

mount (usually?) uses /etc/mtab to manage mounted FSs. So if you do not
have them sinced, and the chroot has no /proc, mount won't have any way
to know that /dev/fd0 is already mounted, and will call the mount(2)
systemcall, and get (or won't, see above) an error, but there won't be
any difference in what you can or can't do.

If you want, for some reason, to mount in both, and have a clean single
view of what is mounted, you might consider trying having /etc/mtab a
symlink to /proc/mounts (and have /proc mounted in the chroot). Note
that some things will work less well (e.g. loop mounts won't release the
device on umount IIRC).

But I think the real question is: What are you trying to do? Or: What
are you trying to defend against?
-- 
Didi


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to