Is there a UnionFS configuration that allows me to merge two RW-directories, so that I can read from the higher-priority directory if a requested file exists in there (normal behaviour), but changes to the merged directory are written to both of the branches?

If not, is there a comparable filesystem (e.g. MergerFS, OverlayFS, AUFS etc.) that allows me to do so?

AFAIK none of the "union filesystems" support multiple write targets.

What are you trying to accomplish ultimately?

edit:

Wouldn't it be safer / simpler to use something like rsync? Lots of people already do what you're looking for with rclone mounts or other network filesystems and simply have a regular rsync or rclone sync to the remove storage.

MergerFS' docs include some examples for creating such caches.

https://github.com/trapexit/mergerfs#caching

  • I would like to create a UnionFS mount with a local directory and a directory that's mounted from a remote server. Everything that I'd write to that directory would be on my local drive, but also backed up remotely to that server and I could read either from my local drive, or (after I for example deleted the file due to space limitations on my local drive) from the remote server. It would, in essence, be a very simple file-based cache. – RikuXan Jul 26 '17 at 14:26
  • 1
    First of all, welcome to Super User! We always appreciate the contributions from our community members, but you apparently have two Super User accounts: this one and this one. Please take the time to utilize the following Help Center tutorial and ask the Super User staff to merge your accounts: I accidentally created two accounts; how do I merge them? – Run5k Jul 26 '17 at 16:57
  • I did think about using a separate program to transfer the data and that's probably the way I'm going, but I would have preferred the filesystem to handle it because I want the data to be backed up immediately and doing that with separate program necessitates watching the relevant folders (with e.g. inotifywait) for changes, which I'd prefer not to due to its inconsistency over different (FUSE) mount types. But it seems that I'll go in this direction and hack something together that hopefully works well enough. – RikuXan Jul 27 '17 at 13:18

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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