src/health/guides/btrfs/btrfs_system.md
The btrfs_system alert monitors the percentage of used Btrfs system space. If you receive this alert, it means that your Btrfs system space usage has reached a critical level and could potentially cause issues on your system.
Important: Data is priceless. Before you perform any action, make sure that you have taken any necessary backup steps. Netdata is not liable for any loss or corruption of any data, database, or software.
Add more physical space
Adding a new disk always depends on your infrastructure, disk RAID configuration, encryption, etc. To add a new disk to a filesystem:
root@netdata~ # btrfs device add -f /dev/<new_disk> <path>
root@netdata~ # btrfs device add -f /dev/<new_disk> <path>
root@netdata~ # btrfs filesystem show
Label: none uuid: d6b9d7bc-5978-2677-ac2e-0e68204b2c7b
Total devices 2 FS bytes used 192.00KiB
devid 1 size 10.01GiB used 536.00MiB path /dev/sda1
devid 2 size 10.01GiB used 0.00B path /dev/sdb
root@netdata~ # btrfs filesystem balance <path>
Delete snapshots
You can identify and delete snapshots that you no longer need.
root@netdata~ # sudo btrfs subvolume list -s <path>
root@netdata~ # btrfs subvolume delete <path>/@some_dir-snapshot-test
Enable a compression mechanism
mount/point path, with the zstd compression algorithm:
root@netdata # btrfs filesystem defragment -r -v -czstd /mount/point
Enable a deduplication mechanism
Tools dedicated to deduplicate a Btrfs formatted partition include duperemove, bees, and dduper. These projects are 3rd party, and it is strongly suggested that you check their status before you decide to use them.
Perform a balance
Especially in a Btrfs with multiple disks, data/metadata might be unevenly allocated into the disks.
root@netdata # btrfs balance start -musage=10 -dusage=10 -susage=50 /mount/point
This command will attempt to relocate data/metdata/system-data in empty or near-empty chunks (at most X% used, in this example), allowing the space to be reclaimed and reassigned between data and metadata. If the balance command ends with "Done, had to relocate 0 out of XX chunks", then you need to increase the "dusage/musage" percentage parameter until at least some chunks are relocated.