It's a known fact that you cannot create hard links for directories.
My question is whether can one use mount --bind dir1 dir2
instead of creating a hardlink of dir1 to dir2? which can't happen
It's a known fact that you cannot create hard links for directories.
My question is whether can one use mount --bind dir1 dir2
instead of creating a hardlink of dir1 to dir2? which can't happen
Yes, with mount --bind you can make the same content (especially directories) appear in the file system twice.
For a very comprehensive article about this please see What is a bind mount? on unix.stackexchange.com
Most important points:
chroot jails.chroot by providing access to the /proc, /sys and /dev file systems (see mount dev, proc, sys in a chroot environment? on superuser.com)Unlike a hard link or symbolic link, a bind mount doesn't affect what is stored on the filesystem. It's a property of the live system.