The wikis are now using the new authentication system.
If you did not migrate your account yet, visit

SDB:Fix btrfsmaintenance-refresh

Jump to: navigation, search


  1. During boot systemd gets reloaded due to btrfsmaintenance-refresh.service erroneously creating new timers: Adjust state of units.
  2. Partitions already mounted are unmounted again for no apparent reason. This should not occur with new installations. If it does fix unit btrfsmaintenance-refresh.path.

Modification to btrfsmaintenance-refresh.path

Edit the unit by running:

systemctl edit btrfsmaintenance-refresh.path  

Add the following lines and save the edit session:


Check your modifications

erlangen:~ # systemctl cat btrfsmaintenance-refresh.path 
# /usr/lib/systemd/system/btrfsmaintenance-refresh.path
Description=Watch /etc/sysconfig/btrfsmaintenance



# /etc/systemd/system/btrfsmaintenance-refresh.path.d/override.conf

erlangen:~ #  

Check unit files for correct state

Note: btrfsmaintenance-refresh.service is loaded, but inactive while btrfsmaintenance-refresh.path is both loaded and active:

erlangen:~ # systemctl list-units --all btrfsmaintenance-refresh.*
UNIT                             LOAD   ACTIVE   SUB     DESCRIPTION                                             
btrfsmaintenance-refresh.path    loaded active   waiting Watch /etc/default/btrfsmaintenance                     
btrfsmaintenance-refresh.service loaded inactive dead    Update cron periods from /etc/sysconfig/btrfsmaintenance

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

2 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
erlangen:~ # 

Make sure btrfsmaintenance-refresh.service is disabled and btrfsmaintenance-refresh.path enabled. Adjust if necessary:

erlangen:~ # systemctl list-unit-files btrfsmaintenance-refresh.* 
UNIT FILE                        STATE   
btrfsmaintenance-refresh.path    enabled 
btrfsmaintenance-refresh.service disabled

2 unit files listed.
erlangen:~ # 

Verify correct operation during boot

Reboot the machine and view the journal:

erlangen:~ # journalctl -b -u btrfs* -o short-monotonic 
-- Logs begin at Sun 2020-03-29 16:41:11 CEST, end at Tue 2020-04-14 21:16:15 CEST. --
[    4.207500] erlangen systemd[1]: Started Watch /etc/sysconfig/btrfsmaintenance.
[   17.512069] erlangen systemd[1]: Started Balance block groups on a btrfs filesystem.
[   17.512182] erlangen systemd[1]: Started Defragment file data and/or directory metadata.
[   17.512293] erlangen systemd[1]: Started Scrub btrfs filesystem, verify block checksums.
erlangen:~ # 

Note: btrfsmaintenance-refresh.service is not running during boot!