btrfsmaintenance
Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2021.7.x
- Puppet >= 7.24 < 9.0.0
- ,
Start using this module
Add this module to your Puppetfile:
mod 'frankvandamme-btrfsmaintenance', '0.1.0'
Learn more about managing modules with a PuppetfileDocumentation
btrfsmaintenance
Welcome to your new module. A short overview of the generated parts can be found in the [PDK documentation][1].
The README template below provides a starting point with details about what information to include in your README.
Table of Contents
- Description
- Setup - The basics of getting started with btrfsmaintenance
- Usage - Configuration options and additional functionality
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
Btrfsmaintenance configures BTRFS file system maintenance jobs based on the Debian package by the same name. It is possible to periodically run scrub, defrag, balance, and trim jobs and parametrize those.
Configuration ends up in a single central file /etc/default/btrfsmaintenance, and systemd timers are configured and updated based on that.
Setup
What btrfsmaintenance affects OPTIONAL
- btrfsmaintenance package installation through apt
- rewrites /etc/default/btrfsmaintenance file
- systemd service btrfsmaintenance-refresh restart, which takes care of updating the timers
Setup Requirements OPTIONAL
Have Debian. RedHat does not even support BTRFS.
Beginning with btrfsmaintenance
include btrfsmaintenance
By default, this will not balance, defrag or scrub, but will trim any file system it can find on a monthly basis.
Usage
Use Hiera. To eg. balance /home every week:
btrfsmaintenance::balance_period: weekly
btrfsmaintenance::balance_mountpoints:
- /home
Include usage examples for common use cases in the Usage section. Show your users how to use your module to solve problems, and be sure to include code examples. Include three to five examples of the most important or common tasks a user can accomplish with your module. Show users how to accomplish more complex tasks that involve different types, classes, and functions working in tandem.
Limitations
Only useful on systems that use btrfs file system, which for whatever reason need housekeeping.
Reference
Table of Contents
Classes
btrfsmaintenance
: Configures the btrfsmaintenance package in Debian distros
Classes
btrfsmaintenance
Configures the btrfsmaintenance package in Debian distros
Parameters
The following parameters are available in the btrfsmaintenance
class:
log_output
defrag_paths
defrag_period
defrag_min_size
balance_mountpoints
balance_period
balance_musage
balance_dusage
scrub_mountpoints
scrub_period
scrub_read_only
trim_period
trim_mountpoints
allow_concurrency
scrub_priority
log_output
Data type: Enum[none,stdout,journal,syslog]
Where and how to log messages: none,stdout,journal,syslog
Default value: "stdout"
defrag_paths
Data type: Array[Stdlib::Absolutepath]
Paths to run periodic defrag on. Does not cross subvolumes.
Default value: []
defrag_period
Data type: Enum['none','daily','weekly','monthly']
How often to defrag: none,daily,weekly,monthly
Default value: "none"
defrag_min_size
Data type: Pattern[/^\+\d+[kKmMgGtTpPeE]/]
Minimal file size to consider for defragmentation
Default value: "+1M"
balance_mountpoints
Data type: Array[Stdlib::Absolutepath]
List of mount points to include in periodical balance routine
Default value: []
balance_period
Data type: Enum['none','daily','weekly','monthly']
How often to balance: none,daily,weekly,monthly
Default value: "none"
balance_musage
Data type: Variant[Pattern[/^(\d* *)*$/],Array[Integer]]
Usage % for balancing metadata or mixed block groups; multiple values for subsequent runs
Default value: [5, 20, 40]
balance_dusage
Data type: Variant[Pattern[/^(\d* *)*$/],Array[Integer]]
Usage % for balancing data block groups; multiple values for subsequent runs
Default value: [5, 10, 20, 40]
scrub_mountpoints
Data type: Array[Stdlib::Absolutepath]
List of mountpoints to include in periodical scrub routing
Default value: []
scrub_period
Data type: Enum['none','daily','weekly','monthly']
How often to scrub:
Default value: "monthly"
scrub_read_only
Data type: Boolean
Read-only means: do not try to fix (if true).
Default value: false
trim_period
Data type: Enum['none','daily','weekly','monthly']
How often to run fstrim (for SSD disks).
Default value: "none"
trim_mountpoints
Data type: Variant[Enum["auto"],Stdlib::Absolutepath]
List of mountpoints to include in periodical fstrim run
Default value: "/"
allow_concurrency
Data type: Boolean
Allow or disallow running more than one of these maintenance tasks at the same time
Default value: false
scrub_priority
Data type: Enum['idle','normal']
Default value: "idle"