0

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.

Nick
  • 287
  • 1
  • 10

3 Answers3

1

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

RalfFriedl
  • 3,008
  • 4
  • 12
  • 17
  • Doh. That solution should have been obvious to me. Symlinks would handle this scenario perfectly, I just need a script to generate them which isn't difficult. – Nick Aug 15 '18 at 04:34
0

I think what you want is a bind mount.

I have a OS drive and a Data drive in my system. My data drive that serves /var and /home, and it's mounted at /mnt/DataDrive.

In order to get it map to /var and /home, I used a bind mount by adding this entry to my fstab. /mnt/DataDrive/var /var none bind 0 0

Here's a good explanation on bind mounts.

  • Hmm so mount the 6 servers /home directories elsewhere (E.g. /home1 to /home6) and bind mount all of the subfolders in to /home. That could work, but I'm not sure how 1,000 bind mounts will go. – Nick Aug 14 '18 at 04:11
0

Centralize the directories into one NFS share. Export that.

Use autofs to automatically mount directories in use. With the use of wildcards, your /home map could look something like

 *         server:/export/home/&

If autofs does not work, consider mounting the entire share at /home in /etc/fstab. So listing of /home is a few thousand directories, but the number of mounts is fewer.

John Mahowald
  • 30,009
  • 1
  • 17
  • 32
  • Autofs is a interesting option, I didn't know about that before. It would probably work however in hindsight regular symlinks would also do the job. – Nick Aug 15 '18 at 04:38