Linux – Mount two nfs’s shares from different storage over the same directory on linux

clusterlinuxmountnfs

I have a set of 4 Linux web servers on cluster all of them have the same mount point:

/folder

This /folder is a NFS mount share over a NAS but is full and no more luns/disk are available to expand the NFS. I have another NAS with enough space to solve the problem, but a software developed in house search for JPG files over the /folder. I want to know if is possible to mount another NFS share from the other NAS to the same directory to have more space? No matter that the new path to write files is /folder/newshare.

Best Answer

What you want do do can be achieved precisely with overlayfs. With it you can take your /full dir and another /notfull dir and mount them at /third-dir.

Reads will seek through the /notfull into the /full and writes will go to a third dir.

Have a look at the docs, remount the full dir away from the target name and then use overlayfs to recreate the intended target.

Related Topic