Can I merge some separated partitions into one using 'mount --bind'?

From: Tetsuo Handa
Date: Sun Mar 21 2004 - 09:32:08 EST



# Sorry for asking the same question.
# This time, this is a simplified one.

Hello,

I need to use two writable partitions now.

/ a read-only fs
/foo/data a writable fs
/bar/data a writable fs

The root partition needs to be read-only to avoid
tampering.
These writable partitions need to be separated, for
I use 'chroot /foo' and 'chroot /bar'.

But, I want to merge them like this.

/ a read-only fs
/.data a writable fs
/foo/data a mount point to bind with /.data/foo
/bar/data a mount point to bind with /.data/bar

To do so, I use 'mount --bind' like this.

mount --bind /.data/foo /foo/data
mount --bind /.data/bar /bar/data

Now, I want to know whether /foo/data and /bar/data are
separated. That is, a process (whose root is /)
can access /.data/foo by resolving /foo/data, and
can't access /.data/bar by resolving /foo/data/../bar .

Regards...

Tetsuo Handa
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/