overlayfs
如何确定要合并的文件夹以及要替换的文件夹?
Tree:
-lower
-dir1
-file1
-upper
-work
-ready
装载命令:
mount -t overlay -o lowerdir=lower,upperdir=upper,workdir=work overlayfs ready
案例1(合并):
cd ready/dir1
echo "newFile">newFile
#New file placed at upper/dir1/newFile.
#Then remount overlayfs, and we see both files in ready dir
案例2(替换):
cd ready
rm dir1 -Rf
mkdir dir1
cd dir1
echo "newFile">newFile
# newFile placed at upper dir also
# Unmount/Remount overlayfs and we see only newFile
答案 0 :(得分:0)
合并或替换取决于" trusted.overlay.opaque" XATTR
getfattr -R -d -m "" upper/
# file: upper//ttt
trusted.overlay.opaque="y"
使用命令setfattr --remove "trusted.overlay.opaque" upper/ttt
删除此xattr