From 9b78e3c571e19b99a6c166dd20ec5feb8a3f2e71 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Sun, 14 Dec 2025 14:22:23 -0500 Subject: [PATCH] Enable btrfs quota to allow space-aware algorithms to work Co-authored-by: Raul Salinas Replaces #3858 Fixes #3850 Fixes #3055 --- install/login/limine-snapper.sh | 5 +++++ migrations/1765739892.sh | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 migrations/1765739892.sh diff --git a/install/login/limine-snapper.sh b/install/login/limine-snapper.sh index e2f14815..61cec691 100644 --- a/install/login/limine-snapper.sh +++ b/install/login/limine-snapper.sh @@ -94,10 +94,15 @@ EOF fi fi + # Enable quota to allow space-aware algorithms to work + sudo btrfs quota enable / + # Tweak default Snapper configs sudo sed -i 's/^TIMELINE_CREATE="yes"/TIMELINE_CREATE="no"/' /etc/snapper/configs/{root,home} sudo sed -i 's/^NUMBER_LIMIT="50"/NUMBER_LIMIT="5"/' /etc/snapper/configs/{root,home} sudo sed -i 's/^NUMBER_LIMIT_IMPORTANT="10"/NUMBER_LIMIT_IMPORTANT="5"/' /etc/snapper/configs/{root,home} + sudo sed -i 's/^SPACE_LIMIT="0.5"/SPACE_LIMIT="0.3"/' /etc/snapper/configs/{root,home} + sudo sed -i 's/^FREE_LIMIT="0.2"/FREE_LIMIT="0.3"/' /etc/snapper/configs/{root,home} chrootable_systemctl_enable limine-snapper-sync.service fi diff --git a/migrations/1765739892.sh b/migrations/1765739892.sh new file mode 100644 index 00000000..845270b3 --- /dev/null +++ b/migrations/1765739892.sh @@ -0,0 +1,7 @@ +if omarchy-cmd-present btrfs && omarchy-cmd-present snapper; then + echo "Adjust snapper space limits & enable btrfs quota" + + sudo sed -i 's/^SPACE_LIMIT="0.5"/SPACE_LIMIT="0.3"/' /etc/snapper/configs/{root,home} 2>/dev/null + sudo sed -i 's/^FREE_LIMIT="0.2"/FREE_LIMIT="0.3"/' /etc/snapper/configs/{root,home} 2>/dev/null + sudo btrfs quota enable / +fi