Rich Freeman posted on Sun, 09 Aug 2015 22:25:35 -0400 as excerpted:

> The key is that btrfs manages "raid" at the chunk level, not the
> device level.  When btrfs needs more disk space it allocates a new
> chunk from unallocated space on a device.  If it is in raid1 mode it
> will allocate a pair of chunks from two different drives, storing the
> same data in each.  The allocation algorithm is reasonably smart so if
> you have 2x1TB drives and 1x3TB drive you'll end up with about 2TB of
> data stored and not 1TB on each of the two 1TB drives and an empty
> unusable 3TB drive.
> 
> This is also why you can switch between raid modes "on the fly"[. ...]

Very good explanation, Rich. =:^)

> This also lets you do things like add a disk to a raid5.  If you have
> 5 disks and add one more, existing chunks will be striped across 5
> drives, and new chunks will be striped across 6, unless you balance
> them.

I'm actually posting to add a caveat to this.

While btrfs itself is "getting stable", that is, good enough for daily 
work, but not as mature and well tested as some of the other filesystems 
so do keep things you don't want to lose backed up, btrfs raid56 mode 
(that's raid5 and raid6, the same module, raid56, deals with both) was 
only code-complete with kernel/progs 3.19, and is still quite immature 
and not well tested compared to the rest of btrfs.  With 4.2 it should be 
out of its most critical phase, but I've been warning people to give it a 
year (after 3.19) before considering its stability to be close to the 
rest of btrfs.  Since there's normally ~5 kernel cycles per year, that 
would be 4.4.  Until then, if you're willing to be a guinea pig on it, 
reporting any bugs and working with the devs to test fixes, THANKS, it's 
people like you who help make it dependable for others.  Otherwise, stick 
with the more stable raid1 or raid10 modes until 4.4 or so, and at that 
point if you're still interested in raid56 mode, check the list to see 
how it's doing, and assuming nothing exceptional is going on, /then/ do 
the raid56 thing.

Of course, since the OP question was about raid1, this is probably just 
extra info for him, and mostly to cover anyone else that /might/ be 
looking at raid56 mode at this time, and happens onto this thread.


-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to