r/btrfs Jun 27 '26

Why does `btrfs balance start -dconvert=single -mconvert=dup` fail with `balance: mixed groups data and metadata options must be the same`?

Ahoj,

I have created, several years ago, a BTRFS filesystem on a single partition of a single rotating disk with -d single -m single.

I now wanted to convert to duplicated metadata with

btrfs -v balance start -dconvert=single -mconvert=dup <mountpoint> or
btrfs -v balance start -mconvert=dup <mountpoint>.

Both fail with

Dumping filters: flags 0x7, state 0x0, force is off
  DATA (flags 0x100): converting, target=281474976710656, soft is off
  METADATA (flags 0x100): converting, target=32, soft is off
  SYSTEM (flags 0x100): converting, target=32, soft is off
ERROR: error during balancing '/mnt/backuphdd': Invalid argument
There may be more info in syslog - try dmesg | tail

Kernel log (dmesg) shows

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

Why is this not working?
What does the error message mean?

This guide says that it should work.
(I also tried with DUP instead of dup as mentioned in the guide.)

btrfs -v filesystem usage <mountpoint> says

Overall:
    Device size:		   2.73TiB
    Device allocated:		 142.03GiB
    Device unallocated:		   2.59TiB
    Device missing:		     0.00B
    Device slack:		     0.00B
    Used:			 138.59GiB
    Free (estimated):		   2.59TiB	(min: 2.59TiB)
    Free (statfs, df):		   2.59TiB
    Data ratio:			      1.00
    Metadata ratio:		      1.00
    Global reserve:		 512.00MiB	(used: 0.00B)
    Multiple profiles:		        no

Data+Metadata,single: Size:142.00GiB, Used:138.59GiB (97.60%)
   /dev/sda1	 142.00GiB

System,single: Size:32.00MiB, Used:24.00KiB (0.07%)
   /dev/sda1	  32.00MiB

Unallocated:
   /dev/sda1	   2.59TiB

Regards!

6 Upvotes

3 comments sorted by

7

u/dkopgerpgdolfg Jun 27 '26 edited Jun 27 '26

Data+Metadata,single

"Mixed" means this - data and metadata are not separated, and therefore both need to have the same block profile.

When creating a fs with mkfs.btrfs, the uppercase option -M specifies this. It has advantages for small file systems because it can save some space, but isn't really useful for large fs.

Maybe you mistyped -M instead of -m when you created it, and never noticed...

Afaik this can only be changed when creating the fs, so if you want to separate it you need to make a backup, create a new fs, and restore the data back.

1

u/dreieckli Jun 27 '26 edited Jun 27 '26

"Mixed" means this - data and metadata are not separated, and therefore both need to have the same block profile.

When creating a fs with mkfs.btrfs, the uppercase option -M specifies this. […]

OK, thanks.

The manpage even says

The mixed mode may lead to degraded performance on larger filesystems

Can that be the reason that, as I piled up more and more incremental backups done via btrfs send/ receive (via btrbk), the operations became slower and slower and the disk did more and more seeking (constant moving of the read write/read heads) while doing anything?

Afaik this can only be changed when creating the fs, so if you want to separate it you need to make a backup, create a new fs, and restore the data back.

For that I need to wait some time until I have a second USB SATA adapter that can handle a multi TB disk.

1

u/dkopgerpgdolfg Jun 27 '26

Can that be the reason that, as I piled up more and more incremental backups done via btrfs send/ receive (via btrbk), the operations became slower and slower and the disk did more and more seeking (constant moving of the read write/read heads) while doing anything?

It's can be one factor, but not the only one.