Is rsync slow on btrfs

btrfsrsync

I have a large hard disk and a second hard disk, that I use as backup drive (with an USB 3 adapter), using rsync:

rsync -ahHPxX --delete --delete-delay

Rsync "pauses" a long time during sync, while I can hear both hard disks seeking. I think when I used XFS on both drives, it was a lot faster. I am not sure, because I cannot compare it directly.

Is rsync on btrfs slow for some reason? Maybe it is copying all metadata, or writing access times, that were not written when I used XFS?

I sync from a read-only snapshot on the first drive directly on the second drive (without using a second subvolume for it).

Best Answer

From my experience, BTRFS fragments horribly and this can have devastating performance effects on rotating media (HDD). This is amplified by rsync as it copies modified files by creating a temporary file which can be written in very small pieces (due to how the delta alg works).

XFS, on the other hand, is an extremely fast and optimized filesystem; recent (post-2015) versions also provide metadata checksum (see mkfs.xfs -m crc=1), albeit lacking data checksums and filesystem-level snapshots.

In short: never expect high performance by BTRFS, or you will be disappointed. It has many interesting features, but it is much slower than XFS (or even EXT4).