I have created an image of my Android device (Lenovo A6000) using the command
adb shell -c su 'dd if=/dev/block/mmcblk0p23 > data.img'
Now I would like to flash this image to the same device, and I am trying to accomplish this using fastboot in the following way
sudo fastboot flash data data.img
I am using the latest version of fastboot shipped with Android's SDK.
Doing the above command I get the error
target reported max download size of 268435456 bytes Invalid sparse file format at header magi error: write_sparse_skip_chunk: don't care size 4894735982 is not a multiple of the block size 4096 fastboot: ../libsparse/sparse.c:143: write_all_blocks: Assertion `pad >= 0' failed.
I suspect it has something to do with the sizes, the image appears to have size ~5GB while the reported max download size appears to be ~2GB.
But I am not sure what the real error is and how to fix it?
Can someone tell me where the mistake is and how to solve it? It seems that if I make a smaller image I can flash it properly.