feat: Set directory attributes (#253)
This commit is contained in:
parent
d1158df77d
commit
636eea9882
1 changed files with 10 additions and 5 deletions
15
src/disk.sh
15
src/disk.sh
|
@ -277,16 +277,21 @@ checkFS () {
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$DISK_FILE" ] ; then
|
local FA=""
|
||||||
FA=$(lsattr "$DISK_FILE")
|
[ -f "$DISK_FILE" ] && FA=$(lsattr "$DISK_FILE")
|
||||||
[[ "$FA" == *"C"* ]] && FA=$(lsattr -d "$DIR")
|
|
||||||
else
|
if [[ "$FA" == "" || "$FA" == *"C"* ]]; then
|
||||||
FA=$(lsattr -d "$DIR")
|
FA=$(lsattr -d "$DIR")
|
||||||
|
if [[ "$FA" != *"C"* ]]; then
|
||||||
|
{ chattr -R +C "$DIR"; } || :
|
||||||
|
FA=$(lsattr -d "$DIR")
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$FA" != *"C"* ]]; then
|
if [[ "$FA" != *"C"* ]]; then
|
||||||
info "Warning: the filesystem of $DIR is ${FS^^}, and COW (copy on write) is not disabled for that folder!"
|
info "Warning: the filesystem of $DIR is ${FS^^}, and COW (copy on write) is not disabled for that folder!"
|
||||||
info "This will negatively affect performance, please empty the folder and disable COW (chattr +C <path>)."
|
info "This will negatively affect performance, please empty the folder and add the LINUX_IMMUTABLE flag"
|
||||||
|
info "to the 'cap_add' section of your compose file, or disable COW manually by executing: chattr +C <path>"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue