Btrfsmaintenance
github.com
What it is
Btrfsmaintenance is a free set of scripts for automating maintenance on Btrfs filesystems. It can run scrub, balance, trim, and defragmentation, with separate settings to enable, disable, and configure each task. Scrub reads filesystem data and metadata to check checksums, which can reveal hardware problems or bit rot; when a good redundant copy exists, it can repair data automatically. Periodic jobs can be scheduled with cron or systemd timers, though only one scheduling method can be active on a system. The project supports widely used distributions, provides installation guidance for Debian-based systems, and describes manual installation for others. On SUSE-based distributions, a zypper plugin can defragment RPM database files after package installation. Settings are designed for a default installation with Btrfs on the root filesystem and can be changed in the sysconfig file. Scrub may create intense read activity, and balance can use substantial read and write resources; task concurrency can be serialized to manage impact. Directory defragmentation does not descend into other mount points, nested subvolumes, or snapshots, which need separate paths listed. It is licensed under GPL-2.0 and available for Linux and self-hosted use.
Spec sheet
- What it does
- Btrfsmaintenance is a collection of scripts that automates recurring scrub, balance, trim and defragmentation tasks for selected Btrfs mountpoints or directories.Read 19 Oct 2026 · github.com
- Purpose
- Btrfsmaintenance is a set of scripts that automates maintenance tasks for btrfs filesystems.Read 4 Oct 2026 · github.com
- Integrations
- A zypper plugin can defragment RPM database files after package installation on SUSE based distributions.Read 4 Oct 2026 · github.com
- License
- The repository identifies the project as licensed under GPL-2.0.Read 4 Oct 2026 · github.com
- API and SDK
- The repository documents shell scripts, systemd units, configuration files and a Python or shell zypper plugin; it does not document a network API or SDK.Read 19 Oct 2026 · github.com
- Arch availability
- Arch packages btrfsmaintenance 0.5.2-3 for the any architecture in its Extra repository and lists btrfs-progs as its dependency.Read 19 Oct 2026 · archlinux.org
- Balancing
- Its balance task reclaims underused Btrfs chunks using usage filters and can help avoid allocation problems caused by fragmented chunk space.Read 19 Oct 2026 · github.com
- Concurrency control
- The BTRFS_ALLOW_CONCURRENCY setting can serialize maintenance jobs to reduce resource contention and task interaction.Read 19 Oct 2026 · github.com
- Configuration
- Configuration values are designed for a default installation with btrfs on the root filesystem and can be adjusted in the documented sysconfig file.Read 4 Oct 2026 · github.com
- Configuration paths
- SUSE and Red Hat derivatives use /etc/sysconfig/btrfsmaintenance, while Debian derivatives use /etc/default/btrfsmaintenance.Read 19 Oct 2026 · github.com
- Defragmentation
- Its defrag task processes configured directories, while a separate zypper plugin defragments RPM database files after package transactions.Read 19 Oct 2026 · github.com
- Defragmentation limit
- Configured directory defragmentation does not descend into other mount points, nested subvolumes, or snapshots; those paths must be listed separately.Read 4 Oct 2026 · github.com
- Dependencies
- Debian packages depend on btrfs-progs and use either systemd or cron for scheduling.Read 19 Oct 2026 · packages.debian.org
- Distribution support
- The project says it supports widely used distributions, provides installation guidance for Debian based systems, and describes manual installation for other systems.Read 4 Oct 2026 · github.com
- Documentation depth
- The project README covers task behavior, tuning, scheduling, installation, distribution paths and snapshot-retention considerations, and release 0.5.1 added a manual page.Read 19 Oct 2026 · github.com
- Fedora availability
- Fedora lists btrfsmaintenance versions for Rawhide and Fedora 43 through 45, with maintainers ngompa and atim.Read 19 Oct 2026 · packages.fedoraproject.org
- Gentoo availability
- Gentoo offers version 0.5.2 and provides a systemd USE flag that selects systemd services and timers instead of cron timers.Read 19 Oct 2026 · packages.gentoo.org
- Independent adoption
- Botmonster Tech gives installation examples for Debian/Ubuntu and Fedora and shows configuration for the package's systemd timers.Read 19 Oct 2026 · botmonster.com
- Independent task configuration
- Scrub, balance, trim and defrag can each be enabled, disabled and configured independently through the project configuration.Read 19 Oct 2026 · github.com
- Installation
- Debian-based systems can use dist-install.sh, while other distributions can use distribution packages or manually install the scripts and service files.Read 19 Oct 2026 · github.com
- Intended audience
- The project describes its goal as helping administer btrfs filesystems and says common scripts and configurations are preferred over distribution specific ones.Read 4 Oct 2026 · github.com
- Latest documented release
- The changelog identifies version 0.5.2 dated 2024-07-04 and records fixes for task startup syntax and sequential RAID5/RAID6 scrubbing.Read 19 Oct 2026 · github.com
- Licence
- The repository is published under GPL-2.0, and Fedora identifies it as GPL-2.0-or-later.Read 19 Oct 2026 · github.com
- Limit: balance workload
- The documentation says balance can have a large read/write impact, needs workspace and may fail with a no-space reason requiring manual inspection.Read 19 Oct 2026 · manpages.ubuntu.com
- Limit: defrag and snapshots
- An Unraid community discussion cautions that broad defragmentation can break copy-on-write deduplication and should generally be targeted, especially when snapshots are used.Read 19 Oct 2026 · forums.unraid.net
- Limit: older kernel quota performance
- The Ubuntu manpage warns that before kernel 5.2, balancing with quota groups enabled could stall the filesystem for an extended period.Read 19 Oct 2026 · manpages.ubuntu.com
- Limit: scrub workload
- The official documentation warns that scrub performs intense reads and can slow or briefly block other filesystem activity.Read 19 Oct 2026 · github.com
- Limit: trim variability
- The official documentation notes that TRIM may have no effect because results depend on device type, firmware and block-range constraints.Read 19 Oct 2026 · github.com
- Maintainer identity
- The kdave GitHub profile identifies the account with SUSE and pins btrfsmaintenance among its repositories.Read 19 Oct 2026 · github.com
- Maintainer role
- The openSUSE Build Service profile identifies David Sterba as maintainer and bug owner for the btrfsmaintenance package.Read 19 Oct 2026 · build.opensuse.org
- Maintenance tasks
- The tasks include scrub, balance, trim, and defragmentation, and each can be independently enabled, disabled, and configured.Read 4 Oct 2026 · github.com
- Package implementation
- Debian classifies the package as shell-implemented filesystem automation and scheduling software.Read 19 Oct 2026 · packages.debian.org
- Praise: conservative defaults
- Botmonster Tech highlights the project's lowered default balance thresholds of dusage=10 and musage=5 as a way to limit maintenance churn.Read 19 Oct 2026 · botmonster.com
- Praise: ready-made automation
- Botmonster Tech describes the package as the easiest route to ready-made systemd units for scrub, balance, trim and defrag.Read 19 Oct 2026 · botmonster.com
- Repository activity
- The public repository page shows 1.1k stars, 88 forks, 29 issues, 9 pull requests and 137 commits.Read 19 Oct 2026 · github.com
- Resource impact
- Scrub can cause intense reads and balance can have significant read and write impact, so task concurrency can be serialized to limit resource use or interactions.Read 4 Oct 2026 · github.com
- Scheduling
- The project supports either cron jobs or systemd timers, with only one scheduling approach intended to be active on a system.Read 19 Oct 2026 · github.com
- Scrub checks
- Scrub reads filesystem data and metadata to verify checksums and may reveal hardware problems or bit rot.Read 4 Oct 2026 · github.com
- Scrub repair
- When redundant data or metadata exists, scrub can automatically repair data if a good copy is available.Read 4 Oct 2026 · github.com
- Scrubbing
- Its scrub task reads data and metadata, verifies checksums and can repair redundant copies when the filesystem has suitable RAID or DUP redundancy.Read 19 Oct 2026 · github.com
- Security fix history
- The changelog records CVE-2018-14722 as fixed by making automatic mountpoint expansion safe.Read 19 Oct 2026 · github.com
- Security history
- The change log records that version 0.4.2 addressed CVE-2018-14722 by safely expanding automatic mount points.Read 4 Oct 2026 · github.com
- Security status
- Arch Linux's security page currently reports no issues for btrfsmaintenance 0.5.2-3.Read 19 Oct 2026 · security.archlinux.org
- Self-hosting
- Installation places executable scripts under /usr/share/btrfsmaintenance and configuration in the local system configuration directory, so operation is local to the Linux host.Read 19 Oct 2026 · github.com
- Supported distribution integration
- The documentation describes integration for Debian, SUSE, Red Hat-based distributions and derivatives, with a zypper-specific plugin for SUSE systems.Read 19 Oct 2026 · github.com
- TRIM
- Its trim task runs fstrim so compatible SSD or thin-provisioned devices can optimize blocks no longer used by the filesystem.Read 19 Oct 2026 · github.com
- Ubuntu documentation
- Ubuntu publishes a btrfsmaintenance 0.5.2-1build1 manpage and directs users to README.Debian for timer-enabling instructions.Read 19 Oct 2026 · manpages.ubuntu.com
Plans and prices
Strong points and limits
Strong points
- Configurable scrub, balance, trim, and defragmentation
- Scrub can repair data from a good redundant copy
- Supports cron or systemd timer scheduling
- Free under GPL-2.0
Limits
- Only one scheduling method can be active
- Scrub and balance can use substantial resources
- Defragmentation skips mount points, subvolumes, and snapshots
Who it suits
Btrfsmaintenance suits Linux administrators maintaining Btrfs filesystems who want scheduled maintenance scripts. It is aimed at people comfortable configuring filesystem tasks and their resource use.
Verdict
Btrfsmaintenance provides configurable scripts for common Btrfs maintenance tasks and scheduling. Check its resource impact and path limitations when configuring jobs.
Where Specifiction places it
- Disk Defragmentation Software#1 of 208.6
- System Information Software#4 of 348.6