Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to "bind" one directory to many chrooted places. I know that I can do "mount -o bind", but this requires special processing on startup each time (run the mount).

Is there a way to do it on the filesystem directly? My fs is ext4 and it seems not to support hardlinks to directories. Hardlinking all files inside is not an option too.

Is thee a way to enable hardlinks to directories in ext4? Or any other options are avilable?

share|improve this question

Just add lines to your /etc/fstab:

/path/to/source /path/to/bind/mount/point none defaults,bind 0 0

After doing this, the the bind mount will be performed each time the system boots.

share|improve this answer
I know this, but I asked for "filesystem way". Is there some? – PoltoS Apr 23 '12 at 14:39
Note, that I've 2000 chrooted folders and I don't want to have 2000 mount records in /etc/fstab. While 2000 hardlinks are not a problem. Or may be 2000 mounts are not a problem for Linux kernel? – PoltoS Apr 23 '12 at 14:46

Apart from bizzare exceptions, hardlinks can't be created on directories:

To prevent endless recursion, most modern operating systems don't allow hard links on directories. In addition, hard links on directories would lead to inconsistency on parent directory entries. A notable exception to this is Mac OS X v10.5 (Leopard) and newer, which use hard links on directories for the Time Machine backup mechanism only. Symbolic links and NTFS junction points are generally used instead for this purpose.

This is what symlinks are for.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.