Only disable CoW for ~/.jriver

This commit is contained in:
2025-06-02 18:50:05 -04:00
parent 96d6044c85
commit 82b31361d4

View File

@@ -1536,17 +1536,15 @@ service_jriver-createrepo() {
# @description Detects if MC is installed on btrfs and disables CoW # @description Detects if MC is installed on btrfs and disables CoW
disable_btrfs_cow() { disable_btrfs_cow() {
debug "${FUNCNAME[0]}()" debug "${FUNCNAME[0]}()"
local dir
local mc_user_path="$HOME/.jriver" local mc_user_path="$HOME/.jriver"
[[ -d "$mc_user_path" ]] || execute mkdir -p "$mc_user_path"
for dir in "$MC_ROOT" "$mc_user_path"; do # Disable btrfs CoW
[[ -d $mc_user_path ]] || execute mkdir -p "$mc_user_path" if [[ $(stat -f -c %T "$mc_user_path") == "btrfs" ]]; then
if [[ $(stat -f -c %T "$dir") == "btrfs" ]] && if execute chattr +C "$mc_user_path"; then
! lsattr -d "$dir" | cut -f1 -d" " | grep -q C && echo "Disabled btrfs CoW for $mc_user_path directory"
execute sudo chattr +C "$dir"; then fi
echo "Disabled btrfs CoW for $dir directory"
fi fi
done
} }
# @description Completely uninstalls MC, services, and firewall rules # @description Completely uninstalls MC, services, and firewall rules