[kwlug-disc] BTRFS Was: Transferring large backup files over the network
Chris Irwin
chris at chrisirwin.ca
Fri May 24 00:20:47 EDT 2019
On Thu, May 23, 2019 at 10:06:32PM -0400, Remi Gauvin wrote:
> many places, including the official
>BTRFS wiki, recommend disabling Copy-On-Write for database or VM Image
>files.
I use BTRFS for my desktop and laptop (both home and work) and have no
issues or complaints. Automatic snapshots have saved me several times.
However, BTRFS is a tool. You can use it for the features it was
intended for (COW and checksumms), or you can use it wrong. Anything
suggesting disabling COW on BTRFS is simply plain wrong, regardless of
whether it is some blog or official documentation.
Disabling COW for VMs on BTRFS means:
* You're not getting data checksums (they require COW)
* You're not using snapshots (they silently enable COW)
If you're not using either of those: Why are you bothering with BTRFS?
BTRFS with COW disabled is worse than ext4: You're not getting any
actual feature benefits, and you've lost the more plentiful and robust
ext4 recovery tools (should you ever need them).
Additionally some features (like snapshots) will silently enable COW,
even on files that COW was "disabled", and defragmenting (including
autodefrag) will cause data duplication between snapshots (which were
deduped by virtue of COW).
For Virtual Machines and Databases, I'd really just recommend having an
ext4 LV for those. I keep VMs and databases on ext4 (at home) or xfs (at
work, due to RHEL).
(I prefer ext4 use for home, because you can't shrink xfs)
>However, the BTRFS raid implementation is completely dependent
>on CoW to maintain synchronization between mirrors. Any event that
>interrupts writes to a mirrored file with CoW disabled will result in
>discrepancies between the mirrored copies, and they are never
>automatically fixed.. not even if you run a scrub.
Which makes sense. Disabling COW disables data checksums, and scrub
searches for checksum errors.
--
Chris Irwin
email: chris at chrisirwin.ca
xmpp: chris at chrisirwin.ca
web: https://chrisirwin.ca
More information about the kwlug-disc
mailing list