How-To mount the Nexus system.img in Linux and suck stuff out of it

Jerry Hildenbrand

Space Cowboy
Staff member
Oct 11, 2009
5,569
2,797
113
Visit site
With an OTA on the horizon, I know a lot of people are gonna be looking for stock files for their Nexus. It always happens, so I figured instead of feeding you I would teach you how to fish :)

You'll need Linux. You can install it, run a live CD, or use Wubi and install as a Windows app -- any way will work.
You'll need the factory system.img for your device. You can find it inside the factory image tar file provided by Google.
You'll need the file attached to this post.

1. Create a folder in your home directory named restore
Code:
$ cd ~
$ mkdir restore
2. Place the binary that's inside the attached zip file in the restore folder
Code:
$ cp path/to/the/file/simg2img ~/restore/simg2img
3. Make sure the binary file is executable
Code:
$ chmod +x ~/restore/simg2img
4. Place the system.img file from the factory images in the restore folder
Code:
$ cp path/to/the/file/system.img ~/restore/system.img
5. Make a folder called GNEX
Code:
$ cd ~
$ mkdir GNEX
5. Change to the restore folder, and prepare the system.img for mounting
Code:
$ cd ~/restore
$ ./simg2img system.img gnex.raw
6. Mount the system image as a folder
Code:
$ sudo mount -t ext4 -o loop gnex.raw ~/GNEX/
7. Open the GNEX folder with your file manager, get anything you want from it.
8. When you're finished, unmount the image
Code:
$ sudo umount ~/GNEX/
9. Profit$$

Note that this only works with ext4 images, and has only been tested on images from Google for the Galaxy Nexus, Nexus S, and Nexus 7.
Thanks zhengkarl for the source for the simg2img binary
 

Attachments

  • simg2img.zip
    9.4 KB · Views: 88
Last edited:

Chex313

Well-known member
Oct 7, 2011
1,197
169
63
Visit site
I just want to check, as long as the image you make is ext4 its OK. It doesn't matter if the OS is ext3? Ext4 is backwards compatible. Or it doesn't matter at all how the OS is formatted...I have it ext3 to avoid an unrelated problem.
 

Trending Posts

Forum statistics

Threads
942,988
Messages
6,916,760
Members
3,158,762
Latest member
Unknown