Skip to content
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

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

Open
prakash2033 opened this issue Nov 6, 2020 · 9 comments

Comments

@prakash2033
Copy link

image

Why do I get above error when i use simg2img?

Please help and suggest, its quite important file.

@alexenferman
Copy link

Same issue here

@ajdevy
Copy link

ajdevy commented Feb 21, 2021

the same for android 10 build

@Keyezi
Copy link

Keyezi commented Aug 20, 2022

same

@khurshid-alam
Copy link

Any solution ?

@Watchwolf
Copy link

Same problem, any idea ?

@khurshid-alam
Copy link

khurshid-alam commented Oct 19, 2023

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

@realyukii
Copy link

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?

@realyukii
Copy link

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?

@realyukii
Copy link

realyukii commented Jul 19, 2024

$ 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants