-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Btrfs-convert causing corruption on sectors filled with zeros (NULs) #916
Comments
Btrfs-progs version is too old. There is a known bug in convert that it doesn't handle unwritten ext4 extents (aka, preallocated), it should be filled with a hole/preallocated extent, but is treated as regular data, causing those should be zero extents to be read from disk, causing garbage. This is fixed in v6.9. And there is also a tiny fix related to convert in v6.10 (shouldn't really affect anyone though). Thus I'd recommend to retry with v6.11 (the latest release) and check if everything is fine. |
Agh, all that data collecting for nothing! hehe. Thanks for letting me know about this. I had no idea the prepackaged btrfs on the latest version of linux mint was so old. |
If you do not want to use a PPA repo or compile btrfs-progs by youself, it's recommended to use some liveCD/USB from some rolling distros, and just do the btrfs-convert from that liveCD/USB and verify. |
I'll look into getting my btrfs updated. Thanks again. |
btrfs-progs v6.6.3
I've converted at least 8 of my ext4 drives recently to btrfs with btrfs-convert, but have had problems with 2.
3 of the drives I've converted were HDDs. There were no errors reported during conversion on any of the drives. All 3 of these drives were backup drives holding disk image files, so file sizes ranged from 4GB-500GB, with a total of maybe 100-200 files each. I kept MD5 sums of all files on these drives to confirm their validity.
I didn't verify this 100% but it seemed that the only sectors that ever got corrupted were ones that were filled with just 0s (NULs). The corruption was that random sectors that were supposed to be zero-filled were instead filled with random data. I'd say well under 1% of the sectors in each file were corrupted.
On drive #3 I kept the original ext4 image (I accidentally deleted it on Drive #1). I kept 1 file as corrupted for testing purposes to hopefully solve this bug. I checked the file on the ext2_saved backup image, and it had no corruption. Only the file on the btrfs volume.
This file is ~4914.4MB large. It only had 1022 zero-filled sectors (4096 bytes each). ALL zero-filled sectors were changed to random data. Meaning 0.081% corruption.
Ope, it just happened again on a SSD drive. This drive is luks encrypted and had ~500GB total of data over ~2.5 million files. Only 1 file got corrupted. It was ~1.3MB and contained all zeros. The ext2_saved backup had it correct, the btrfs file is filled with random data from start to finish.
Is there anything I can do to help debug this problem? I'm keeping around 2 problematic files on the 2 drives so we can check the used sectors or whatnot.
The text was updated successfully, but these errors were encountered: