On Fri, Nov 18, 2011 at 12:12:28AM -0300, Gerardo Exequiel Pozzi wrote:
On 11/18/2011 12:03 AM, Dave Reisner wrote:
No, that absolutely _will_ work. Binding arbitrary directories is totally kosher, and I do it fairly frequently. You can even bind mount files, i.e.
echo blah> foo touch bar mount -B foo bar
When you 'cat bar' it will have the same contents as 'foo'. I know, but again, rootfs is the *HEAD* of vfsmount.
[ramfs /]# mkdir a b [ramfs /]# mount --bind a b mount: mounting a on b failed: Invalid argument [ramfs /]# mkdir coco [ramfs /]# mount -t tmpfs coco coco [ramfs /]# cd coco/ [ramfs /coco]# mkdir a b [ramfs /coco]# mount --bind a b [ramfs /coco]#
Ahh, there's the lightbulb. More specifically, directories in the root can't be bind mounted. Seems the inverse doesn't hold true. [ramfs /]# mkdir /a [ramfs /]# mount -B /run/initramfs/ /a [ramfs /]# umount /a [ramfs /]# mount -B /a /run/initramfs/ mount: wrong fs type, bad option, bad superblock on /a, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so (oh the joys of the soul-less vacuum that is early userspace) d