Setup: create proper directories, with a pre-existing dir (called dir
) in lower, and then mount as overlay fs:
$ mkdir upper lower work merged upper lower/dir
$ sudo mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merged
You can now create files in the merged/dir
to force a copy up of lower/dir
to upper/dir
: