On Fri, Nov 18, 2011 at 12:44:51AM -0300, Gerardo Exequiel Pozzi wrote:
On 11/18/2011 12:22 AM, Dave Reisner wrote:
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. Not exactly. you are mixing things. /run is on another filesystem
When I say rootfs I talk about of a type of filesystem.
Do not confuse, rootfs (an special tmpfs/ramfs is the head, it does not have a name, you can not reference, this implies you can not unmount, bind, move and pivot).
d'oh, right. poor place to test my assumptions. time for sleep, dave. yeah, it all makes sense.
[ramfs /]# mkdir /a [ramfs /]# mount -B /run/initramfs/ /a
works because you are binding a tmpfs. repeat the same with /somedir/lalala, the result is exactly as below....
[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 does not works because you are trying to reference an "unnamed" mountpoint. There is no "source" for such fs.
(oh the joys of the soul-less vacuum that is early userspace)
d
haha :P
-- Gerardo Exequiel Pozzi \cos^2\alpha + \sin^2\alpha = 1