[Discuss] btrfs

Rich Pieri richard.pieri at gmail.com
Fri Feb 22 12:49:03 EST 2013


On Fri, 22 Feb 2013 12:10:01 -0500
Jerry Feldman <gaf at blu.org> wrote:

> Ok, question answered.
> So if I currently had a RAID1(/dev/mdn == /dev/sdxn + /dev/sdyn)
> ThenI would achieve roughly the same benefits with btrfs -d raid1.

Roughly. It gets a little complicated with more than 2 devices and
with non-identical devices. Btrfs uses a balancing algorithm to
distribute extents across multiple devices as evenly as possible. It's
a lot like AdvFS this way.


> In RAID, the third drive would effectively be a hot spare. What would
> btrfs do with the third drive. In the default,

Let's say that you have 3 x 1TB disks. "btrfs -d raid1 sda sdb sdc"
would create a volume with 1.5TB capacity. Any data or metadata written
to sda will be replicated on either sdb or sdc based on the balancing
algorithm. A single device fault will not result in lost data since
every extent on that device is replicated on one of the other two.

If you created a volume with 2 of the disks, "btrfs -d raid1 sda sdb",
then you would have a volume with 1TB capacity and an unused disk. If
either sda or sdb faults then you could swap sdc in to replace the
faulted disk.

The same three disks in a "-d raid0" set would make a volume with 3TB
capacity. Loss of any one of the three disks will cause data loss.

-- 
Rich P.



More information about the Discuss mailing list