[Q] To devs... How to extract System.img

Search This thread

Nokia7Vista

Inactive Recognized Developer
Nov 3, 2009
269
403
28
East-Riffa
www.youtube.com
Hi guys..

Sorry If I'm posting this in the wrong section...

But can anyone guide me how to extract System.img from a Stock ROM as I'm planning to cook a custom ROM

If you would like to see some of my previous work for SGS1 look at my signature
 

pkoper

Senior Member
Oct 15, 2006
1,141
562
NRW
You can try unyaffs in a cygwin environment or wunyaffs which is for windows.
For some reason I get access violation errors with stock roms for the Tab.
With HTC roms it was possible to dump the system.img with magiciso. Again with Tab roms this no longer works.
 
  • Like
Reactions: Nokia7Vista

mabalito

Senior Member
Aug 5, 2009
164
267
In CWM, after mounting /system:
make_ext4fs -l 568m -s /sdcard/system.img /system

This gives you a sparse system.img which you can turn into a Linux-mountable ext4 image with simg2img
 
  • Like
Reactions: Nokia7Vista

jamezelle

Retired Forum Mod / Retired Recognized Developer
Nov 4, 2007
1,712
100
Ohio
www.jamezelle.com
In Linux you can do

mkdir tmp
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
sudo umount ./tmp

Sent from my Samsung Galaxy Tab 10.1 using Tapatalk
 
  • Like
Reactions: Nokia7Vista

Nokia7Vista

Inactive Recognized Developer
Nov 3, 2009
269
403
28
East-Riffa
www.youtube.com
In Linux you can do

mkdir tmp
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
sudo umount ./tmp

Sent from my Samsung Galaxy Tab 10.1 using Tapatalk

I'm getting an error

Code:
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
 

mabalito

Senior Member
Aug 5, 2009
164
267
I'm getting an error

Code:
sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

See the message I posted up above? You have to run the system.img through simg2img to make it mountable.

Sent from my Samsung Galaxy Tab 10.1
 

maniac3389

Senior Member
Jan 30, 2007
102
12
You could always create a regular (non-sparse) image file using dd then mount it.

Command should be similar to ****, though I'm not sure if the busybox version of dd accepts bs=1M, it may require bs=1048576. (That's MB converted to B) And count is the number of MB you want the image to be.
Code:
dd if=/dev/zero of=squeeze.img bs=1M count=512

Then mount it like this:
Code:
mount -o loop,noatime -t ext4 /sdcard/debian/squeeze.img /data/local/debian/

*Pulled from a thread I wrote awhile back, you may be able to get away without using the "noatime" option.
 
  • Like
Reactions: Nokia7Vista

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    You can try unyaffs in a cygwin environment or wunyaffs which is for windows.
    For some reason I get access violation errors with stock roms for the Tab.
    With HTC roms it was possible to dump the system.img with magiciso. Again with Tab roms this no longer works.
    1
    In CWM, after mounting /system:
    make_ext4fs -l 568m -s /sdcard/system.img /system

    This gives you a sparse system.img which you can turn into a Linux-mountable ext4 image with simg2img
    1
    In Linux you can do

    mkdir tmp
    sudo mount -o loop -t ext4 system.img ./tmp && cp -r ./tmp/* ./system/
    sudo umount ./tmp

    Sent from my Samsung Galaxy Tab 10.1 using Tapatalk
    1

    Hope this helps and welcome to the GT10.1 forum :)

    Sent from my Samsung Galaxy Tab 10.1
    1
    You could always create a regular (non-sparse) image file using dd then mount it.

    Command should be similar to ****, though I'm not sure if the busybox version of dd accepts bs=1M, it may require bs=1048576. (That's MB converted to B) And count is the number of MB you want the image to be.
    Code:
    dd if=/dev/zero of=squeeze.img bs=1M count=512

    Then mount it like this:
    Code:
    mount -o loop,noatime -t ext4 /sdcard/debian/squeeze.img /data/local/debian/

    *Pulled from a thread I wrote awhile back, you may be able to get away without using the "noatime" option.