Thomas-Tsai / partclone

Partclone provides utilities to backup a partition smartly and it is designed for higher compatibility of the file system by using existing library.
GNU General Public License v2.0
301 stars 104 forks source link

--ignore_crc not working properly in partclone 3.12 #121

Open junkhacker opened 5 years ago

junkhacker commented 5 years ago

restoring an image created with partclone 2.89 with partclone.restore 3.12 and --ignore_crc flag enabled results in a corrupt restore to device but does not report an error restoring an image created with partclone 3.12 with partclone.restore 3.12 and --ignore_crc flag enabled results in a crc error while finishing the write to device (before it usually says SYNCING...OK) an image created with partclone 3.12 using -aX0 flag restored with partclone.restore 3.12 and --ignore_crc flag enabled works fine

porsager commented 5 years ago

Wow so glad I found this issue. I'm experiencing the very same thing. Did you find a solution / workaround?

porsager commented 5 years ago

I assume my issue here could be related: https://github.com/Thomas-Tsai/partclone/issues/109

junkhacker commented 5 years ago

this problem only occurs when you use the --ignore_crc command option when restoring an image. the new partclone format changed the checksum mechanism but i suspect that the functions for ignoring checksums were either forgot or were updated with errors. restoring an image without using the --ignore_crc command option works fine.

Sebastian-Roth commented 3 years ago

@Thomas-Tsai Working together with @junkhacker on FOG project we make heavy use of partclone and I just stumbled upon this issue again. The fix proposed by @cdeleuze might be a first step but in my tests an image captured with partclone 0.2.89 is still being corrupted when deploying it with partclone 0.3.x (currently we use 0.3.13 + 72054f1) but without any error message whatsoever.

Looking through the code and comparing images written with and without the --ignore_crc option I think I might have found why it happens. I will send in a pull request in a minute to address what I think should fix this. Please take a close look at this as I am not sure if it would cause problems in other scenarios.

Sebastian-Roth commented 3 years ago

@Thomas-Tsai @partclone Would you please take a look at the proposal to fix the issue initially reported by @junkhacker? The FOGproject heavily depends on using partclone and we'd like to contribute as good as we can.

Thomas-Tsai commented 3 years ago

sorry for the reply late. I just manual update main.c and just accept the patch from proposal to fix the issue. I will give a test and release ASAP.