# Bitrot and/or data corruption protection

**URL:** <https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218>\
**Category:** Feature Requests\
**Created:** [December 7, 2020, 5:05pm UTC](https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218 "2020-12-07T17:05:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alessandro\_Zarrilli](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/alessandro_zarrilli/32/82_2.png) [@Alessandro\_Zarrilli](https://kopia.discourse.group/u/Alessandro_Zarrilli)\
**Post date:** [December 7, 2020, 5:05pm UTC](https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218/1 "2020-12-07T17:05:42Z")

</div>

Hi, I’m new to Kopia, I see it’s full of features and I’m seriously evaluating its adoption (currently I’m on duplicacy).

Since Kopia is fully feature packed, does it also have any feature to protect backups from bitrot and/or data corruption? For example, if you are going to do a restore and some file on the repository got corrupted:

1. The file will not be restored
2. The file will be restored without any warning
3. The file will be restored with a warning
4. The file will be corrected and restored

Which one?

Moreover, if a bitrot and/or data corruption is present on a repository and I syncronize it to another repository, the data error will be propagated to the target repository? Will I get any warning?

If you are using a cloud repository, I guess you should trust your storage provider to use all the measures to avoid data corruption. But if you use your own local or SFTP repository, this possible issue should be taken in account. So, depending on the risk, I will set the repository on an “heavy” but secure file system as ZFS or not.

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [December 7, 2020, 5:40pm UTC](https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218/2 "2020-12-07T17:40:40Z")

</div>

The answer is currently 1. Kopia does checksum verification on all reads which will fail in case of bitrot.

The current expectation is to have bitrot protection at the blob storage level (either cloud or ZFS/btrfs or similar) so Kopia can reg on data not becoming spontaneously mutated.

I personally use ZFS everywhere except on volatile data (DVR) that I don’t care about losing.

---

<div class="post-metadata">

**Author:** ![jkowalski](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/jkowalski/32/3_2.png) [@jkowalski](https://kopia.discourse.group/u/jkowalski)\
**Post date:** [December 8, 2020, 5:33am UTC](https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218/3 "2020-12-08T05:33:36Z")

</div>

BTW, I think it would be totally possible to implement something like [https://en.wikipedia.org/wiki/Reed–Solomon\_error\_correction](https://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction) at the File provider level (possibly SFTP and WebDAV too), so that even with Kopia on a non-fancy local filesystem you would get protection from bitrot.

---

<div class="post-metadata">

**Author:** ![stpr](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@stpr](https://kopia.discourse.group/u/stpr)\
**Post date:** [December 10, 2020, 2:21am UTC](https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218/4 "2020-12-10T02:21:47Z")

</div>

I think that would be an awesome option to have. For instance, in my case, I plan to backup everything to an external drive primarily, and I do not plan to use fancy stuff like ZFS or RAID. It would be fair to say that a reasonable chunk of people would fall in this category. So having a RS error correction option would allow for reasonable protection against low levels of data corruption.

---

<div class="post-metadata">

**Author:** ![julio](https://yyz2.discourse-cdn.com/free1/user_avatar/kopia.discourse.group/julio/32/36_2.png) [@julio](https://kopia.discourse.group/u/julio)\
**Post date:** [December 11, 2020, 1:09am UTC](https://kopia.discourse.group/t/bitrot-and-or-data-corruption-protection/218/5 "2020-12-11T01:09:05Z")

</div>

> [@jkowalski](#):
>
> The answer is currently 1. Kopia does checksum verification on all reads which will fail in case of bitrot.

It may be a good idea to also support option 3. The file will be restored with a warning. This could be controlled with a CLI flag in the restore command.
