0

I'm reading What is a bind mount?

I tried mount --bind -o ro / /mnt, then I get the folowing two lines in /proc/self/mountinfo:

23 0 0:21 /ARCHLINUX / rw,relatime shared:1 - btrfs /dev/sda rw,space_cache,subvolid=257,subvol=/ARCHLINUX
268 23 0:21 /ARCHLINUX /mnt ro,relatime shared:1 - btrfs /dev/sda rw,space_cache,subvolid=257,subvol=/ARCHLINUX

I can't see anything indicating it's a bind mount, it seems that kernel only treat the mount_id=268 as an individual mount of the device 0:21, it even supports different per-mount options(one is rw and another is ro)!

So is it true that a bind mount is exactly the same as mount the filesystem device twice? I'm using Linux 5.0.

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

0

Only if the propagation mode is "private", if it is "shared" (default on systemd) then any child mount operations will be copied between the mount points.