Everything Else

mount --bind gone insane ?

Code: Select all

mount --bind /proc/ /proc2/


it works

Code: Select all

mount --bind /dev/ /dev2/
mount: wrong fs type, bad option, bad superblock on /dev/,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tailĀ  or so


UAT may be wrong? :shock: ?

I think when the kernel loads it has trouble passing the /dev along and therefore sees no devices.
But I still can't figure out what to do.

Any idea?

(linux 2.6.22)







edit:
oh, and also this this crap o_O

For a long time after bind mounts were introduced, the kernel associated mount options with devices rather than mount points, end of story. When you ran mount --bind, the kernel silently ignored all options since they couldn't be applied just to the bind mount.

Starting with kernel 2.6.26 (or earlier for distributions that patched the upstream kernel), bind mounts have a read-only status that is separate from the original mount. So read-only bind mounts do work. However, the support is not perfect, for example the kernel still ignores options passed to mount --bind. You can make a read-only bind mount by making a bind mount and mounting it read-only. This introduces a security problem in some scenarios (there is a small window of time during which the bind mount is writable).

Debian lenny has a patched 2.6.26 kernel that makes mount --bind -r create a read-only bind mount atomically. Ubuntu 10.04 doesn't include that patch.

The fuse filesystem bindfs generalizes the effect of mount --bind. It supports read-only bind mounts and many other permission and ownership changes. It is not fully equivalent to mount --bind, however. For example, reading from a read-only bind mount never updates the access time of a file, but might for a bindfs -p a-w fuse mount.
Head Full of Snow. Lemon Scented You