2

Is it possible to setup an overlay style FS on Linux where the presence of a directory in the upper dir COMPLETELY overshadows the lower dir?

Lower Layer:

/dir1/fileA
/dir2/fileB

Upper Layer:

/dir1/fileC
/dir3/fileD

Desired Merge/Overlay has no /dir1/fileA:

/dir1/fileC
/dir2/fileB
/dir3/fileD

In my case the lower dir is a periodically synchronized "cold set", a subset of the data is in the upper dir's "hot set". The problem is that if I delete a file from the upperdir, its still present if it was in the lower dir, so deletions require a sync and remount to "take".

Since the upper dir's folders completely alias the lower dir, I would be happy if overlay merges were "shallow", that is, if a directory exists on the upperdir, only its files are present.

1 Answer 1

3

According to documentation, it's supported but there is no global mount option for it – instead you have to set each upper-layer directory as opaque by setting an xattr on it:

setfattr -n trusted.overlay.opaque -v y /upper/dir1
attr -R -s overlay.opaque -V y /upper/dir2

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .