btrfs RAID0 3 disks

harmonyp

Member
Nov 26, 2020
196
4
23
46
I came across the following on creating btrfs. I am curious what do you guys suggest if I want performance? What are the pros/cons for each

Code:
# Create a filesystem across three drives (metadata mirrored, linear data allocation)
mkfs.btrfs -d single /dev/sdb /dev/sdc /dev/sdd

# Stripe the data without mirroring, metadata are mirrored
mkfs.btrfs -d raid0 /dev/sdb /dev/sdc /dev/sdd
 
Last edited:
"single" means the data is allocated in a linear fashion. That is, if all your three drives are 1TB in size, the first terabyte of data would all go to sdb, then the next to sdc, then sdd. This means that if a drive fails, data recovery might be easier, as most files are stored exclusively on one drive. IMO this is a minor benefit though, as you'll still lose a lot. The only reason I can see this being useful if your drives are of unequal size, since you can use all of it in this mode.

"raid0" is a regular RAID0, meaning your data is striped. AFAIK this happens in 1GB increments on btrfs, but for files of different applications etc... this will provide a speed benefit, as multiple drives are accessed at the same time. It may also increase longevity, as it's not just one drive getting hammered all the time. With varying size disks however, you will lose some space in this mode.
 
"single" means the data is allocated in a linear fashion. That is, if all your three drives are 1TB in size, the first terabyte of data would all go to sdb, then the next to sdc, then sdd. This means that if a drive fails, data recovery might be easier, as most files are stored exclusively on one drive. IMO this is a minor benefit though, as you'll still lose a lot. The only reason I can see this being useful if your drives are of unequal size, since you can use all of it in this mode.

"raid0" is a regular RAID0, meaning your data is striped. AFAIK this happens in 1GB increments on btrfs, but for files of different applications etc... this will provide a speed benefit, as multiple drives are accessed at the same time. It may also increase longevity, as it's not just one drive getting hammered all the time. With varying size disks however, you will lose some space in this mode.
Thanks for the input, RAID0 it is then although I have read single are in 64K chunks.

What do you think about putting the metadata as RAID1?

Code:
mkfs.btrfs -m raid1 -d raid0 -L My-Storage /dev/nvme0n1 /dev/nvme1n1  /dev/nvme2n1
good or bad for performance? I am expecting 5x more writes than reads generally.
 
Last edited:
For a RAID0, metadata mirroring doesn't make too much of a difference, both in terms of consistency and performance. It might help recover data from a slightly damaged disk.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!