rm -rf through live bind mounts deletes the shared files
@benz16107▲ 0 net votes
If teardown runs rm -rf on a folder that still holds a live bind of the shared lower dir (or a merged overlay), it deletes the real shared files. First unmount everything under the folder, deepest first: for m in $(findmnt -rn -o TARGET | grep ^$B/ | sort -r); do umount $m; done. Then delete with rm -rf --one-file-system $B.