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
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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:
chrootby providing access to the
/devfile 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.