1 System.img.ext4
- Step-by-Step guidelines to extract files from System.img on Windows Computer using Ext4 Unpacker tool and Ext2 Explore Tool.
- HELP GS3 stuck in ODIN on system.img.ext4; Page 2 of 2 First 1 2. System.img.ext4 stuck. Click on a term to search for related topics. Tags for this Thread.
Step-by-Step guidelines to extract files from System.img on Windows Computer using Ext4 Unpacker tool and Ext2 Explore Tool.
Makeext4 How to create a flashable EXT4 img First we will clone the files needed from this git repository, from a terminal in linux, type: git clone -b master then switch to the directory where the files are stored, type: cd makeext4 Now, let's get the needed files from your phone. You can do this from an adb shell, or using a terminal app. To make it on the internal sd on Touchwiz or external on CM9 type: dd if=/dev/block/mmcblk0p9 of=/sdcard/factoryfsorig.img bs=4096 For external on Touchwiz, it would be: dd if=/dev/block/mmcblk0p9 of=/sdcard/externalsd/factoryfsorig.img bs=4096 For internal on CM9/AOSP it would be: dd if=/dev/block/mmcblk0p9 of=/emmc/factoryfsorig.img bs=4096 Now we need to copy that file to the pc, to do that, there are a couple of options. One of course, is to take out your SD Card and put it in your PC and transfer the file.
That's a hassle, so I'll cover the adb way here. Be sure to replace the path to factoryfs.img with wherever you actually put it in the last step. Connect your phone to the PC with USB Debugging on. And from the makeext4 directory in a linux terminal, type: adb pull /sdcard/factoryfsorig.img Now lets mount that img to our system directory. First we need to assign our img to a loop device, the loop number doesn't matter, only that it't available, most dual boot machines already use loop0, so if its in use, try loop1.
In your linux terminal, from the makeext4 directory type. Sudo losetup /dev/loop0./factoryfsorig.img Now let's mount our loop device as ext4 in the system folder. Sudo mount -t ext4 /dev/loop0./system Now before we make our image, we need to fill the image to the end with something, to replace the junk padding it currently has from the way it was pulled. Internet manager crackli indir gezginler. We will do that by creating an image, and wiping it.
From your linux terminal in the system directory under makeext4, type: sudo./bin/mkuserimg.sh -w system factoryfs.img ext4 system 503mb Now that we have mounted the files into the system folder, and prepared them, we are going to run a script, that makes a sparse ext4 image of exactly 503mb named factoryfs.img, thats to be mounted on /system. Sparse is important, because what that does, is makes a 503mb img much smaller, because the empty space used to make the img 503mb isnt filled with padding. Tech info: 'a sparse file is a type of computer file that attempts to use file system space more efficiently when blocks allocated to the file are mostly empty. This is achieved by writing brief information (metadata) representing the empty blocks to disk instead of the actual 'empty' space which makes up the block, using less disk space.
The full block size is written to disk as the actual size only when the block contains 'real' (non-empty) data.' From your linux terminal, in the makeext4 directory, type: sudo./bin/mkuserimg.sh -s system factoryfs.img ext4 system 503mb After that you will have a flashable, sparse ext4 image in your directory named factoryfs.img. Now should you, in the future, want to edit this img instead of creating a new one, I'll go over the steps with you.
Place the factoryfs.img that you want to edit back into the makeext4 directory. Then we will need to un-sparsify (is that really a word?) it by typing:./bin/simg2img factoryfs.img temp.img At this point, you don't need the factoryfs.img anymore, so you can delete it by typing: rm factoryfs.img (optional, but you atleast need to rename or move it) Now we will assign that img to a loop device on the system, in this example I use loop0, but on most dualboot systems loop0 is used, you can use any loop# that is available to you, it doesnt matter. From your linux terminal, in the makeext4 directory type: sudo losetup /dev/loop0 temp.img Now we need to mount that device we just assigned the img to. We should run it as superuser (sudo), mount it as ext4 (-t ext4), and we want to mount it to the system directory inside our current directory (./system).
Type: sudo mount -t ext4 /dev/loop0./system You've gotten this far. You're almost done. You should now have your system files in makeext4/system. Go ahead and make any changes you need to make, be careful about permissions.
Missing System Img
Remember android is linux based and relies heavily on permissions. When you are done, we need to turn that system directory back into a sparse ext4 img. In a linux terminal, from the makeext4 directory, type: sudo./bin/mkuserimg.sh -s system factoryfs.img ext4 system 503mb You can go ahead and unmount the files now. Sudo umount./system And detach the image from that loop device.
Sudo losetup -d /dev/loop0 And, delete the unsparse ext4 image. Or you can save that if you would like, as it does have your changes, but remember its not flashable, but saving it will mean you only have to bind it to a loop device and mount it, then make it sparse each time you want to make changes. Rm temp.img Now at this point, you are either extremely bored. Or you have a flashable ext4 image. Hopefully the latter.
PROTIP: You can add the -J option to mkuserimg.sh to disable journaling on your ext4 image. ALternatively, you can use the -z option to gzip the image.