1

From the answer to What is a bind mount?,

It is possible to unmount /some/where, in which case /else/where remains mounted.

I checked the output of mount after performing a bind mount. The relevant lines are:

/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda2 on /mnt/bind type ext4 (rw,relatime,errors=remount-ro,data=ordered)

According to Gilles's comments, a bind mount does not only bind the directories, but the kernel additionally remembers "/dev/foo is mounted on /else/where". This agrees with what I saw in the mount info above.

Also, a bind mount is neither exactly "bind the directory" nor exactly "mount the underlying device again", since bind mounting mounts the device, but not the root structure of the device.

I think a bind mount actually "mounts an inode inside a device to a file" (note: directory is a special file), can anyone tell me if I made it right?

iBug
  • 3,508

0 Answers0