I have sparse.img
image with the following properties:
$ file sparse.img
sparse.img: Android sparse image, version: 1.0, Total of 2512896 4096-byte output blocks in 60 input chunks.
I want to see its contents so
- I have converted it into raw image.
- Created a new directory
- Trying to mount the raw image on to the directory
using the following commands:
$ simg2img sparse.img sparse_raw.img
$ mkdir raw
$ sudo mount -t ext4 -o loop sparse_raw.img raw
First two commands run fine and I can see sparse_raw.img
generated of size larger than sparse.img
.
Last command failed with an error:
wrong fs type, bad option, bad superblock on /dev/loop27, missing codepage or helper program, or other error.
I think that may be the sparse_raw.img
is not an ext4
image but how can I sure about it?
I have tried to mount it as
- ext2, ext3 or without -t
- without -o loop but nothing works.
Please suggest a way to fix it.
file sparse_raw.img
printsdata
.hexdump -C -n1040 sparse_raw.img
prints78 ba 2a 63 7a 05 50 ed ...
so it doesn't match with 10.20.f5.f2 or 53.ef. – Vatish Sharma Feb 27 '20 at 09:37file
andhexdump
shows that it's not a filesystem. So mounting will definitely fail. Problem is with yoursparse.img
orsimg2img
, not with mounting. – Irfan Latif Feb 27 '20 at 10:27sparse.img
s and they are working fine withsimg2img
andmount
command but the one mentioned in the question and two more are not working. Any suggestions on how can I determine the problem? – Vatish Sharma Feb 27 '20 at 10:39sparse.img
? Ask them what tool they used for sparseness and compression, and what filesystem it contains. It can beext4
or rarelyf2fs
(on/system
or/vendor
). OrEROFS
in case of Huawei. Some vendors also experimented withSquashFS
. Also use a differentsimg2img
binary. Better build from latest source. – Irfan Latif Feb 27 '20 at 10:45sgs2toext4.jar
this worked instead of simg2img. Thank you guys for your help :) – Vatish Sharma Feb 27 '20 at 12:43