[CentOS] "Overlay" Filesystem Mounts?

Tue Nov 15 16:44:52 UTC 2011
Tim Nelson <tnelson at rockbochs.com>


Is it possible to mount multiple block devices (or network devices over NFS/CIFS) such that the contents of the mounts appear in one location? For example, lets say I have these shares available:


All three contain a directory called data, with different subdirectories. Typically, these would be mounted like so:

mount \\server1\volume1\ /mnt/s1v1
mount \\server1\volume2\ /mnt/s1v2
mount \\server1\volume3\ /mnt/s1v3

And, each would have a corresponding 'data' dir at those mounts:


However, it is possible to mount all of the shares to one location, such that there is one 'data' dir, with the combined contents of each of the three shares? So, all shares are mounted at /mnt/s1, and the contents of the multiple data dirs appears in one single data dir?

The only time I've seen such functionality is within the XBMC media center application. It allows you to mount multiple network shares, but shows them all in one location as a sort of 'overlay' view. Duplicate directories are shown have their contents merged, but remain intact on the actual shares/filesystem.

Does any of this make sense? Is it possible with CentOS (pref. 6) ?