r/btrfs • • 7h ago

Balance and defragment for single disk?

5 Upvotes

I have a single disk used for downloads of media files and as NFS storage, it's usually between 70%-90% full. I heard balance is still useful for single disks because it defragments free space (not sure how that is difference from defragmenting from a practical standpoint. I do not use snapshots.

Can someone recommend balance and defragment workflow when the disk have periods of downtime and/or there's relative more free space to keep it in decent health? Caching the files for seeking is noticeably slower when the disk is nearing full (it's not surprising and I know it's not recommended for the disk to be full but ultimately the data on it is not too important as it gets backed up and are always retrievable).

For example, I'm not sure if defragment is always resumable or if it "starts over" due to the complicated nature of a filesystem like Btrfs. Also not sure if balance should be run before or after a defragment and with what `-dusage` level as well as frequency of such commands (or ways to know when the disk would benefit from balance or defragment, like examining certain metrics).

I already know ultimately performance issue comes from the disk being so full.