On Wed, Mar 3, 2021 at 1:14 PM Samuel Sieb <sam...@sieb.net> wrote:
>
> On 3/3/21 10:05 AM, Matthew Miller wrote:
> > On Wed, Mar 03, 2021 at 11:56:58AM -0600, Richard Shaw wrote:
> >>  From what I can tell scrubbing only reads data and compares to the stored
> >> checksum. Why would that wear out a SSD?
> >
> > If you have atimes enabled, reading a file also makes a metadata write. But
> > I don't think it's that big a deal on modern drives.
>
> It depends on how the scrubbing works.  I would have expected it to be
> reading data at the filesystem level, not actually opening and reading
> every file.  That seems like a really bad thing to me, resetting the
> atimes on every file.

It works at the block level. A block is read, checksum calculated and
compared to the previously recorded checksum for the block. It doesn't
know what it's reading, not even whether it's compressed or not. It
just becomes a stream of blocks without respect to the file or
subvolume. If there's a mismatch, then it does a lookup to find out
the owner: what subvolume/snapshot and filename/inode, what offset,
and so on - which is then how it figures out where the good copy is
(if any) and does self-healing. It pretty much runs at device max read
capability.

Related:
'btrfs replace' command utilizes this scrub facility to live replace a
drive, and is the preferred way to replace; as compared to 'btrfs
device add' followed by 'btrfs device remove'. The replace method in
effect creates a temporary virtual/hidden mirror, and does a scrub to
make the replacement the same as the source. File system writes during
replace go to both devices, and it's expected to be crash safe,
resuming automatically at next mount time.

-- 
Chris Murphy
_______________________________________________
test mailing list -- test@lists.fedoraproject.org
To unsubscribe send an email to test-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/test@lists.fedoraproject.org
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to