# Include btrfsmaintenance Debian package in Freedombox

**URL:** https://discuss.freedombox.org/t/include-btrfsmaintenance-debian-package-in-freedombox/2167
**Category:** Development
**Created:** [July 9, 2022, 5:01pm UTC](https://discuss.freedombox.org/t/include-btrfsmaintenance-debian-package-in-freedombox/2167 "2022-07-09T17:01:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![joseph](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joseph](https://discuss.freedombox.org/u/joseph)
#### Post date: [July 9, 2022, 5:01pm UTC](https://discuss.freedombox.org/t/include-btrfsmaintenance-debian-package-in-freedombox/2167/1 "2022-07-09T17:01:19Z")

</div>

**Summary**  
Btrfs maintenance tasks such as scrub and balance can be automated with the btrfsmaintenance package. I don’t believe that Freedombox automates these tasks today, but their periodic use is recommended.

**Problem**  
From btrfs wiki:

_scrub_

> The user is supposed to run it manually or via a periodic system service.

_defragmentation for mechanical disk users_

> The reason there’s a need for defragmentation stems from the COW design that BTRFS is built on and is inherent.

_btrfs check --repair should not be used lightly. Can we help the user make a good choice here?_

> Do not use _–repair_ unless you are advised to do so by a developer or an experienced user, and then only after having accepted that no _fsck_ successfully repair all types of filesystem corruption. Eg. some other software or hardware bugs can fatally damage a volume.

_balance may be needed for users with multiple devices in their btrfs_

**Solution**

- figure out whether a disk is mechanical or a nonvolitile memory unit, or allow users to specify
- automate safe and sensible maintenance with btrfsmaintenance or FB specific scripts
- possibly help users use btrfs check --repair only when appropriate

---

<div class="post-metadata">

### Author: ![joseph](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joseph](https://discuss.freedombox.org/u/joseph)
#### Post date: [October 16, 2025, 1:54am UTC](https://discuss.freedombox.org/t/include-btrfsmaintenance-debian-package-in-freedombox/2167/3 "2025-10-16T01:54:08Z")

</div>

@problema I posted the wrong link. This one is how to set up btrfsmaintenance.

> [@BTRFS Filesystem Maintenance Automation with btrfsmaintenance Package](https://discuss.freedombox.org/t/btrfs-filesystem-maintenance-automation-with-btrfsmaintenance-package/2876):
>
> btrfsmaintenance This post covers setup of the btrfsmaintenance package to automate sensible and recommended filesystem maintenance tasks of the btrfs filesystem. The common use case covered here is a single btrfs root filesystem mounted at /. This is the expected use case which allows a user to use the Storage Snapshots app built into Freedombox. A user using a more complex btrfs configuration such as a non-root btrfs or multiple btrfs filesystems is expected to be able to adapt these notes to …

---

<div class="post-metadata">

### Author: ![problema](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/problema/32/1527_2.png) [@problema](https://discuss.freedombox.org/u/problema)
#### Post date: [October 16, 2025, 3:31am UTC](https://discuss.freedombox.org/t/include-btrfsmaintenance-debian-package-in-freedombox/2167/4 "2025-10-16T03:31:10Z")

</div>

@joseph This current post, okay. My disk has errors, apparently physical and permanent, in eight sectors. I hope Btrfs can handle that.

---

<div class="post-metadata">

### Author: ![joseph](https://discuss.freedombox.org/letter_avatar_proxy/v4/letter/j/dc4da7/32.png) [@joseph](https://discuss.freedombox.org/u/joseph)
#### Post date: [October 17, 2025, 2:06am UTC](https://discuss.freedombox.org/t/include-btrfsmaintenance-debian-package-in-freedombox/2167/5 "2025-10-17T02:06:22Z")

</div>

Bad sectors get marked by the drive and will get logged. You get concerned when the bad sector count starts to climb quickly. You can configure smart logs to include that if you need to.

If it passes the smart tests it is good to run. You can run those manually. start saving money for a replacement if you are cautious.
