DATE CHECKED THIS PAGE WAS VALID: 14/09/2023

Unsure if still a valid page as this is the default in trixie anyway.

As per: https://github.com/kdave/btrfs-progs/issues/319

mdata should be dup by default so your btrfs filesystem can handle errors more easily.

DO NOT RUN THIS ON A DISK WITH VERY LITTLE FREE SPACE. You Need to ensure you have 5X the metadata space to ensure it can be converted without errors, eg: Metadata = 6GB then ensure 30GB is free etc.

You can check if this is the case for you by using command:

sudo btrfs fi df /

You will see something like:

In this image Metadata is already DUP however it might say that your metadata is Single such as:

Data, single: total=287.01GiB, used=206.46GiB

System, single: total=32.00MiB, used=64.00KiB

Metadata, single: total=10.01GiB, used=5.35GiB

GlobalReserve, single: total=512.00MiB, used=0.00B

To convert to DUP which duplicates the metadata (information about the files on the disk) run this command:

sudo btrfs balance start -mconvert=dup /

In another terminal you can see it progressing:

watch sudo btrfs balance status /

Running 'sudo btrfs fi df /' when it completes again will show you that metadata is now DUP. Note that system also shows DUP.

This should be the default but possible if your system was created some time ago you may not have this.