We have got a raw image of the userdata partition (/dev/block/mmcblk0p7) into userdata.raw. This file can be mounted under linux with no problems (we try read-only mount to prevent an accidental write). Then we have converted it into a sparse userdata.img image using img2simg tool. We have tested that the sparse image can be "unpacked" back into the same raw image. Then we have flashed this image using a fastboot command:
fastboot flash userdata userdata.img
and got no errors in the output. However, the filesystem appears corrupted (see below):
- If we boot into the normal android system it detects the corruption and reformats the filesystem (so all our changes are lost)
- If instead we boot into TWRP right after the fastboot flashing we see kernel error messages (in dmesg) which indicate a corrupted ext4 filesystem.
Moreover, we have compared first 100MB of userdata.raw and the one stored on the flash after fastboot flashing. At some offset we see a diff:
- userdata.raw contains lots of 0x14a87f6f words
- read back data contains lots of 0x14141414 words instead
I guess this is a damaged internal ext4 datastructure.
We have reproduced this issue on two tablets. Have anybody seen something similar and/or knows the workaround?