In case of unix/linux, is there a way to create union of two directories without copying or linking manually everything to a single directory?


One option is to use unionfs

Unionfs: A Stackable Unification File System

This project builds a stackable unification file system, which can appear to merge the contents of several directories (branches), while keeping their physical content separate. Unionfs is useful for unified source tree management, merged contents of split CD-ROM, merged separate software package directories, data grids, and more. Unionfs allows any mix of read-only and read-write branches, as well as insertion and deletion of branches anywhere in the fan-out.

Or another similar option aufs.

  • 1
    Your answer seems much better ! – Antoine Benkemoun Jun 5 '09 at 9:28
  • Having used unionfs to create a read-only filesystem with a read-write RAM FS on top of it, I can say that it's very easy to set up and works with little overhead. – andrewd18 Jun 5 '09 at 13:01

mhddfs is great for making a heap of drives that are transparently linked. It takes some /etc/fstab fiddling, but the solution works great for me


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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