anestisb / android-simg2img

Tool to convert Android sparse images to raw images
739 stars 202 forks source link

Invalid sparse file format at header magic Failed to read sparse file. #31

Open prakash2033 opened 3 years ago

prakash2033 commented 3 years ago

image

Why do I get above error when i use simg2img?

Please help and suggest, its quite important file.

alexenferman commented 3 years ago

Same issue here

ajdevy commented 3 years ago

the same for android 10 build

Keyezi commented 2 years ago

same

khurshid-alam commented 1 year ago

Any solution ?

Watchwolf commented 1 year ago

Same problem, any idea ?

khurshid-alam commented 1 year ago

For boot.img there is unversal Android Image Kitchen (on Linux) works for every rom. Same for recovery. Just search in xda forum.

For system images or extracted userdata images which are sparse images, they will never work on linux with broken tools like simg2img etc. Moto even add header and footer to the system images which needs to be removed before mounting in linux.

On windows there are sparseconverter which works even for non chunk images. And then you can pull data with image extractor.

You can download from cooments on this video. https://youtu.be/IgkD0idT7EI

RealYukiSan commented 3 months ago

You can download from cooments on this video. https://youtu.be/IgkD0idT7EI

The programs on the link are for Windows; is there any tool that can be used for Linux as well?

RealYukiSan commented 3 months ago

someone on https://askubuntu.com/questions/777663/how-to-solve-simg2img-error-invalid-sparse-file-format-at-header-magic tell that the error occurs because it's already raw image, how to makesure if it's raw or not?

RealYukiSan commented 3 months ago
$ simg2img system.img system.raw.img
Invalid sparse file format at header magic
Failed to read sparse file

$ file system.img
system.img: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0xfe,148,22), startsector 1, 4089855 sectors, extended partition table (last)

$ sudo mount -t erofs system.img /mnt -o loop
mount: /mnt: wrong fs type, bad option, bad superblock on /dev/loop1, missing codepage or helper program, or other error.
       dmesg(1) may have more information after failed mount system call.

$  fsck.erofs  system.img
<E> erofs: cannot find valid erofs superblock
<E> erofs: failed to read superblock

$ dump.erofs system.img
<E> erofs: cannot find valid erofs superblock
<E> erofs: failed to read superblock