Disabling automatic drive maintenance, in favor of manual maintenance, is desired.
Disabling scheduled maintenance
/etc/sysconfig/btrfsmaintenance you can disable balance and scrub by setting the following to "none"
With Leap 15+ and Tumbleweed, there is a systemd unit
btrfsmaintenance-refresh.service which gets called (via systemd path unit
/etc/sysconfig/btrfsmaintenance is changed. This unit automatically refreshes the systemd timers/cron jobs.
As noted in
/etc/sysconfig/btrfsmaintenance, there is also
fstrim.timer, which is not part of btrfsmaintenance. To disable it:
# systemctl disable fstrim.timer # systemctl stop fstrim.timer
If you don't want to use the btrfsmaintenance scripts located at
/usr/share/btrfsmaintenance you can simply uninstall:
zypper rm btrfsmaintenance
To prevent it from being reinstalled:
zypper al btrfsmaintenance
Performing manual maintenance
Using the default openSUSE partitioning, and default btrfsmaintenance settings, btrfs-balance.sh is equivalent to:
btrfs filesystem df / btrfs balance start -dusage=0 / btrfs balance start -v -dusage=5 / btrfs balance start -v -dusage=10 / btrfs balance start -musage=0 / btrfs balance start -v -musage=3 / btrfs filesystem df /
You could add that to a file named "balance" in the
/root/bin directory, and to make it executable you would run:
chmod +x /root/bin/balance
"btrfs scrub is used to scrub a btrfs filesystem, which will read all data and metadata blocks from all devices and verify checksums. It will automatically repair corrupted blocks if there’s a correct copy available."
Without RAID mirroring your data, thereby supplying that "correct copy", the scrub command does nothing other than tell you there is a problem.
With the default settings, btrfs-scrub.sh is equivalent to:
btrfs scrub start -Bd /
This will "trim all mounted filesystems mentioned in
/etc/fstab on devices that support the discard operation".