Originally posted by coder111
View Post
Though I don't k exactly where it is. It might be a 3rd party openrepos package.
I actually use the command line interface : "btrfs-balancer balance".
You really need to balance monthly~weekly to guaranty that you'll not reach "enospc" error.
EDIT: There is one. Hmm.... Jolla should *definitely* implement something similar on their base installation.
But I have to admit that Jolla has done a few sub-optimal choices in the way they've handled btrfs:
- They use "dup" for the metadata RAID mode. Means each block group of metadata is written twice on the media.
It used to make sense with spinning rust media (if there a bad sector in one copy of the HDD, you can still use the alternate copy elsewhere).
It's useless on modern flash media (the flash translation layer groups writes together to help the wear-levelling. Thus boths copies will end up on the same flash erase-block. So either both will be fried, or both will be okay).
Modern btrfs recommand "single" mode instead for SSDs, but apparently back when the phones where shipped, it wasn't yet by default in mkfs.btrfs
You can change it post facto with :
Code:
btrfs balance start -v -f -mconvert=single /
- They use separate metadata and data block group. (as if you used 2 different partitions handled by LVM)
Most of the problems arise when there's plenty of free space on the data block groups. But to do an action, btrfs needs to allocation a new blockgroup (e.g.: needs more metadata space), and there are no free block group left.
(as if you needed to lvresize your metadata partition, but there's no extent free left on the volumegroup, because all is assigned to the data partition).
The problem is that data block groups are allocated in stripes of 1GiB (and metadata is allocated in stripes of 256MiB).
A small flash drive like Jolla 1's 12GiB root partition is quick to get allocated for data block group (only up to 12 data groups available), and then you already ran out of block groups to allocate for metadata.
Modern BTRFS has a "mixed mode" where both data and metadata are written on the same block group. So if you need to write more metadata, you don't need to actually allocation another 256 MiB of metadata block groups, you can actually write on the free space left on the other data block groups.
This is currently recommanded by btrfs for small flashmedia with only around a dozen of GiB.
But it was just then introduced with the 3.2 series of kernel. So probably given that it wasn't yet tested enough back then, Jolla decided to stay with the more usual classic approach.
Originally posted by coder111
View Post
Did you get srcub errors ?
Originally posted by coder111
View Post
openSUSE provides a "btrfs-maintenance" package that gives you a cron job for scrubbing (check for errors), balancing (free block groups), and TRIM (if you VM can use it for sparse disk images)
Originally posted by coder111
View Post
or you need to give it to something else to worry (btrfs-balancer, btrfs-maintenance) and carry the maintenance for you (either scripts that you call manually - i do this on my phone once in a while on the phone) (or have a cron job / a systemd .timer do it for you - i do this on my suse machines, and have my own home grown script for debian)
with such my expercience with btrfs has been worry-free.
Leave a comment: