Under OS/2 there existed the "Toronto Virtual File System", which allowed multiple directories to be combined into a singe directory. When you accessed an existing file, the virtual file system (VFS) would know where to look for the real file. If you created a new file, it would create that file in one of the specified directories that was designated.

This allowed for combining a directory on HD and one on CD, where all access would go to the CD, unless the accessed file was also on HD or it was changed, then the HD would be used.

I always liked that idea and wish something like this existed under Windows or Linux, but I could not find anything like it. Can anybody help?


You're looking for some kind of union filesystem.

On Linux overlayfs is available out of the box. There's also UnionFS and AUFS. mergerfs which is slightly different, as it will distribute writes across source directories according to configured policy, but I'm mentioning it for the sake of completeness.

Mounting /media/cdrom and ~/work-in-progress as a union directory ~/cdrom-union using overlayfs:

mount -t overlay overlay -o lowerdir=/media/cdrom,upperdir=$HOME/work-in-progress,workdir=$HOME/workdir ~/cdrom-union

I'm using $HOME instead of ~ in the -o argument to make sure the shell resolves paths properly.

~/workdir is a working directory, which overlayfs uses internally for its operation. It must be on the same filesystem as the upperdir according to the arch wiki.

I'm not familiar with the Windows side of things, unfortunately.

  • Thanks, that's pretty fantastic and exactly what I was looking for. Now all that is missing is a solution for Windows!
    – cxxl
    Jan 28 at 12:23

In Linux, you can use hard links, soft links or bind mounts.

In Windows, you can use hard links, soft links, junctions or mount points.

  • Sure, I can do it by hand, but I'm looking for a VFS to do the work for me.
    – cxxl
    Jan 28 at 12:22

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.