On 2019/7/15 下午11:02, Robert Krig wrote:
> Hi guys. 
> I was wondering, are there any recommended best practices when using
> Raid5/6 on BTRFS?
> 
> I intend to build a 4 Disk BTRFS Raid5 array, but that's just going to
> be as a backup for my main ZFS Server. So the data on it is not
> important. I just want to see how RAID5 will behave over time.

If we live in a perfect world, no power loss or kernel panic, then btrfs
raid5/6 would be good.
But that's not the case.

> 
> That being said, are there any recommended best practices when
> deploying btrfs with raid5?

If there is any possibility of powerloss, kernel panic, or even unstable
cable connection, then raid5/6 feature from btrfs is not as good as
mdraid, mostly due to the write hole problem which hasn't been addressed
in btrfs.

If you want flexible device management, especially dynamically
adding/removing devices, then btrfs raid10/raid1 would be more suitable.

> 
> According to the wiki a good recommendation seems to be to have
> metadata as RAID1 and data as RAID5.
> 
> Other than that, are there any mount options which should be used or
> completely avoided when using raid5/6? (autodefrag,commit=,...)

I haven't heard such report yet.

> 
> Anything to consider when using realtime compression?

It shouldn't be a problem for raid5/6.

Although btrfs code doesn't has good enough separation for different
layers, but compression happens at extent level, while raid5/6 is at
chunk level, they have nothing to do with each other.

> Balancing issues? e.g. should you always do a full balance (when you
> decide you need one)?

Full balance makes no sense.

For older kernel we used to recommend balance based on usage filter to
free empty block groups, but now empty block groups are automatically
freed thus should cause no problem.

Balance should be triggered when:
- There is very unbalanced data/metadata block groups usage.
  E.g. a lot of data block groups are almost empty while metadata block
  groups are almost full.
  However this should be really rare.

- You want to convert profile


For raid5/6 what you really want to scrub, not only routinely but also
after each power loss/kernel panic/disk lost.
This should reduce the possibility of write hole.

> 
> Whats the best/proper way to replace a failing disk? What about a
> sudden faulty disk? e.g. won't spin up anymore. Just use btrfs replace
> as it says in the wiki?

Yes, btrfs replace.

Although for such case mdraid may be a safer solution.

Thanks,
Qu

> 
> Thanks guys.
> 
> 
> 
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to