btrfs scrub is used to scrub a btrfs filesystem, which will read all data and metadata blocks from all devices and verify checksums. Automatically repair corrupted blocks if there’s a correct copy available.Note**:** Scrub is not a filesystem checker (fsck) and does not verify nor repair structural damage in the filesystem.
Scrub operation reads all data and metadata from the devices and verifies the checksums. It’s not mandatory, but may point out problems with faulty hardware early as it touches data that might not be in use and bitrot.
If there’s a redundancy of data/metadata, ie. the DUP or RAID1/5/6 profiles, scrub is able to repair the data automatically if there’s a good copy available.
I understand the benefit if you have RAID data duplication, but I’m curious about the benefits when you don’t have that.
The quote above indicates it might “point out problems with faulty hardware”. Has anyone ever encountered that? What do you do in that situation – reformat or start shopping for a new drive?
I’m also wondering about the benefit of it being done automatically by btrfsmaintenance on a single drive. How am I going to be informed if it does find “problems with faulty hardware”?
Single drive can still have DUP profile and this is default for metadata. Also periodical scrub gives you early warning of data corruption. It is always better to be notified in advance and have time to decide how to handle it than to get EIO when actually working with data.