4

Is it possible to intentionally corrupt a file so that BTRFS will report a checksum error? I want to test a script that's supposed to find file names with checksum errors, but I don't have any corrupt files.

EDIT: After a long time of searching I found the same question on AskUbuntu with some solutions. Unfortunately, I don't see any btrfs-corrupt-block utility, despite the fact that I have btrfs-progs installed.

  • You probably mean "corrupt a filesystem" ? – Archemar Sep 11 '14 at 18:19
  • Have you tried disk mapper device backed up by "error" target ? You can find details in this post – Vespian Sep 11 '14 at 19:37
2

That the btrfs-corrupt-block is not in the btrfs-progs packages is probably because the developers did not want the average user to accidentally start it and corrupt anything. The program is not a target in the btrfs-progs' Makefile and would not be compiled and included by a package builder unless they applied a distro specific patch first. The program is more of a testing tool for developers of btrfs.

The source however is in the main repository, you can just check that out and compile it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.