disable scheduled btrfs balancings in favour of {dynamic,periodic} reclaim

This commit is contained in:
Aminda Suomalainen 2026-04-01 13:27:03 +03:00
parent dd926c736f
commit c20413a0ae
Signed by: Mikaela
GPG Key ID: 99392F62BAE30723
5 changed files with 12 additions and 13 deletions

View File

@ -1,5 +1,5 @@
[Service]
# https://superuser.com/a/1290109
# Contained in `systemd-path search-binaries-default`
ExecStartPre=-btrfs balance start -dusage=25 -dlimit=10 -musage=25 -mlimit=10 /
ExecStartPost=-btrfs balance start -dusage=50 /
#ExecStartPre=-btrfs balance start -dusage=25 -dlimit=10 -musage=25 -mlimit=10 /
#ExecStartPost=-btrfs balance start -dusage=50 /

View File

@ -5,5 +5,5 @@ ExecStart=
ExecStart=-duperemove -rdhq --io-threads=1 --cpu-threads=1 --hashfile=/root/var.hash /var
ExecStartPre=
# Same filesystem although different subvolume, so this should work?
ExecStartPre=-btrfs balance start -dusage=25 -dlimit=10 -musage=25 -mlimit=10 /var
ExecStartPost=-btrfs balance start -dusage=50 /var
#ExecStartPre=-btrfs balance start -dusage=25 -dlimit=10 -musage=25 -mlimit=10 /var
#ExecStartPost=-btrfs balance start -dusage=50 /var

View File

@ -13,8 +13,8 @@ ExecStartPre=-systemctl enable --now aminda-nocron-reboot.timer
ExecStartPre=-systemctl enable --now aminda-duperemove.service
ExecStartPre=-systemctl enable --now aminda-duperemove.timer
# Careless sysadmin workaround. No autostarting service, only timer
ExecStartPre=-systemctl disable monthly-btrfs-balance.service
ExecStartPre=-systemctl enable --now monthly-btrfs-balance.timer
#ExecStartPre=-systemctl disable monthly-btrfs-balance.service
#ExecStartPre=-systemctl enable --now monthly-btrfs-balance.timer
ExecStartPre=-sysctl net.ipv6.conf.all.disable_ipv6=0
ExecStartPre=-systemctl enable --now tlp
ExecStart=-systemctl --global enable systemd-tmpfiles-clean.timer systemd-tmpfiles-setup.service

13
install
View File

@ -266,7 +266,7 @@ if [ "$(id -u)" == "0" ]; then
cp -v etc/systemd/system/app.slice.d/90-cpuquota.conf /etc/systemd/system/app.slice.d/90-cpuquota.conf
mkdir -vp /etc/systemd/{coredump,login,oomd,journald,resolved,system,timesyncd}.conf.d/
cp -v etc/systemd/oomd.conf.d/20-oomd.conf /etc/systemd/oomd.conf.d/20-oomd.conf
mkdir -vp /etc/systemd/system/{aminda-duperemove,aminda-nocron-reboot,ssh,sshd,sshguard,systemd-resolved,systemd-networkd,monthly-btrfs-balance,NetworkManager,iwd,unbound,tor,oidentd,yggdrasil}.service.d/
mkdir -vp /etc/systemd/system/{aminda-duperemove,aminda-nocron-reboot,ssh,sshd,sshguard,systemd-resolved,systemd-networkd,NetworkManager,iwd,unbound,tor,oidentd,yggdrasil}.service.d/
mkdir -vp /etc/systemd/system/{ssh,sshd,oidentd}.socket.d/
# SECURITY WARNING!
cp -v etc/systemd/system/service.d/rngd-wanted.conf /etc/systemd/system/service.d/
@ -327,11 +327,10 @@ if [ "$(id -u)" == "0" ]; then
fi
# This is now how I assume Kinoite
if [ -f /usr/etc/rpm-ostreed.conf ]; then
cp -v etc/systemd/system/{aminda-duperemove,monthly-btrfs-balance}.service /etc/systemd/system/
cp -v etc/systemd/system/{aminda-duperemove,monthly-btrfs-balance}.timer /etc/systemd/system/
# As we are Kinoite/Atomic and known to use BTRFS
cp -v etc/systemd/system/aminda-duperemove.service.d/{90-btrfs-balance,91-fedora-atomic}.conf /etc/systemd/system/aminda-duperemove.service.d/
cp -v etc/systemd/system/monthly-btrfs-balance.service.d/fedora-atomic.conf /etc/systemd/system/monthly-btrfs-balance.service.d/
cp -v etc/systemd/system/aminda-duperemove.service /etc/systemd/system/
cp -v etc/systemd/system/aminda-duperemove.timer /etc/systemd/system/
cp -v etc/systemd/system/aminda-duperemove.service.d/{91-fedora-atomic}.conf /etc/systemd/system/aminda-duperemove.service.d/
#cp -v etc/systemd/system/monthly-btrfs-balance.service.d/fedora-atomic.conf /etc/systemd/system/monthly-btrfs-balance.service.d/
fi
if hash systemctl 2> /dev/null; then
@ -367,7 +366,7 @@ if [ "$(id -u)" == "0" ]; then
fi
if [ -f /usr/etc/rpm-ostreed.conf ]; then
(systemctl enable {aminda-duperemove,monthly-btrfs-balance}.timer &)
(systemctl enable aminda-duperemove.timer &)
fi
fi