I have BTRFS for root and home volumes on my latop, and today I found out that BTRFS supports defragmentation. It’s interesting to check whether defragmentation has measurable performance impact, so I did a quick test.
The easiest thing was to measure the boot time as reported by systemd . So I did a couple of restarts, recorded the boot times systemd-analyze reports :
Then I did a :
sudo btrfs filesystem defragment -v -r /
And recorded the new boot times :
That’s a whole second less, or about 11% improvement. Not so bad at all, given that the disk is Samsung 840 Pro SSD, and is quite fast anyway.