Linux – How to Union Multiple Mounts to a Single Point with Read/Write Access

filesystemslinuxoverlayfsunionfs

I've got over 1,000 directories, spread out over 6 servers. Technically they are home folders. It's guaranteed that there will never be any duplicate folder names.

What I'd like to do is to mount them (NFS or SSHFS) to a 7th server and merge them all together in to a single /home with full visibility to all of the 6 servers, and maintain read write.

In theory this is easy, since each folder belongs to a single server and writes within a folder can go to the server that has the parent folder. Unfortunately it would appear that UnionFS and OverlayFS do not support more than one read/write filesystem.

Are there any ways to do this that I can't think of? I think 1,000 NFS mounts (one for each home directory) would not work terribly well and would be a pain to keep up to date.

Best Answer

Create separate mount points for each server. Create symlinks for the home directory to the directory on the mount point.