Linux raid10 on btrfs

1

I've read that BTRFS requires at least 4 disks (https://btrfs.wiki.kernel.org/index.php/Using_Btrfs_with_Multiple_Devices). Indeed, Linux mdadm raid10 requires only 2 disks (http://en.wikipedia.org/wiki/Non-standard_RAID_levels#Linux_MD_RAID_10). Is there something like "raid10,f2" provided by Linux mdadm in BTRFS? I'd like to have the checksumming capability built-in in the raid array, if possible.

Alberto

Posted 2012-12-13T13:12:12.420

Reputation: 11

Answers

2

Well four is the smallest number of devices for which RAID10 makes sense really.

Because it involves mirroring you need an even number of disks, and if you only have two disks then what you have is just a mirror, which is a RAID1 array.

Yes they could allow a two disk RAID10 array, but it would be exactly equivalent to a two disk RAID1 array so I imagine they have simply chosen not to allow that option.

TomH

Posted 2012-12-13T13:12:12.420

Reputation: 2 558

1If you have an odd number of disks, in theory you can have mirrored data too, it just means that a single disk's data will be mirrored to multiple other disks. If you mirror at block level (which btrfs does), then that should not be a problem, right? – w00t – 2014-08-06T08:56:36.483

That said, I just tried and btrfs won't let me create a raid10 with 3 devices. Aww. Ah well. – w00t – 2014-08-06T09:02:08.260

Not really. Look at https://raid.wiki.kernel.org/index.php/Performance. mdadm "raid10,f2" (which is the one I am interested in) performs like RAID0 in reading and like RAID1 in writing. RAID1 is much more slow in reading. That's why "raid10,f2" is almost always better than RAID1 in mdadm. Is it possible to have something like "raid10,f2" with BTRFS?

– Alberto – 2012-12-13T17:45:54.757

1That's an implementation detail of the linux software RAID which is being benchmarked there - there is no need for such a difference if reads are distributed across both mirrors. You certainly can't extrapolate from that to btrfs as btrfs does RAID in a completely different way. – TomH – 2012-12-13T18:02:19.733