Suppose some commands below:
mkdir -p /tmp/rootfs
mkdir -p /tmp/rootfs1
mkdir /mnt
mount -n -t overlayfs -o rw,upperdir=/tmp/rootfs,lowerdir=/tmp/rootfs1 none /mnt
As a result, I can see everything of /rootfs and /mnt/rootfs1 in /mnt. Besides, when I add something in /mnt, I can see them in /tmp/rootfs, but can't see them in /tmp/rootfs1. What's more, if I delete something in /mnt, it would be deleted in all of the directories. I wonder why? I want to know the relationship between /tmp/rootfs, /tmp/rootfs1 and /mnt.
PS: I am not satisfied with the answer here, How do I use OverlayFS?