extracting data from oem.img and system.img under linux

belegdol

Senior Member
Jun 25, 2012
56
38
0
Hello,

I am trying to investigate the contents of the stock rom. I have downloaded the zip and extracted it, and also converted the sparse image files to nonsparse ones with simg2img. Unfortunately, I am still unable to mount the images. No matter whether I try to mount the converted image as ext2, ext4 or f2fs, I am getting the error:
mount: /mnt/temp: wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.
Does anybody know if/how can the oreo stock images for griffin be mounted? The issue seems to be specific to motorola or oreo as I was able to mount files from nexus 5x oreo stock images without issues. Thank you for the advice.
 
Last edited:

belegdol

Senior Member
Jun 25, 2012
56
38
0
It turns out motorola images have 128kb header which needs to be removed before they can be mounted. Assuming dd's default block size of 512 bytes this gives the following:
Code:
$ dd if=system.raw.img of=system.raw.img.fixed skip=256
After that the images can be mounted.
 
  • Like
Reactions: O l l i X