I have 2 directories:

  • /home/mvanorder
  • /mnt/data/home/mvanorder

I have multiple distros on my computer that I periodically rotate out and install new ones. However for convenience all files that are shared are in /mnt/data/home/mvanorder and then symlinks are created in /home/mvanorder to point to them.

Does anyone know if it's possible to have the OS look for files in /home/mvanorder then if they're not found look in /mnt/data/home/mvanorder. Similar to a mount --bind, but where it would look in the original directory before looking in the bound directory.

1 Answer 1


What you describe can not be done using bind mounts or links. However, you can use overlayfs.

An overlayfs mount will show "a merged filesystem" containing files and directories from both. The upper filesystem takes precedence over the lower filesystem. If file exists in both, the upper filesystem version will be visible, in case of directories they are merged. Writes are made to upper filesystem (files are copied from lower to upper if they do not exist in the upper filesystem).

In your situation, use /home/mvanorder as lower filesystem and /mnt/data/home/mvanorder as upper filesystem.

Note the behavior on deletion: changes are always made in the upper filesystem instead of the filesystem(s) where the file exists. A whiteout file is made in upper filesystem when a file is deleted on overlayfs mount. A whiteout file makes the file invisible in the overlayfs mount. When a new directory is created in overlayfs, it is marked opaque. On opaque directories, only the upper filesystem version is used, even if a directory exists in lower filesystem. This means when you delete a directory in overlayfs and then re-create it, only the upper version is visible.

Exact details about overlayfs are explained in the documentation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .