2

I need to create a raid10 array with btrfs. The raid will be handled by btrfs directly (not mdadm), since, I believe, it gives more information to the btrfs layer to detect and handle failures (am I right?).

So, it's easy: there is plenty of docs everywhere. I just have to use:

mkfs.btrfs -m raid10 -d raid10 /dev/sdb /dev/sdc /dev/sdd /dev/sde

Hold on: I explicitly bought two sets of drives from different manufacturers because this. So I need to know how mkfs.btrfs will group drives in clusters.

So, if I use the above command example, will I get a

  • (RAID0 over (/dev/sdb + /dev/sdc RAID1) and (/dev/sdd + /dev/sde RAID1)), or a
  • (RAID0 over (/dev/sdb + /dev/sdd RAID1) and (/dev/sdc + /dev/sde RAID1)),
  • or, as I'm starting to suspect, none of the above, the raid10 profile just guaranteeing each block to be duplicated on two distinct drives, but the choice of the drives being somewhat random (since apparently raid10 btrfs allows an odd number of drives, it certainly doesn't behave like regular raid 10).

This isn't quite clear in the docs, including in the appropriate man page.

1 Answer 1

3

So I lookup it up and indeed, BTRFS raid10 profile isn't actually like regular raid 10. All drives are treated equally, there is no underlying clusters of raid 1 that get combined together into a big raid 10.

The guarantee that BTRFS offers, which makes it looks like regular raid 10, is that each piece of data is guaranteed to exist on two distinct drives, so the filesystem will survive a failure of a single drive. What it does not offer compared to regular raid 10 is that if two drives fail, you most likely have lost your filesystem, whereas regular raid 10 can survive if the two failed drives are in different clusters.

So the fact that the drives are from two different manufacturers don't really add any value with BTRFS raid10.

However, the benefit is that (quote from the SysAdmin guide):

Chunks within a RAID grouping are not necessarily always allocated to the same devices. This allows Btrfs to do data duplication on block devices with varying sizes, and still use as much of the raw space as possible. With RAID-1 and RAID-10, only two copies of each byte of data are written, regardless of how many block devices are actually in use on the filesystem.

So devices with different sizes may be used in a more flexible way than regular raid.

Also, I realized that, starting from an array of 4 disks, there actually isn't much difference between BTRFS raid1 and raid10 profiles, it seems. Both seem to offer exactly the same guarantees in terms of reliability, and the same flexibility. The only difference I could find is that with raid10, "the data is load-balanced between disks". Whatever that exactly means, it just offers additional performance (which makes me question the reason why you would want a raid1 with 4 disks or more, but I digress).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.