This has to do with the propagation behavior of the bind mount.

# mount --bind src dest
# findmnt -o+PROPAGATION | grep dest
├─.../dest                   shared

Shared propagation means that mounts and unmounts in any of the mirrors
propagate to the others. To change this:

# mount --make-private dest
# findmnt -o+PROPAGATION | grep dest
├─.../dest                   private
# mount ... src/mnt
# touch src/mnt/foo
# ls src/mnt
foo lost+found
# ls dest/mnt

dest/mnt will have the same contents as before the mount in src.

I think I remember something about the default behavior changing with
the switch to systemd, from private to shared, but I can't remember for
sure. If you're seeing a different behavior than in older, upstart-based
releases of Ubuntu that may be why.

Marking this bug invalid because the kernel's behavior is exactly what's
expected.

** Changed in: linux (Ubuntu)
       Status: Confirmed => Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1574514

Title:
  Strange behaviour with mount --bind

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1574514/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to