RAID6 - wikipedia
- RAID5 requires 3+ Drives(n) with 1-1/n space efficiency
- RAID6 requires 4+ Drives(n) with 1-2/n space efficiency
Total space (approximate) of a 1 TiB array and change (%) from RAID5 -> RAID6:
- 4 x 250GiB ~ 1 TiB -> RAID5 ~ 768 GiB -> RAID6 ~ 512 GiB -> -50%
- 5 x 200GiB ~ 1 TiB -> RAID5 ~ 819.2 GiB -> RAID6 ~ 614.4 GiB -> -25%
- 6 x 170GiB ~ 1 TiB -> RAID5 ~ 853.3 GiB -> RAID6 ~ 682.6 GiB -> -20%
You can change the raid level on a running array assuming you have enough free space and drives.
- do not delete or remove any drives you want in the final array
- by deleting -> adding -> converting you would be "double" balancing
- during the remove/delete, metadata and data chunks are redistributed to the remaining drives then you are adding a drive, which will need to balance again when you convert to RAID6.
If you need to add a drive(s) add them all before balance/convert.
btrfs device add /dev/sdc /mnt
btrfs device add /dev/sdd /mnt
Balance Filters - btrfs.wiki.kernel.org
btrfs balance "convert" example from link (updated):
btrfs balance start -dusage=90 -dconvert=raid6 -mconvert=raid6 /mnt
-dusage is the usage threshold for your data chunk balancing.
-dconvert is for the data
-mconvert is for the metadata
the /mnt is where the BTRFS volume is mounted. You cannot do this unmounted.
btrfs data and/or metadata can be:
- single
- raid0
- raid01
- raid1
- raid5
- raid6
- raid1c3
- raid1c4
Commands to pause, resume, cancel or get status can be used.
btrfs balance pause /mnt
btrfs balance resume /mnt
btrfs balance cancel /mnt
btrfs balance status -v /mnt
Caveats
- Depending on how much data you have on the drives the balance takes time.
- There is a chance of the balance failing and corrupting the array and/or putting it into an unstable read only mode.
- Backup data before converting.
- Make sure you're running the latest stable Linux kernel.