4

Background is a general discussion about ZFS and the claim that in case of permanent errors to files, it automatically deletes files unless a correct copy is available. That sounded pretty wrong to me and has since been reduced to that this happens only when scrub is executed.

I've never read about that and the only cases when such things happened I found online have been in cases of checksum errors occurred, people deleted the corrupted files manually and ran scrub afterwards. The same source is even talking about having executed scrub the first time without any success, keeping the broken files in place. Removing storage for the files in case they have been manually deleted before makes totally sense of course. But the claim is that without the manual deletion scrub will delete the files automatically anyway.

The docs only talk about how files are handled if a working copy is available, but I don't read about any deletes:

For replicated (mirror or raidz) devices, ZFS automatically repairs any damage discovered during the scrub.

So, under which conditions does scrub delete things automatically? If at all.

Thanks!

1
  • Without commenting on your question, the article you link to gives bad advice. The next time the scrub is run to completion, the errors will reappear, because they're still permanent, on-disk errors. (Everyone is running weekly or biweekly scrubs, yes? :)
    – Harald
    Jan 14, 2020 at 19:11

1 Answer 1

5

Scrub never deletes anything. If it finds errors that are repairable, it repairs then. If they are not repairable, it reports them. It never, ever deletes anything under any circumstances.

1
  • sounds more correct
    – nwgat
    Mar 10 at 1:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .