I want to mount the following directories using overlayfs:
(lowerdir) /chroot in /merged
(lowerdir) /home in /merged/home
(upperdir) /tmpfs in /merged
...so that the resulting merged directory is a COW system that contains both the /chroot and /home.
I cannot find any way to do that.
1) Trying multiple lower dirs:
mount -t overlay -o lowerdir=/chroot:/home,upperdir=/tmpfs,workdir=/workdir overlay /merged
ls /merged
==> failure, the /home contents merge with the /chroot contents directly in /merged without getting inside a /merged/home subdirectory.
2) Trying bind-mounts:
mount --bind /home /chroot/home
mount -t overlay -o lowerdir=/chroot,upperdir=/tmpfs,workdir=/workdir overlay /merged
ls /merged/home
==> empty, the /chroot/home submount contents do not show up in /merged/home.
Any ideas? Thank you.