mount --bind
There are a lot of questions about this, but very few adequate answers available on Google. Solaris has a feature called “lofs” that allows you to mount some directory (say /bigvolume/foo) somewhere else (say /bar). The quick response is “duh, symlinks”, but if you want /bar to be read-only, or noexec, or nosuid, or some other uber-secure setting, this allows you to do it. Also, since chroot() breaks symlinks that point outside the new root, this can be used to simplify setting up chroot jails.
Since kernel 2.4, Linux has had support for mount binds (synonymous to Solaris' lofs), and here’s how to do it.
Command to mount /bigvolume/foo under bar:
# mount –bind /bigvolume/foo /bar
If there are other filesystems mounted under /bigvolume/foo, they’ll be ignored. To get them bound also, you’ll need to use –rbind instead of –bind. You can add -o and any options (like noexec, etc.) to the command.
To make this bind occur automagically on reboot, add the following to /etc/fstab:
/bigvolume/foo /bar none bind 0 0
Add any options after “bind” and a comma as you would normally.