kdave / btrfsmaintenance

Scripts for btrfs maintenance tasks like periodic scrub, balance, trim or defrag on selected mountpoints or directories.
GNU General Public License v2.0
927 stars 79 forks source link

balance task will fail on mixed mode filesystems #16

Closed ian-kelling closed 8 years ago

ian-kelling commented 8 years ago

I have btrfs on /boot, it's 2.4 gigs, btrfs.mkfs set it to mixed mode by default. btrfs-balance.sh runs this:

btrfs balance start -dusage=0 /boot

Which fails, tells me to look at syslog or dmesg, syslog says:

kernel: BTRFS error (device sda3): with mixed groups data and metadata balance options must be the same

Tried this instead which worked:

btrfs balance start -dusage=0 -musage=0 /boot
kdave commented 8 years ago

The mixed mode hasn't been considered but should not be hard to add, we just have to detect it and supply the right options to balance.

kdave commented 8 years ago

Can you please test the fix in branch balance-mixed-bg?

ian-kelling commented 8 years ago

I've tested it. It works. I've reviewed the code, it looks good. Feel free to merge it and close this.

kdave commented 8 years ago

Thanks!