From 631568681ef7beb157a36b3e3db4097ec36854e0 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 19 Dec 2023 06:01:50 +0100 Subject: [PATCH] feat: Detect COW on BTRFS --- src/install.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/install.sh b/src/install.sh index aa106a4..1190c1c 100644 --- a/src/install.sh +++ b/src/install.sh @@ -55,6 +55,13 @@ FS=$(stat -f -c %T "$STORAGE") if [[ "$FS" == "overlay"* ]]; then info "Warning: the filesystem of $STORAGE is OverlayFS, this usually means it was binded to an invalid path!" fi +if [[ "$FS" == "btrfs"* ]]; then + FA=$(lsattr -d "$STORAGE") + if [[ "$FA" != *"C"* ]]; then + info "Warning: the filesystem of $STORAGE is BTRFS, and COW (copy on write) is not disabled for that folder!" + info "This will negatively affect write performance, please empty the folder and disable COW (chattr +C )." + fi +fi if [[ "$FS" != "fat"* && "$FS" != "vfat"* && "$FS" != "exfat"* && \ "$FS" != "ntfs"* && "$FS" != "fuse"* && "$FS" != "msdos"* ]]; then