SDB:Disable btrfsmaintenance

Jump to: navigation, search


Situation

Disabling the btrfsmaintenance cron jobs, and running the scripts manually, is desired.

Procedure

In /etc/sysconfig/btrfsmaintenance set the following to "none"

## Type:           string(none,daily,weekly,monthly)
## Default:        "weekly"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of periodic balance.
BTRFS_BALANCE_PERIOD="none"
## Type:        string(none,weekly,monthly)
## Default:     "monthly"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of periodic scrub.
BTRFS_SCRUB_PERIOD="none"
## Type:           string(none,daily,weekly,monthly)
## Default:        "none"
## ServiceRestart: btrfsmaintenance-refresh
#
# Frequency of periodic trim. Off by default so it does not collide with
# fstrim.timer . If you do not use the timer, turn it on here. The recommended
# period is 'weekly'.
BTRFS_TRIM_PERIOD="none"

Then run:

# systemctl restart btrfsmaintenance-refresh

That will delete

  • /etc/cron.weekly/btrfs-balance
  • /etc/cron.weekly/btrfs-trim
  • /etc/cron.monthly/btrfs-scrub

The same scripts are available for running manually in /usr/share/btrfsmaintenance

These can be run once a month in the following order:

# sh /usr/share/btrfsmaintenance/btrfs-balance.sh
# sh /usr/share/btrfsmaintenance/btrfs-scrub.sh
# sh /usr/share/btrfsmaintenance/btrfs-trim.sh

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

See also

Related articles

External links