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"

There is a systemd unit btrfsmaintenance-refresh.service which gets called when /etc/sysconfig/btrfsmaintenance (via systemd path unit btrfsmaintenance-refresh.path) is changed. This unit automatically refreshes the systemd timers/cron jobs.

The btrfsmaintenance scripts are available in /usr/share/btrfsmaintenance

These can be run manually (e.g. 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