[MOD] Increase your SYSTEM partition to 2.5GB , Boot to 30MB , Recovery to 30MB for Y - YU Yureka Q&A, Help & Troubleshooting

Finally your and MY wait is over Hear @I Putu Tirta Agung S & @Annabathina are introducing that HOW TO INCREASE YUREKA / PLUS PARTITIONS ........
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I & @I Putu Tirta Agung S are not responsible for anything that may happen to your phone as a result of following this guide / installing custom roms and/or kernels. you do so at your own risk and take the responsibility upon yourself. ​​
NOTE : Please read hole thread before starting........
Preface
This guide has been tested to work on Lollipop and Marshmallow. By following this guide, you will resize your boot, system, cache, and recovery partition to the new partition size as can be seen below:
This guide is quite safe as it doesn't change the emmc GUID and its unique partitions GUID, which is hard coded into our Yureka's non-HLOS (High Level Operating System).
The Guides
Backing up important partitions ( Very very important )
Go to TWRP (please use the newest, or at minimal Abhishek's 3.0.1-0), and when you are in it run "adb shell" from your computer using " ADB+&+Fastboot of yureka " by " Hold shift key and right click on mouse and select Open command window here " then type below lines ONE BY ONE (remember to do it line by line)
Code:
[SIZE="4"]dd if=/dev/block/mmcblk0 of=/sdcard/gpt.bin bs=512 count=34
adb shell dd if=/dev/block/mmcblk0p1 of=/sdcard/modem
adb shell dd if=/dev/block/mmcblk0p2 of=/sdcard/sbl1
adb shell dd if=/dev/block/mmcblk0p3 of=/sdcard/sbl1bak
adb shell dd if=/dev/block/mmcblk0p4 of=/sdcard/aboot
adb shell dd if=/dev/block/mmcblk0p5 of=/sdcard/abootbak
adb shell dd if=/dev/block/mmcblk0p6 of=/sdcard/rpm
adb shell dd if=/dev/block/mmcblk0p7 of=/sdcard/rpmbak
adb shell dd if=/dev/block/mmcblk0p8 of=/sdcard/tz
adb shell dd if=/dev/block/mmcblk0p9 of=/sdcard/tzbak
adb shell dd if=/dev/block/mmcblk0p10 of=/sdcard/hyp
adb shell dd if=/dev/block/mmcblk0p11 of=/sdcard/hypbak
adb shell dd if=/dev/block/mmcblk0p12 of=/sdcard/pad
adb shell dd if=/dev/block/mmcblk0p13 of=/sdcard/modemst1
adb shell dd if=/dev/block/mmcblk0p14 of=/sdcard/modemst2
adb shell dd if=/dev/block/mmcblk0p15 of=/sdcard/misc
adb shell dd if=/dev/block/mmcblk0p16 of=/sdcard/fsc
adb shell dd if=/dev/block/mmcblk0p17 of=/sdcard/ssd
adb shell dd if=/dev/block/mmcblk0p18 of=/sdcard/DDR
adb shell dd if=/dev/block/mmcblk0p19 of=/sdcard/fsg
adb shell dd if=/dev/block/mmcblk0p20 of=/sdcard/sec
adb shell dd if=/dev/block/mmcblk0p22 of=/sdcard/params
adb shell dd if=/dev/block/mmcblk0p23 of=/sdcard/panic
adb shell dd if=/dev/block/mmcblk0p24 of=/sdcard/autobak
adb shell dd if=/dev/block/mmcblk0p26 of=/sdcard/persist[/SIZE]
Copy all files from internal storage (sdcard) to your computer, keep them safe as they are very important if something bad happens.
Doing the magic
Download and extract "gpt.zip" attached in this post, and copy the "gpt.bin" file to the root of your internal storage (internal sdcard).
1. Go back to TWRP and run "adb shell" again from your computer, then type:
2. Go back to TWRP and run "adb shell" again from your computer, then type:
dd if=/sdcard/gpt.bin of=/dev/block/mmcblk0 bs=512 count=34
Click to expand...
Click to collapse
3. After all done, reboot to your bootloader and flash your recovery (TWRP) by typing:
fastboot -i 0x1ebf erase recovery
fastboot -i 0x1ebf flash recovery TheNameofYourRecovery.img
Click to expand...
Click to collapse
4. After that, type below commands (remember to do it line by line):
fastboot -i 0x1ebf oem unlock
fastboot -i 0x1ebf erase boot
fastboot -i 0x1ebf format cache
fastboot -i 0x1ebf format userdata
fastboot -i 0x1ebf format system
fastboot -i 0x1ebf reboot-bootloader
fastboot -i 0x1ebf boot recovery
Click to expand...
Click to collapse
5. After booting to TWRP, wipe everything again (system, data, cache, dalvik, internal storage)
6. Reboot the phone to TWRP again.
7. Copy your original "params", "panic", "autobak", and "persist" files you backed up earlier to the root of your internal storage (internal sdcard) and run "adb shell" again from your computer, then type:
adb shell dd if=/sdcard/params of=/dev/block/mmcblk0p22
adb shell dd if=/sdcard/panic of=/dev/block/mmcblk0p23
adb shell dd if=/sdcard/autobak of=/dev/block/mmcblk0p24
adb shell dd if=/sdcard/persist of=/dev/block/mmcblk0p26
Click to expand...
Click to collapse
This step is very important, so don't miss it or you will hard bricked your god damn phone.
8. After all done, reboot to your bootloader and type again below codes (remember to do it line by line):
fastboot -i 0x1ebf oem unlock
fastboot -i 0x1ebf erase boot
fastboot -i 0x1ebf format cache
fastboot -i 0x1ebf format userdata
fastboot -i 0x1ebf format system
fastboot -i 0x1ebf reboot-bootloader
fastboot -i 0x1ebf boot recovery
Click to expand...
Click to collapse
After booting to TWRP, wipe everything again (system, data, cache, dalvik, internal storage)
9. Reboot the phone to TWRP again.
Troubleshooting
Wallah, now you have 2.5 GB of system partition, 150 MB (it will be usefull if you use f2fs file system) cache partition, 30 MB of recovery partition, 30 MB of boot partition, and around 11.77 GB of data partition.
Oh btw, if you flash "userdata.img" from COS or CM roms, you will get something similar to this:
target reported max download size of 268435456 bytes
erasing 'userdata'...
OKAY [ 8.440s]
sending 'userdata' (137434 KB)...
OKAY [ 5.164s]
writing 'userdata'...
FAILED (remote: image size too large)
finished. total time: 13.634s
Click to expand...
Click to collapse
Why? Because now your data partition is approximately 1.5 GB smaller. So just relax, if you got that kind of warning.
Furthermore, because a lot of devs use that ****in ".dat" files ****ty thing ("system.new.dat", "system.patch.dat" and "system.transfer.list"), if you flash their roms (such as CM, AICP, Exodus, bla bla bla), you will see that your partition will go back to its original value. But not to worry, it is not the real value of what is really use. It is because of the nature on how sparse ext4 image is compiled, they need to set the partition size before compiling, and of course they use the old one, not the one we have changed.
So to overcome this problem, you need to do it the hard way, explained in the second post below. However, if you don't want the hazzle then just flash AOSParadox or YuOS (the TWRP version, not the fastboot one) or Mokee or any rom that doen't have "system.new.dat", "system.patch.dat" and "system.transfer.list" in its zip file, as they will read the new partition size just fine.
ADB+&+Fastboot : link
Partition changer : link
Back up code PNG : link
Device Driver installation links
ADB for pc : link
YU usb drivers : link
PdaNet drivers : link
@I Putu Tirta Agung S MY friend for every thing ( NOTE : YOUR the best HACKER that I ever met )
@Annabathina

If you want the hard way in changing ROMs with ****in ".dat" files ****ty thing ("system.new.dat", "system.patch.dat" and "system.transfer.list") to read the new partition size, then you need Ubuntu with the latest kernel (that has the latest patch on "Transparent Compression", see this post), and follow these steps (thanks to xpirt for his guide):
Step 1 - Decompressing = DAT (sparse data) -> EXT4 (raw image)
We're now using sdat2img binary, the usage is very simple (make sure you have python 3.x installed):
Code:
./sdat2img.py <transfer_list> <system_new_file> <system_ext4>- <transfer_list> = input, system.transfer.list from rom zip
<system_new_file> = input, system.new.dat from rom zip
<system_ext4> = output ext4 raw image file
and a quick example of usage:
Code:
./sdat2img.py system.transfer.list system.new.dat system.img
by running this command you will get as output the file my_new_system.img which is the raw ext4 image.
Step 2 - Decompress EXT4 (raw image) -> OUTPUT folder -> Compress EXT4 (raw image)
Now we need to mount or ext4 raw image into an output folder so we can see apks/jars etc. To do this we need to type this command:
Code:
sudo mount -t ext4 -o loop system.img output/
As you can see there is a new folder called output which we can edit/modify/delete your files (not able to? see here)
Now we need to compress it back to a raw ext4 image, to do this we need the make_ext4fs binary. Make sure you have the file_contexts file (taken from the Rom zip) inside the make_ext4fs path. Then type this (got issues? see here).
Code:
/make_ext4fs -T 0 -S file_contexts -l 2684354560 -a system system_new.img output/
The value of 2684354560 in above code is the new size of system partition in Bytes. Upon doing the above processes, you will get the new raw ext4 image called 'system_new.img' ready for the next step.
Step 3 - Converting = EXT4 (raw image) -> DAT (sparse data)
Now we need the rimg2sdat binary, the usage is very simple:
Code:
./rimg2sdat <system_img>
<system_img> = name of input ext4 raw image file
and a quick example of usage:
Code:
./rimg2sdat my_new_system.img
As you can see the output is composed by system.transfer.list, (system.patch.dat) & system.new.dat, ready to be replaced inside your Rom zip.
Just to make it really simple
1. Fire up your beloved ubuntu, make sure you have python 3.x installed.
2. Download "sdat2img.py", "make_ext4fs", and "rimg2sdat" binaries, and put it inside a folder (use a file manager for god sake). We can name the folder "****inGreat".
3. Now make an empty folder inside "****inGreat" folder, and name it "output".
4. Extract "system.new.dat", "system.patch.dat", "system.transfer.list", and "file_contexts" from your beloved rom's zip file, and put it inside "****inGreat" folder.
5. Now open "****inGreat" folder with root privilege, then open terminal (we call it cmd in windows) from there.
6. type below code on the terminal (one line at a time):
Code:
./sdat2img.py system.transfer.list system.new.dat system.img (press enter)
sudo mount -t ext4 -o loop system.img output/ (press enter)
/make_ext4fs -T 0 -S file_contexts -l 2684354560 -a system system_new.img output/ (press enter)
./rimg2sdat my_new_system.img (press enter)
7. Now copy the new "system.new.dat", "system.patch.dat", "system.transfer.list", and "file_contexts" inside "****inGreat" folder back to your beloved rom's zip file.
8. Flash the rom via TWRP
9. And you are good to go.
10. Ain't that simple!!!!!!!!!!!!!
sdat2img.py
- github.com
make_ext4fs
- mega.co.nz
rimg2sdat
- mega.co.nz

@I Putu Tirta Agung S MY friend for every thing ( NOTE : YOUR the best HACKER that I ever met )
@Annabathina

Guys I have tested it for 5 times before posting
Thank to @I Putu Tirta Agung S for everything ​​

reserved

reserved for future post

Related

[HOW TO] Fix "Failure to mount" sdcard, system, data or cache

**IMPORTANT**
Read this thoroughly before you attempt any of it. The steps found herein will wipe out any data remaining on the partition for which it's used. If a partition has lost it's formatting, chances are the data is lost anyway, so there's not much more you can lose. This should be thought of as a last resort. Do not attempt this until you have tried everything else.
In many cases, just wiping the affected partition in recovery is enough to fix the problem. If not, continue reading.
If it's your sdcard that needs to be mounted, there is one thing you can try that might work in most cases.
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] echo /dev/block/mmcblk0p12 >> /sys/devices/platform/usb_mass_storage/lun0/file
Your computer will probably respond that the volume/device needs formatted before using it. This will erase everything left on the sdcard, as will anything else you attempt in this thread.
* Choose a quick format (if possible) and format it as "fat32", block size "4096".
If that doesn't work...
You'll have to reset your partition table, just in case (this step is optional but it doesn't hurt to do it anyway).
You'll need to be in fastboot:
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] idme bootmode 4002
[COLOR=Gray]~ #[/COLOR] reboot
(*COTR recovery doesn't have idme so you'll have to use the recovery itself to reboot into the bootloader)
Once in fastboot, enter the following commands...
Code:
[COLOR=Gray]$[/COLOR] fastboot oem format
[COLOR=Gray]$[/COLOR] fastboot oem idme bootmode 5001
[COLOR=Gray]$[/COLOR] fastboot reboot
With your partition table reset, it's time to print your partition table for reference.
For this, your device must be booted into recovery.
To print your partition table:
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] print
This will print the layout of your partitions 1-12. It should look something like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If you receive an error stating that parted can't be found, you need to find and download it and enter the following commands, or update your recovery...
Code:
[COLOR=Gray]$[/COLOR] adb push /path/to/parted /sbin/parted
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] chown 0.0 /sbin/parted
[COLOR=Gray]~ #[/COLOR] chown 755 /sbin/parted
(*replace "/path/to/parted" with the full path to the parted binary downloaded to your computer)
Once you have your partition table printed out, copy and save it to a text file for later use.
When looking at the partition table, pay close attention to the file systems of the system, userdata, cache and media partitions. System, data and cache, should have an "ext4" formatting, while media should have a "fat32" formatting. The partitions that are missing the proper formatting are the ones you need to focus on because they need to be removed and repartitioned.
----------------------------------------------------------------------------------------------------------------------------------------
NEVER MESS WITH ANYTHING OTHER THAN SYSTEM, DATA, CACHE AND MEDIA!!!
----------------------------------------------------------------------------------------------------------------------------------------
The following, are the steps to repartition the system, data, and cache partitions. Media (sdcard) will have it's own steps so don't get them mixed up. These same steps will be used for each of the system data and cache partitions except you'll substitute the variables (in green) with the values for that particular partition. Be careful NOT to get the any of numbers mixed up or confused or you could potentially do serious damage to your device.
Code:
[COLOR=Gray]$[/COLOR] abd shell
[COLOR=Gray]~ #[/COLOR] umount [COLOR=SeaGreen]"directory_name"[/COLOR] [COLOR=Red]<---- This command is to make sure the volume isn't already mounted. If you get an error, it just means there is no volume mounted. Disregard.[/COLOR]
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] rm [COLOR=SeaGreen]"partition_number"[/COLOR]
[COLOR=Gray](parted)[/COLOR] mkpart primary [COLOR=SeaGreen]"startblock" "endblock"[/COLOR]
[COLOR=Gray](parted)[/COLOR] name [COLOR=SeaGreen]"partition_number" "partition_name"[/COLOR]
[COLOR=Gray](parted)[/COLOR] quit
[COLOR=Gray]~ #[/COLOR] mke2fs -t ext4 /dev/block/mmcblk0p[COLOR=SeaGreen]"partition_number"[/COLOR]
[COLOR=Gray]~ #[/COLOR] mount [COLOR=SeaGreen]"directory_name"[/COLOR]
The values for the previous command variables are as follows...
SYSTEM
-------------------------------
"partition_number"= 9
"directory_name" = /system
"partition_name" = system
"startblock" = 312
"endblock" = 849
DATA
-------------------------------
"partition_number"= 10
"directory_name" = /data
"partition_name" = userdata
"startblock" = 849
"endblock" = 2041
CACHE
-------------------------------
"partition_number"= 11
"directory_name" = /cache
"partition_name" = cache
"startblock" = 2041
"endblock" = 2309
For example, in order to fix the DATA partition, the commands would be written like this...
Code:
[COLOR=Gray]$[/COLOR] abd shell
[COLOR=Gray]~ #[/COLOR] umount /data
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] rm 10
[COLOR=Gray](parted)[/COLOR] mkpart primary 849 2041
[COLOR=Gray](parted)[/COLOR] name 10 userdata
[COLOR=Gray](parted)[/COLOR] quit
[COLOR=Gray]~ #[/COLOR] mke2fs -t ext4 /dev/block/mmcblk0p10
[COLOR=Gray]~ #[/COLOR] mount /data
The following are the steps to repartition the media (sdcard) partition.
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] umount /sdcard [COLOR=Red]<----Same as before. If you receive an error on this command, just disregard it.[/COLOR]
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] rm 12
[COLOR=Gray](parted)[/COLOR] mkpartfs primary fat32 2309 7690
[COLOR=Gray](parted)[/COLOR] rm 12
[COLOR=Gray](parted)[/COLOR] mkpart primary 2309 7690
[COLOR=Gray](parted)[/COLOR] name 12 media
[COLOR=Gray](parted)[/COLOR] quit
[COLOR=Gray]~ #[/COLOR] mount /sdcard
Once again, any partitions on which these commands are used, will lose any data left on them, but chances are it's your only option. Pay very close attention to what you are doing and be very cautious of typos. Accidentally entering /dev/block/mmcblk0p2' instead of "/dev/block/mmcblk0p12" will brick your device, to the point of needing to pull the back cover off and shorting it...well...let's just say you don't want to have to do that.
Afterwards you should be able to mount the effected partitions in recovery.
Be careful, and good luck.
Refrences:
http://forum.xda-developers.com/showpost.php?p=26285877&postcount=12
http://forum.xda-developers.com/showthread.php?t=1651413
http://forum.xda-developers.com/showthread.php?t=1497900
Thanks to kinfauns for showing me that it isn't always necessary to create an "ext2" file system first and then convert it to "ext4", and for showing me how to get rid of the pesky msftres flags.
Great work, sticky and Thank You.
Thank you bigjoe2675 and thank you soupmagnet for you fine work!!
soupmagnet said:
**IMPORTANT**
Read this thoroughly before you attempt any of it. The steps found herein will wipe out any data remaining on the partition for which it's used. If a partition has lost it's formatting, chances are the data is lost anyway, so there's not much more you can lose. This should be thought of as a last resort. Do not attempt this until you have tried everything else.
In many cases, just wiping the affected partition in recovery is enough to fix the problem. If not, continue reading.
If it's your sdcard that needs to be mounted, there is one thing you can try that might work in most cases.
Code:
[COLOR="Gray"]$[/COLOR] adb shell
[COLOR="Gray"]~ #[/COLOR] echo /dev/block/mmcblk0p12 >> /sys/devices/platform/usb_mass_storage/lun0/file
Your computer will probably respond that the volume/device needs formatted before using it. This will erase everything left on the sdcard, as will anything else you attempt in this thread.
* Choose a quick format (if possible) and format it as "fat32", block size "4096".
If that doesn't work...
You'll have to reset your partition table, just in case (this step is optional but it doesn't hurt to do it anyway).
You'll need to be in fastboot:
Code:
[COLOR="Gray"]$[/COLOR] adb shell
[COLOR="Gray"]~ #[/COLOR] idme bootmode 4002
[COLOR="Gray"]~ #[/COLOR] reboot
(*COTR recovery doesn't have idme so you'll have to use the recovery itself to reboot into the bootloader)
Once in fastboot, enter the following commands...
Code:
[COLOR="Gray"]$[/COLOR] fastboot oem format
[COLOR="Gray"]$[/COLOR] fastboot oem idme bootmode 5001
[COLOR="Gray"]$[/COLOR] fastboot reboot
With your partition table reset, it's time to print your partition table for reference.
For this, your device must be booted into recovery.
To print your partition table:
Code:
[COLOR="Gray"]$[/COLOR] adb shell
[COLOR="Gray"]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR="Gray"](parted)[/COLOR] print
This will print the layout of your partitions 1-12. It should look something like this:
View attachment 1421197
If you receive an error stating that parted can't be found, you need to find and download it and enter the following commands, or update your recovery...
Code:
[COLOR="Gray"]$[/COLOR] adb push /path/to/parted /sbin/parted
[COLOR="Gray"]$[/COLOR] adb shell
[COLOR="Gray"]~ #[/COLOR] chown 0.0 /sbin/parted
[COLOR="Gray"]~ #[/COLOR] chown 755 /sbin/parted
(*replace "/path/to/parted" with the full path to the parted binary downloaded to your computer)
Once you have your partition table printed out, copy and save it to a text file for later use.
When looking at the partition table, pay close attention to the file systems of the system, userdata, cache and media partitions. System, data and cache, should have an "ext4" formatting, while media should have a "fat32" formatting. The partitions that are missing the proper formatting are the ones you need to focus on because they need to be removed and repartitioned.
----------------------------------------------------------------------------------------------------------------------------------------
NEVER MESS WITH ANYTHING OTHER THAN SYSTEM, DATA, CACHE AND MEDIA!!!
----------------------------------------------------------------------------------------------------------------------------------------
The following, are the steps to repartition the system, data, and cache partitions. Media (sdcard) will have it's own steps so don't get them mixed up. These same steps will be used for each of the system data and cache partitions except you'll substitute the variables (in green) with the values for that particular partition. Be careful NOT to get the any of numbers mixed up or confused or you could potentially do serious damage to your device.
Code:
[COLOR="Gray"]$[/COLOR] abd shell
[COLOR="Gray"]~ #[/COLOR] umount [COLOR="SeaGreen"]"directory_name"[/COLOR]
[COLOR="Gray"]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR="Gray"](parted)[/COLOR] rm [COLOR="SeaGreen"]"partition_number"[/COLOR]
[COLOR="Gray"](parted)[/COLOR] mkpart primary [COLOR="SeaGreen"]"startblock" "endblock"[/COLOR]
[COLOR="Gray"](parted)[/COLOR] name [COLOR="SeaGreen"]"partition_number" "partition_name"[/COLOR]
[COLOR="Gray"](parted)[/COLOR] quit
[COLOR="Gray"]~ #[/COLOR] mke2fs -t ext4 /dev/block/mmcblk0p[COLOR="SeaGreen"]"partition_number"[/COLOR]
[COLOR="Gray"]~ #[/COLOR] mount [COLOR="SeaGreen"]"directory_name"[/COLOR]
The values for the previous command variables are as follows...
SYSTEM
-------------------------------
"partition_number"= 9
"directory_name" = /system
"partition_name" = system
"startblock" = 312
"endblock" = 849
DATA
-------------------------------
"partition_number"= 10
"directory_name" = /data
"partition_name" = userdata
"startblock" = 849
"endblock" = 2041
CACHE
-------------------------------
"partition_number"= 11
"directory_name" = /cache
"partition_name" = cache
"startblock" = 2041
"endblock" = 2309
For example, in order to fix the DATA partition, the commands would be written like this...
Code:
[COLOR="Gray"]$[/COLOR] abd shell
[COLOR="Gray"]~ #[/COLOR] umount /data
[COLOR="Gray"]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR="Gray"](parted)[/COLOR] rm 10
[COLOR="Gray"](parted)[/COLOR] mkpart primary 312 849
[COLOR="Gray"](parted)[/COLOR] name 10 userdata
[COLOR="Gray"](parted)[/COLOR] quit
[COLOR="Gray"]~ #[/COLOR] mke2fs -t ext4 /dev/block/mmcblk0p9
[COLOR="Gray"]~ #[/COLOR] mount /data
The following are the steps to repartition the media (sdcard) partition.
Code:
[COLOR="Gray"]$[/COLOR] adb shell
[COLOR="Gray"]~ #[/COLOR] umount /sdcard
[COLOR="Gray"]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR="Gray"](parted)[/COLOR] rm 12
[COLOR="Gray"](parted)[/COLOR] mkpartfs primary fat32 2309 7690
[COLOR="Gray"](parted)[/COLOR] rm 12
[COLOR="Gray"](parted)[/COLOR] mkpart primary 2309 7690
[COLOR="Gray"](parted)[/COLOR] name 12 media
[COLOR="Gray"](parted)[/COLOR] quit
[COLOR="Gray"]~ #[/COLOR] mount /sdcard
Once again, any partitions on which these commands are used, will lose any data left on them, but chances are it's your only option. Pay very close attention to what you are doing and be very cautious of typos. Accidentally entering /dev/block/mmcblk0p2' instead of "/dev/block/mmcblk0p12" will brick your device, to the point of needing to pull the back cover off and shorting it...well...let's just say you don't want to have to do that.
Afterwards you should be able to mount the effected partitions in recovery.
Be careful, and good luck.
Refrences:
http://forum.xda-developers.com/showpost.php?p=26285877&postcount=12
http://forum.xda-developers.com/showthread.php?t=1651413
http://forum.xda-developers.com/showthread.php?t=1497900
Thanks to kinfauns for showing me that it isn't always necessary to create an "ext2" file system first and then convert it to "ext4", and for showing me how to get rid of the pesky msftres flags.
Click to expand...
Click to collapse
The first method doesn't work, so as you said, i'l have to boot into fastboot.
But it says "idme not found"
Please help.
Noob.
I have attached some pics for more information.
A guide for getting into fastboot:
http://forum.xda-developers.com/showthread.php?t=1668159
[edit:] BTW This guide is for the Kindle Fire. On other devices your partition layout will likely be different. Try the forums for your particular device.
"That's a special kind of stupid. The kind that makes me laugh."
I didnt use this guide (although I read it all and was about to go this route) big thanks!
Got a question though , at one point I had (i guess temp root privelidges) because I sideloaded but in root explorer I didnt have su , anyway , in KFU there was a section that said you could change mount to write , although thats nots root , would I have been able to use the adb to push commands to the kindle? I wanted to get into the file explorer and just use usb mass storage to put files in and maybe gain root that way ?
*I realize :"That's a special kind of stupid. The kind that makes me laugh."but I thought Id ask anyway!!!
Vintage144 said:
I didnt use this guide (although I read it all and was about to go this route) big thanks!
Got a question though , at one point I had (i guess temp root privelidges) because I sideloaded but in root explorer I didnt have su , anyway , in KFU there was a section that said you could change mount to write , although thats nots root , would I have been able to use the adb to push commands to the kindle? I wanted to get into the file explorer and just use usb mass storage to put files in and maybe gain root that way ?
*I realize :"That's a special kind of stupid. The kind that makes me laugh."but I thought Id ask anyway!!!
Click to expand...
Click to collapse
LOL that does make me laugh, but not for reasons you'd think. Actually the USB mass storage is only the sdcard (media) partition. Mounting the sdcard to USB or side loading apps only gives you access to the sdcard, which you already have write permissions for anyway. You can't cross over to other partitions without mounting them first and you need to be the root user to do that. With the sdcard being secluded from the system partition, in order to get root permissions you need to be the root user or have write permissions on the system partition, at least temporarily.
On the original Kindle Fire you can get that through custom recovery, which has root permissions, or through some exploit found in Gingerbread. That's what makes Pokey9000's 'fbmode' so slick. It gives users access to fastboot, which in turn gives them access to flash a custom recovery and gain root permissions (KFU uses this) long enough to write SU and Superuser.apk to the system partition, eliminating the need for an exploit in Gingerbread.
These days, root exploits in Android are few and far between and they are getting patched pretty regularly, so the ability to install and boot onto custom recovery is pretty valuable. I imagine that's why Amazon used OMAP HS on the second generation devices in an (obviously feeble) attempt to patch such a gaping hole in their security.
The only reason. I say this , is because on my a500 I have a microsd card that I can transfer files to and from (granted I have root) however I had access to android folders ,I just thought as a last resort I could gain access that way,
I've noticed something funny on xda ,99% of people who have problems here have the same response "my friends device isn't working" I'm betting that means there device and instead of actually reading all the material available they just read one post and tried whatever the op said not realizing there's a process to everything the devs do and reason why we must follow directions! Writing can you fix my fubar is bs ,there's tons of info in hear ya just gotta look for it
Sent from my SAMSUNG-SGH-I717 using xda app-developers app
Well I tried all this. At the beginning it worked. But on every reboot or use, its just doesn't reconise the sdcard anymore.
format/reinstall/ play with it 10 minute/freeze/sd card cant read
format/reinstall/play with it 5 minuts/freeze/sdcant read
etc
at the end nothing's working.
On my last attemp I put the original rom.
Amazone give me a new one. sd card has probably bad sector.
---- Is there a way to prevent this trouble ?? ---
thanks
oVeRdOsE. said:
Well I tried all this. At the beginning it worked. But on every reboot or use, its just doesn't reconise the sdcard anymore.
format/reinstall/ play with it 10 minute/freeze/sd card cant read
format/reinstall/play with it 5 minuts/freeze/sdcant read
etc
at the end nothing's working.
On my last attemp I put the original rom.
Amazone give me a new one. sd card has probably bad sector.
---- Is there a way to prevent this trouble ?? ---
thanks
Click to expand...
Click to collapse
One way to check to see if your sdcard has bad sectors is with the following command:
Code:
adb shell dd if=/sdcard of=/dev/null
If it doesn't respond for more than 10 minutes, then you probably have bad sectors. But I'm guessing that might not the case since you are able to format it in the first place. Are you playing a game or something when this happens?
Sent from my KFHD using Tapatalk 2
Looking for an opinion
Hey there, very well written post.
My situation is regarding my Nexus Q. I attempted to flash a CM10.1 rom to it and something went wrong. I have it back to stock, but I think my partitions need to be reset, and was hoping someone could advise me based on my screenshot. While in Recovery, I get told that the SD Card only has 15mb of space, and it cannot mount /cache to perform a logcat. I notice from the OP screenshot that most of the other partions have ext4 beside but mine do not.
Should I follow your guide to re partition my unit?
Cheers
HomeR365 said:
Hey there, very well written post.
My situation is regarding my Nexus Q. I attempted to flash a CM10.1 rom to it and something went wrong. I have it back to stock, but I think my partitions need to be reset, and was hoping someone could advise me based on my screenshot. While in Recovery, I get told that the SD Card only has 15mb of space, and it cannot mount /cache to perform a logcat. I notice from the OP screenshot that most of the other partions have ext4 beside but mine do not.
Should I follow your guide to re partition my unit?
Cheers
Click to expand...
Click to collapse
Probably, but with GREAT discernment. You need to learn about your device's partitions and what they're for. And you definitely need to learn what the commands are doing so you understand what's going on. I wouldn't suggest just trying it out and hoping for the best.
This is awesome. Thanks so much. Bookmarked for future reference after spending hours on this.
stuck in orange logo boot
Hello, total noob here. Ok i rooted my kindle fire. rebooted and it started with kindle fire logo in blue color. Then I connect to my pc it showed it got connected.I put in new zip of cynogenmod jelly bean. All good rebooted with kindle fire logo orange color. No google apps, now i connect it to PC and it wont show kindle. So i downloaded the Gapps directly in kindle. rebooted for recovery but it rebooted to jelly bean. Blue kindle fire wont show up. I need to get into TWRP so that I can install Gaapps. trying for three days. read many posted. holding power button for 20 secs till it shuts down. then connecting usb to PC it restart but with orange fire logo. Added some lines 4000 or 4001 under tools menu in utility folder, run the cmd from the tools folder.... nothing changed. tried. RAN KFU again and it shows status offline, rooted no, and boot menu unkwon. Ran ADB straight shows waiting for device. So my question is how can I get back to recovery or blue logo where I can go and reset or reinstall or atleast install just Gaaps. tried install just random games APKs. It wont let it install. Please Help. Dont know much linux or DOS either.
thanks this help alot thanks a million
sir i have a arise rowdy t1+ phone its board is sp6820gb_7620 and cpu id is 8810 cpu frequency is 1ghz and ram is 512mb with mali 300 gpu,
android version is 2.3.6 and kernal version is 2.6.35.7 [email protected] #7, software version is mocordroid2.3.6.w12.20_p20.01_20130715.130506, hardware version is 1.1.0. my problem is that my phone has only 128 mb of internal memory and when i tried to edit vold.fstab to swap its memory with memory card it stopped detecting sd card when turned on but when in recovery mode sd is shown present, i think its very similar to karbonn a1+ in hardware and software part so can you please help me with my phone?
thank you so much !!!!!!!! its awesome
nitingoel2 said:
sir i have a arise rowdy t1+ phone its board is sp6820gb_7620 and cpu id is 8810 cpu frequency is 1ghz and ram is 512mb with mali 300 gpu,
android version is 2.3.6 and kernal version is 2.6.35.7 [email protected] #7, software version is mocordroid2.3.6.w12.20_p20.01_20130715.130506, hardware version is 1.1.0. my problem is that my phone has only 128 mb of internal memory and when i tried to edit vold.fstab to swap its memory with memory card it stopped detecting sd card when turned on but when in recovery mode sd is shown present, i think its very similar to karbonn a1+ in hardware and software part can you please help me with my phone?
Click to expand...
Click to collapse
This is a kindle fire forum friend
Sent from my Amazon Kindle Fire using Tapatalk
soupmagnet said:
**IMPORTANT**
Read this thoroughly before you attempt any of it. The steps found herein will wipe out any data remaining on the partition for which it's used. If a partition has lost it's formatting, chances are the data is lost anyway, so there's not much more you can lose. This should be thought of as a last resort. Do not attempt this until you have tried everything else.
In many cases, just wiping the affected partition in recovery is enough to fix the problem. If not, continue reading.
If it's your sdcard that needs to be mounted, there is one thing you can try that might work in most cases.
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] echo /dev/block/mmcblk0p12 >> /sys/devices/platform/usb_mass_storage/lun0/file
Your computer will probably respond that the volume/device needs formatted before using it. This will erase everything left on the sdcard, as will anything else you attempt in this thread.
* Choose a quick format (if possible) and format it as "fat32", block size "4096".
If that doesn't work...
You'll have to reset your partition table, just in case (this step is optional but it doesn't hurt to do it anyway).
You'll need to be in fastboot:
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] idme bootmode 4002
[COLOR=Gray]~ #[/COLOR] reboot
(*COTR recovery doesn't have idme so you'll have to use the recovery itself to reboot into the bootloader)
Once in fastboot, enter the following commands...
Code:
[COLOR=Gray]$[/COLOR] fastboot oem format
[COLOR=Gray]$[/COLOR] fastboot oem idme bootmode 5001
[COLOR=Gray]$[/COLOR] fastboot reboot
With your partition table reset, it's time to print your partition table for reference.
For this, your device must be booted into recovery.
To print your partition table:
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] print
This will print the layout of your partitions 1-12. It should look something like this:
View attachment 1421197
If you receive an error stating that parted can't be found, you need to find and download it and enter the following commands, or update your recovery...
Code:
[COLOR=Gray]$[/COLOR] adb push /path/to/parted /sbin/parted
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] chown 0.0 /sbin/parted
[COLOR=Gray]~ #[/COLOR] chown 755 /sbin/parted
(*replace "/path/to/parted" with the full path to the parted binary downloaded to your computer)
Once you have your partition table printed out, copy and save it to a text file for later use.
When looking at the partition table, pay close attention to the file systems of the system, userdata, cache and media partitions. System, data and cache, should have an "ext4" formatting, while media should have a "fat32" formatting. The partitions that are missing the proper formatting are the ones you need to focus on because they need to be removed and repartitioned.
----------------------------------------------------------------------------------------------------------------------------------------
NEVER MESS WITH ANYTHING OTHER THAN SYSTEM, DATA, CACHE AND MEDIA!!!
----------------------------------------------------------------------------------------------------------------------------------------
The following, are the steps to repartition the system, data, and cache partitions. Media (sdcard) will have it's own steps so don't get them mixed up. These same steps will be used for each of the system data and cache partitions except you'll substitute the variables (in green) with the values for that particular partition. Be careful NOT to get the any of numbers mixed up or confused or you could potentially do serious damage to your device.
Code:
[COLOR=Gray]$[/COLOR] abd shell
[COLOR=Gray]~ #[/COLOR] umount [COLOR=SeaGreen]"directory_name"[/COLOR] [COLOR=Red]<---- This command is to make sure the volume isn't already mounted. If you get an error, it just means there is no volume mounted. Disregard.[/COLOR]
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] rm [COLOR=SeaGreen]"partition_number"[/COLOR]
[COLOR=Gray](parted)[/COLOR] mkpart primary [COLOR=SeaGreen]"startblock" "endblock"[/COLOR]
[COLOR=Gray](parted)[/COLOR] name [COLOR=SeaGreen]"partition_number" "partition_name"[/COLOR]
[COLOR=Gray](parted)[/COLOR] quit
[COLOR=Gray]~ #[/COLOR] mke2fs -t ext4 /dev/block/mmcblk0p[COLOR=SeaGreen]"partition_number"[/COLOR]
[COLOR=Gray]~ #[/COLOR] mount [COLOR=SeaGreen]"directory_name"[/COLOR]
The values for the previous command variables are as follows...
SYSTEM
-------------------------------
"partition_number"= 9
"directory_name" = /system
"partition_name" = system
"startblock" = 312
"endblock" = 849
DATA
-------------------------------
"partition_number"= 10
"directory_name" = /data
"partition_name" = userdata
"startblock" = 849
"endblock" = 2041
CACHE
-------------------------------
"partition_number"= 11
"directory_name" = /cache
"partition_name" = cache
"startblock" = 2041
"endblock" = 2309
For example, in order to fix the DATA partition, the commands would be written like this...
Code:
[COLOR=Gray]$[/COLOR] abd shell
[COLOR=Gray]~ #[/COLOR] umount /data
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] rm 10
[COLOR=Gray](parted)[/COLOR] mkpart primary 849 2041
[COLOR=Gray](parted)[/COLOR] name 10 userdata
[COLOR=Gray](parted)[/COLOR] quit
[COLOR=Gray]~ #[/COLOR] mke2fs -t ext4 /dev/block/mmcblk0p10
[COLOR=Gray]~ #[/COLOR] mount /data
The following are the steps to repartition the media (sdcard) partition.
Code:
[COLOR=Gray]$[/COLOR] adb shell
[COLOR=Gray]~ #[/COLOR] umount /sdcard [COLOR=Red]<----Same as before. If you receive an error on this command, just disregard it.[/COLOR]
[COLOR=Gray]~ #[/COLOR] parted /dev/block/mmcblk0
[COLOR=Gray](parted)[/COLOR] rm 12
[COLOR=Gray](parted)[/COLOR] mkpartfs primary fat32 2309 7690
[COLOR=Gray](parted)[/COLOR] rm 12
[COLOR=Gray](parted)[/COLOR] mkpart primary 2309 7690
[COLOR=Gray](parted)[/COLOR] name 12 media
[COLOR=Gray](parted)[/COLOR] quit
[COLOR=Gray]~ #[/COLOR] mount /sdcard
Once again, any partitions on which these commands are used, will lose any data left on them, but chances are it's your only option. Pay very close attention to what you are doing and be very cautious of typos. Accidentally entering /dev/block/mmcblk0p2' instead of "/dev/block/mmcblk0p12" will brick your device, to the point of needing to pull the back cover off and shorting it...well...let's just say you don't want to have to do that.
Afterwards you should be able to mount the effected partitions in recovery.
Be careful, and good luck.
Refrences:
http://forum.xda-developers.com/showpost.php?p=26285877&postcount=12
http://forum.xda-developers.com/showthread.php?t=1651413
http://forum.xda-developers.com/showthread.php?t=1497900
Thanks to kinfauns for showing me that it isn't always necessary to create an "ext2" file system first and then convert it to "ext4", and for showing me how to get rid of the pesky msftres flags.
Click to expand...
Click to collapse
Now, I get the error that the sdcard isn't mounted in root explorer, but I can still find all of the contents of the sdcard under /storage/emulated/0. Is there any reason for this? I was thinking of simply copying everything to a new folder named sdcard (because the old folder turned into a file with a filesize of -1 bytes) but then the newly created folder had the same problem. Whenever I tapped on it it gave me the same error, "The SD card in't mounted". I'm on a Nexus 4, any help?
Cannot solve this issue
I've had it with messing this for my 1st gen kindle fire, for the last 5 weeks I've been trying to unbrick it and nothing works. I can connect to the device using Super ADB Tool but trying to load anything produces the and I get "- exec '/system/bin/sh' failed" messages using the command prompt.

[GUIDE] [Universal] Backuping & Restoring IMG files

Hey guys, today I'm going to tell you how to backup & restore few things of your phone without using a pc. So let's get started without wasting any time...
Things you gonna need:
1) Busybox installed (Stericson is recommended)
3) A SD-Card inserted to your phone with some free space to backup things
2) Any terminal emulator
3) Patience & some common sense.
First I'll say you how to backup things & later I'll say how to restore them...
How To Backup:
Code:
•Boot.img :
In terminal emulator type the following:
dd if=/dev/block/mmcblk0p7 of=/sdcard/backups/boot.img
• Logo.bin :
In terminal emulator type the following:
dd if=/dev/block/mmcblk0p11 of=/sdcard/backups/logo.bin
• Nvram.img :
In terminal emulator type the following:
dd if=/dev/block/mmcblk0p2 of=/sdcard/backups/nvram.img
• Recovery.img :
In terminal emulator type the following:
dd if=/dev/block/mmcblk0p8 of=/sdcard/backups/recovery.img
• System.img :
In terminal emulator type the following:
dd if=/dev/block/mmcblk0p14 of=/sdcard/backups/system.img
• Userdata.img :
In terminal emulator type the following:
dd if=/dev/block/mmcblk0p16 of=/sdcard/backups/userdata.img
(Proceed with caution...)
How To Restore:
Code:
•Boot.img :
In terminal emulator type the following:
dd if=/sdcard/backups/boot.img of=/dev/block/mmcblk0p7
• Logo.bin :
In terminal emulator type the following:
dd if=/sdcard/backups/logo.bin of=/dev/block/mmcblk0p11
• Nvram.img :
In terminal emulator type the following:
dd if=/sdcard/backups/nvram.img of=/dev/block/mmcblk0p2
• Recovery.img :
In terminal emulator type the following:
dd if=/sdcard/backups/recovery.img of=/dev/block/mmcblk0p8
• System.img :
In terminal emulator type the following:
dd if=/sdcard/backups/system.img of=/dev/block/mmcblk0p14
• Userdata.img :
In terminal emulator type the following:
dd if=/sdcard/backups/userdata.img of=/dev/block/mmcblk0p16
If this post helped you then please hit thanks, & feel free to ask any doubts or questions...
Reserved!!
Reserved to blame you if this goes wrong!!!
It goes without saying that dd'ing a .img to a wrong partition number (.../mmcblk0pxx) will probably brick your device, if it's some critical partition that just got overwritten with something else.
Don't mess with dd unless you must. dd doesn't ask for confirmation. Triple check the command before pressing enter when restoring, or you'll regret it.
juanchotazo99 said:
It goes without saying that dd'ing a .img to a wrong partition number (.../mmcblk0pxx) will probably brick your device, if it's some critical partition that just got overwritten with something else.
Don't mess with dd unless you must. dd doesn't ask for confirmation. Triple check the command before pressing enter when restoring, or you'll regret it.
Click to expand...
Click to collapse
I agree. You really should put some kind of warning because with dd, well...here be dragons..

[Q&A] [ROOT][CWM] Root Nexus 4 & Install Official ClockworkMod Recovery

Q&A for [ROOT][CWM] Root Nexus 4 & Install Official ClockworkMod Recovery
Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.
Before posting, please use the forum search and read through the discussion thread for [ROOT][CWM] Root Nexus 4 & Install Official ClockworkMod Recovery. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.
Thanks for understanding and for helping to keep XDA neat and tidy!
Booting with insecure boot image has broken all my sensors in my Nexus 4 / Android 5
I have been using a boot insecure image made for Nexus 4 / Android 4.2 downloaded from here :
http://forum.xda-developers.com/nexus-4/development/boot-img-obsolete-please-lock-t1990170
to boot my phone to have root access through adb by doing:
$ fastboot boot bootinsecure.img
But after upgrading to Android 5 the process of booting with this image was ruining all my sensors and my wifi.
My wifi was fixed by deleting the content in /data/misc/wifi but leaving wpa_supplicant.conf to keep my saved wifis.
But I cannot fix the sensors. I tried this fix for Nexus 5 but it didn't work:
http://forum.xda-developers.com/google-nexus-5/general/sensors-fix-nexus-5-t2704915
If I delete the user data the problem is solved but I don't want to remove all my data.
There is something in that boot image that brakes my sensors by changing something in the userdata partition
For testing purposes, I deleted the user data. Booted again and the problem was fixed. I saved a image of the userdata partition by doing as root:
$ adb pull /dev/block/mmcblk0 mmcblk0.img
and mounting the userdata partition in my linux as root to keep al the original permissions
# sudo mount -o loop,offset=1627389952,defaults,ro,noload mmcblk0.img mnt/userdata
I booted from my boot insecure image and reboot normally and all the sensors where ruined as expected
So I created another image and I mounted the userdata in another folder
and then I compared all the files that where changed using rsync after and before the boot with the insecure image.
I found a few extra files in the "after" image so I deleted them but the problem was not fixed.
I think that maybe the problem is related to folder/files permissions, attributes or extended attributes (like SElinux) that were changed and cannot be detected when comparing using rsync
Any ideas what might have been and what to do to fix it?
SOLVED:
Solution:
Apparently the problem was not in the userdata partition was in the persist partition. I solved by cloning a working persist partition from another Nexus 4.
I realized that something was wrong in the probably extended attributes in the file /persist/sensors/sns.reg since a
$ adb logcat
was giving this error:
W/sensors.qcom( 282): type=1400 audit(0.0:5): avc: denied { getattr } for path="/persist/sensors/sns.reg" dev="mmcblk0p20" ino=15 scontext=u:r:sensors:s0 tcontext=ubject_r:unlabeled:s0 tclass=file
So I fixed in this way:
First I downloaded a modified busybox dd from:
http://d-h.st/cFA
Don't use the default one it will ruin your partition:
I downloaded recovery-clockwork-touch-6.0.4.7-mako.img from:
http://download2.clockworkmod.com/recoveries/recovery-clockwork-6.0.4.7-mako.img
1) Then I booted from a recovery image like ClockWorkMod. With the phone in the bootloader:
$ fastboot boot recovery-clockwork-touch-6.0.4.7-mako.img
2) Created a ramdisk in the phone
$ adb shell mkdir /dev/ramdisk
$ adb shell mount -o size=1536M -t tmpfs tmpfs /dev/ramdisk
3) Copied dd to the phone
$ adb push dd /
$ adb shell chmod 755 /dd
4) Extract persist from the working phone
$ adb shell /dd if=/dev/block/mmcblk0 of=/dev/ramdisk/persist.img bs=4096 skip=34816 count=4096
5) Pull file to our PC
$ adb pull /dev/ramdisk/persist.img
6) Reboot working phone
$ adb reboot-bootloader
With our not working Nexus 4
Repeat steps 1 to 3
7) Push your persist image to the phone
$ adb push persist.img /dev/ramdisk/
8) Overwrite image
$ adb shell /dd if=/dev/ramdisk/persist.img of=/dev/block/mmcblk0 bs=4096 seek=34816 conv=notrunc
9) Wipe cache and dalvik cache
10) Reboot
Should be fixed if that was the problem

Pixel (2016) Partition Names, Numbers and Sizes

I thought it might be helpful to others to document some test results after rooting my Google Pixel (2016) phone with Magisk (v20.4) and Magisk Manager (v8.0.4), and using various commands with a terminal emulator (Termux) on my phone, and with terminal and adb on my Linux (Ubuntu) computer with phone connected.
Command outputs appear to refer to the number (#) of blocks. By presupposing that each of these blocks has 1,024 bytes, I calculated partition sizes in MB and GB, and compared the values to the sizes of the files copied using adb pull /dev/block/bootdevice/by-name. The values matched exactly, and the total size of all of the partitions came to 32 GB, which is the size of my phone’s internal storage.
I found 62 different partitions on my phone, and combining several command outputs enabled me to produce the following table.
Partition NamePartition NumberNumber of BlocksPartition Size MBPartition Size GBaboot_asda174,0964.2aboot_bsda184,0964.2apdp_asda292560.3apdp_bsda302560.3board_infosdf1160.0boot_asda1932,76833.6boot_bsda2032,76833.6bootlocker_asda15120.5bootlocker_bsda25120.5cdtsdd1240.0cmnlib32_asda132560.3cmnlib32_bsda142560.3cmnlib64_asda152560.3cmnlib64_bsda162560.3ddrsdd111,0241.0devcfg_asda231280.1devcfg_bsda241280.1devinfosdf440.0devinfobaksdd540.0dipsdd71,0241.0dposdd640.0frpsde15120.5fscsdd840.0fsgsdf32,0482.1hosd_asda2132,76833.6hosd_bsda2232,76833.6hyp_asda115120.5hyp_bsda125120.5keymaster_asda35120.5keymaster_bsda45120.5metadatasde516,38416.8mfgsdf22360.3miscsdd11,0241.0modem_asda2571,68073.4modem_bsda2671,76073.4modemst1sdd92,0482.1modemst2sdd102,0482.1msadp_asda272560.3msadp_bsda282560.3persistsdd332,76833.6pg1fssde34,0964.2pg2fssde42,0482.1pmic_asda95120.5pmic_bsda105120.5ramdumpsde26,1446.3reserve0sda364,8204.9reserve3sdd139,0209.2reserve4sde67,6367.8reserve5sdf55,8246.0rpm_asda75120.5rpm_bsda85120.5secsdd41280.1ssdsdd280.0system_asda332,097,1522,147.52.1 GBsystem_bsda342,097,1522,147.52.1 GBtz_asda52,0482.1tz_bsda62,0482.1userdatasda3526,038,27226,663.226.7 GBvendor_asda31307,200314.60.3 GBvendor_bsda32307,200314.60.3 GBxbl_asdb14,0524.1xbl_bsdc14,0524.1TOTALS-31,248,12031,998.132 GB
Partition NamePartition NumberNumber of BlocksPartition Size MBPartition Size GBsda-31,145,98431,893.531.9 GBsdb-4,0964.2sdc-4,0964.2sdd-49,15250.3sde-36,86437.7sdf-8,1928.4TOTALS-31,248,38431,998.332 GB
The sda partition is the main part of the phone's internal storage, but could sdb, sdc, sdd, sde and sdf partitions be held on separate disks or boards?
Commands used via Phone and Terminal Emulator:
uname (with -a appended)
sudo cat /proc/partitions
tsu
sudo cat /proc/partitions
su
cd /dev/block/bootdevice/by-name
ls -all
Commands used via Computer Terminal and ADB: (I found it easier to temporarily boot TWRP using fastboot boot twrp-3.4.0-0-sailfish.img).
adb ls /dev/block/bootdevice/by-name
adb shell ls /dev/block/bootdevice/by-name
adb shell ls -all /dev/block/bootdevice/by-name
adb pull /dev/block/bootdevice/by-name (see below)
adb shell uname (with -a appended)
adb shell
cat /proc/partitions
The adb pull command copied 34.5 GB files (took 18 mins) into a ‘by-name’ file in my adb folder. The files in 'by-name' included boot (33.6 MB), system (2.1 GB) and vendor (314.6 MB) files (approx 2.5 GB) that were not included in the command outputs, which instead had similarly sized boot_a, boot_b, system_a, system_b, vendor_a and vendor_b files.

HELP!!! How to fix "Can’t load Android System your data may be corrupt" error without losing your data ?

Update 2 : I have managed to take a backup of all the eMMC partitions using QFIL but I don't know how to proceed further.
Update 1 : Successfully flashed Stock ROM both via using ADB Sideload and SD card in the recovery but I am still stuck on the same "Can’t load Android System.Your data may be corrupt.If you continue to get this message, you may need to perform a factory data reset and erase all user data stored on this device " screen.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
----------------------------------------------------------------------------------------------------------------------------------------------------------
Hello guys,I was uninstalling some apps and accidently Asus launcher,Google Play and Play services etc got selected as well.While apps were getting uninstalled and/or downgraded,phone restarted somehow and everything is screwed up now.I am stuck on a screen telling “Can’t load Android System.Your data may be corrupt.If you continue to get this message, you may need to perform a factory data reset and erase all user data stored on this device” with 2 options underneath, 1.Try again and 2.Factory data reset
When I select “Try again” it shows “ Dead android robot on his back and red triangle” for a split second and then goes to Asus logo screen for 5 seconds and then ask for encryption key, when I enter the key it goes to ASUS logo screen again for 30-40 seconds and again back to Error screen.
Here is the video of the problem (Keep reloading if it doesn't load in first attempt)
Asus Zenfone 3 Bootloop
Watch "Asus Zenfone 3 Bootloop" on Streamable.
streamable.com
Asus ZenFone 3 ZE552KL
ROM : Stock Oreo Version WW-15.0410.1807.75
Bootloader is Locked
Recovery : Stock Recovery
USB debugging : Disabled
Android device encryption is ON
Device is booting in Fastboot Mode and Recovery Mode.
It even boots to the Sideload Mode via recovery and running "adb devices" command shows it attached with it's serial number and sideload but other commands don't work.
Device is being shown /listed in Fastboot Mode.
I am unable to use adb as USB debugging is disabled.Running "adb devices " command shows device’s serial number and "recovery" written next to it ,in the command prompt.
Will flashing Version WW-15.0410.1807.75 again do the job without wiping user data ?
How about flashing only boot.img / system.img ? Can we resolve the issue by just flashing just system.img or boot.img instead of flashing complete stock ROM ?
I don't care about performance of the system or unpredicted issues later on,my entire focus is on preserving my data.I don’t wanna to lose my data coz there are some very important documents,projects reports, pictures and backups in it.
Any help would be greatly appreciated!
I extracted the Stock ROM zip and found it's updater script in "META-INF/com/google/android"
JavaScript:
ifelse( getprop("ro.build.id") == "OPR1.170623.026", ui_print("Android O device"), (
(greater_than_int(getprop("ro.build.date.utc"), 1514390400)) || abort("Can't install this package on device version less than 14.2020.1712.85 device build time (" + getprop("ro.build.date") + ").");
) );
ifelse( getprop("ro.product.name") == "OPEN_Phone", ui_print("OPEN SKU device"), (
getprop("ro.product.name") == "WW_Phone" || abort("This package is for \"WW_Phone\" devices; this is a \"" + getprop("ro.product.name") + "\".");
) );
ui_print("Target: asus/WW_Phone/ASUS_Z012D:8.0.0/OPR1.170623.026/15.0410.1807.75-0:user/release-keys");
show_progress(0.750000, 540);
ui_print("Patching system image unconditionally...");
block_image_update("/dev/block/bootdevice/by-name/system", package_extract_file("system.transfer.list"), "system.new.dat", "system.patch.dat") ||
abort("E1001: Failed to update system image.");
ui_print("Verifying the updated system image...");
if range_sha1("/dev/block/bootdevice/by-name/system", "136,0,32767,32768,32770,33009,33011,33516,65535,65536,65538,66043,98303,98304,98306,98545,98547,99052,131071,131072,131074,131579,163839,163840,163842,164081,164083,164588,196607,196608,196610,197115,229375,229376,229378,229617,229619,230124,262143,262144,262146,262651,294910,294912,294914,295153,295155,295660,327679,327680,327682,328187,335068,360448,360450,360955,393214,393216,393218,393723,393724,393725,425982,425984,425986,426491,458751,458752,458754,459259,491519,491520,491522,492027,524287,524288,524290,524795,557055,557056,557058,557563,589823,589824,589826,590331,622591,622592,622594,623099,655358,655360,655362,655867,688126,688128,688130,688635,720894,720896,720898,721403,753662,753664,753666,754171,786430,786432,786434,786939,819198,819200,819202,819441,819443,819948,851966,851968,851970,852475,884734,884736,884738,884977,884979,885484,917502,917504,917506,918011,950270,950272,950274,950779,967696,967697,983040") == "9a4740126249131da4ccd7e39fcf8d7302a3f818" then
if range_sha1("/dev/block/bootdevice/by-name/system", "136,32767,32768,32770,33009,33011,33516,65535,65536,65538,66043,98303,98304,98306,98545,98547,99052,131071,131072,131074,131579,163839,163840,163842,164081,164083,164588,196607,196608,196610,197115,229375,229376,229378,229617,229619,230124,262143,262144,262146,262651,294910,294912,294914,295153,295155,295660,327679,327680,327682,328187,335068,335580,359936,360448,360450,360955,393214,393216,393218,393723,393724,393725,425982,425984,425986,426491,458751,458752,458754,459259,491519,491520,491522,492027,524287,524288,524290,524795,557055,557056,557058,557563,589823,589824,589826,590331,622591,622592,622594,623099,655358,655360,655362,655867,688126,688128,688130,688635,720894,720896,720898,721403,753662,753664,753666,754171,786430,786432,786434,786939,819198,819200,819202,819441,819443,819948,851966,851968,851970,852475,884734,884736,884738,884977,884979,885484,917502,917504,917506,918011,950270,950272,950274,950779,967696,967697") == "6d1cea242bbacf2ea86f62fa6c06b6bde31ec430" then
ui_print("Verified the updated system image.");
else
abort("E1003: system partition has unexpected non-zero contents after OTA update");
endif;
else
abort("E1002: system partition has unexpected contents after OTA update");
endif;
show_progress(0.050000, 5);
package_extract_file("boot.img", "/dev/block/bootdevice/by-name/boot");
show_progress(0.200000, 10);
# ---- radio update tasks ----
ui_print("Patching firmware images...");
ifelse(msm.boot_update("main"), (
ui_print("installing cmnlib64");
package_extract_s_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64");
ui_print("installing sbl1");
package_extract_s_file("firmware-update/sbl1.mbn", "/dev/block/bootdevice/by-name/sbl1");
ui_print("installing cmnlib");
package_extract_s_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlib");
ui_print("installing rpm");
package_extract_s_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpm");
ui_print("installing tz");
package_extract_s_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tz");
ui_print("installing devcfg");
package_extract_s_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfg");
ui_print("installing aboot");
package_extract_s_file("firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/aboot");
ui_print("installing lksecapp");
package_extract_s_file("firmware-update/lksecapp.mbn", "/dev/block/bootdevice/by-name/lksecapp");
ui_print("installing keymaster");
package_extract_s_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymaster");
), "");
ifelse(msm.boot_update("backup"), (
ui_print("installing cmnlib64bak");
package_extract_s_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64bak");
ui_print("installing sbl1bak");
package_extract_s_file("firmware-update/sbl1.mbn", "/dev/block/bootdevice/by-name/sbl1bak");
ui_print("installing cmnlibbak");
package_extract_s_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlibbak");
ui_print("installing rpmbak");
package_extract_s_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpmbak");
ui_print("installing tzbak");
package_extract_s_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tzbak");
ui_print("installing devcfgbak");
package_extract_s_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfgbak");
ui_print("installing abootbak");
package_extract_s_file("firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/abootbak");
ui_print("installing lksecappbak");
package_extract_s_file("firmware-update/lksecapp.mbn", "/dev/block/bootdevice/by-name/lksecappbak");
ui_print("installing keymasterbak");
package_extract_s_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymasterbak");
),"no backup partition");
msm.boot_update("finalize");
ui_print("installing modem");
package_extract_s_file("firmware-update/NON-HLOS.bin", "/dev/block/bootdevice/by-name/modem");
ui_print("installing dsp");
package_extract_s_file("firmware-update/adspso.bin", "/dev/block/bootdevice/by-name/dsp");
ui_print("installing asusfw");
package_extract_file("firmware-update/asusfw.img", "/dev/block/bootdevice/by-name/asusfw");
set_progress(1.000000);
It's been a long time since I've used an Android phone.
I believe it was possible to flash a stock ROM and gaaps using fastboot commands without erasing user data.
audit13 said:
It's been a long time since I've used an Android phone.
I believe it was possible to flash a stock ROM and gaaps using fastboot commands without erasing user data.
Click to expand...
Click to collapse
Nope,I haven't tried that yet coz before doing anything I want to be absolutely sure that it's not gonna wipe my data. Again,flashing the complete stock ROM is required or flashing a specific image like boot.img / system.img would resolve the issue ?
Please take a look at this thread.I didn't get "-w flag" thing.
hello, what you are trying to achieve is possible but we need to make solution specific to your android version which is android 8.
secondly explain what happened in detail like was your phone rooted or not, like if not then how on earth you uninstall system apps, if not uninstalled just degraded using uninstall updates button tell me.
xda is only in my laptop so i am unable to reply instantly, you can use telegram to talk to me @Bhd82
[email protected] said:
secondly explain what happened in detail like was your phone rooted or not, like if not then how on earth you uninstall system apps, if not uninstalled just degraded using uninstall updates button tell me.
Click to expand...
Click to collapse
My device is not rooted.Yes,I selected multiple apps to uninstall and Asus launcher,Play Store,Google Play Services also got selected accidenlty and when Uninstall button was clicked, I suppose were downgraded in the process.
[email protected] said:
hello, what you are trying to achieve is possible but we need to make solution specific to your android version which is android 8.
secondly explain what happened in detail like was your phone rooted or not, like if not then how on earth you uninstall system apps, if not uninstalled just degraded using uninstall updates button tell me.
xda is only in my laptop so i am unable to reply instantly, you can use telegram to talk to me @Bhd82
Click to expand...
Click to collapse
Hello buddy,here is the video of the bootloop.
encryption is downgrade protected so you probably broke it. so first you should dump cache partition and search kernel logs for QSEECOM. if your bootloader is unlocked, boot custom recovery from fastboot boot command and dump partitions from adb pull, otherwise dump from edl.py.
loaders can be found here
https://forum.xda-developers.com/showthread.php?t=3603643&page=4
https://forum.xda-developers.com/showthread.php?t=3759473
https://romprovider.com/download-prog_emmc_firehose-qcom-phone-cpus
https://www.firmware27.com/2017/06/collectionprog-emmc-firehose-prog-ufs.html
https://www.leakite.com/collection-qualcomm-emmc-programmer-files
https://github.com/programmer-collection
https://github.com/bkerler/Loaders
https://github.com/thantoeaungat/firehose
https://www.tuserhp.com/2018/02/prog-emmc-firehose-ufs-firehose.html
https://firmwarego.com/index.php?a=downloads&b=folder&id=2288
edit: or try to get logcat during boot-loop
Code:
fastboot oem adb_enable
fastboot continue
adb logcat > logcat.log
aIecxs said:
encryption is downgrade protected so you probably broke it
Click to expand...
Click to collapse
Hello buddy,thank you for your valuable input! It means a lot! Well ,device was running without any glitch even after disabling and downgrading several pre installed apps and bloatwares.Several times ,I downgraded Playstore and Google play services to fix some issues.And everything went hand in hand with encryption enabled.I guess ,in this particular case, device got restarted during downgrading process and that corrupted some files.
aIecxs said:
if your bootloader is unlocked, boot custom recovery from fastboot boot command and dump partitions from adb pull, otherwise dump from edl.py.
Click to expand...
Click to collapse
My bootloader is locked and USB debugging is disabled.Yes, I have been digging threads regarding QSEECOM and QPST for past few days.
aIecxs said:
edit: or try to get logcat during boot-loop
Code:
fastboot oem adb_enable
fastboot continue
adb logcat > logcat.log
Click to expand...
Click to collapse
Unfortunately,unlocking bootloader would wipe out all the data which I want to preserve.Is there any way to get logcat with bootloader locked and usb debugging disabled ?
Thank you!
sorry I didn't know that fastboot oem adb_enable requires unlocked bootloader.
yes there is maybe. you can flash adb enabled AVBv1 signed modified boot.img from Qualcomm HS-USB QDLoader 9008 EDL mode if you have deep flash cable or figure out test point
first backup all partitions to PC
(replace ./ with proper path on disk or cd into directory. home directory ~ might run out of disk space)
Bash:
mkdir ~/tmp
cp -v ./prog_emmc_firehose_8953_ddr.mbn ~/tmp
cd edl
python3 ./Loaders/fhloaderparse.py ~/tmp Loaders
python3 ./edl.py printgpt
python3 ./edl.py r boot boot.img
python3 ./edl.py r system system.img
python3 ./edl.py r cache cache.img
python3 ./edl.py r metadata metadata.bin
python3 ./edl.py r devinfo devinfo.bin
python3 ./edl.py r userdata userdata.img
python3 ./edl.py r ...
second modify default.prop in boot.img ramdisk with AIK
Code:
ro.debuggable=1
ro.adb.secure=0
ro.secure=0
persist.sys.usb.config=mtp,adb
third flash image-new.img (which is hopefully AVBv1-signed) back to device and try get logcat while booting android (might brick your device)
Bash:
python3 ./edl.py w boot image-new.img
python3 ./edl.py reset
adb logcat '*:W' -b all | tee ~/logcat.txt
In case you bricked just restore backup boot.img and go for logs in cache partition. loop mount the partition image
Bash:
mkdir ~/cache
sudo -H mount -t ext4 -o loop,ro,noexec,noload,noatime ./cache.img ~/cache
sudo -H thunar ~/cache
edit: optional patch avb/dm-verity with Magisk
(attachments removed)
aIecxs said:
so first you should dump cache partition and search kernel logs for QSEECOM.dump from edl.py.
Click to expand...
Click to collapse
Hello,after a lot of research and experiments,I finally managed to build an EDL flash cable and figured out device's key combination to get the device in QDLoader 9008 EDL mode.
While I am a tech enthusiast,I am incognizant of Linux / Python so kindly bear with me.Even after spending hours I couldn't find any tutorial / video regarding how to use edl.py / bkerler/edl. Instructions here are unclear and complicated.Looks developer have a notion that everybody on this planet have an understanding of coding or python.It's full of jargons.A video tutorial of the whole process could be quite informative but unfortunatley it's missing.
This "loader" thing is also utterly confusing, some people are referring prog_emmc_firehose files as loader while bkerler/Loaders are entirely different phenomenon and I am unable to comprehend it.
I had downloaded xubuntu.iso to boot it via USB on Windows 11 machine only to find it later that bkerler/edl is first asking to use 3.9GB large Re LiveDVD and then later want us to install python + git and loads of other things.I don't understand what's the point of doing all this when one can run Linux commands in Windows using Windows Subsystem for Linux (WSL).
aIecxs said:
you can flash adb enabled AVBv1 signed modified boot.img from Qualcomm HS-USB QDLoader 9008 EDL mode if you have deep flash cable or figure out test point
first backup all partitions to PC
(replace ./ with proper path on disk or cd into directory. home directory ~ might run out of disk space)
Bash:
mkdir ~/tmp
cp -v ./prog_emmc_firehose_8953_ddr.mbn ~/tmp
cd edl
python3 ./Loaders/fhloaderparse.py ~/tmp Loaders
python3 ./edl.py printgpt
python3 ./edl.py r boot boot.img
python3 ./edl.py r system system.img
python3 ./edl.py r cache cache.img
python3 ./edl.py r metadata metadata.bin
python3 ./edl.py r devinfo devinfo.bin
python3 ./edl.py r userdata userdata.img
python3 ./edl.py r ...
second modify default.prop in boot.img ramdisk with AIK
Code:
ro.debuggable=1
ro.adb.secure=0
ro.secure=0
persist.sys.usb.config=mtp,adb
third flash image-new.img (which is hopefully AVBv1-signed) back to device and try get logcat while booting android (might brick your device)
Bash:
python3 ./edl.py w boot image-new.img
python3 ./edl.py reset
adb logcat '*:W' -b all | tee ~/logcat.txt
In case you bricked just restore backup boot.img and go for logs in cache partition. loop mount the partition image
Bash:
mkdir ~/cache
sudo -H mount -t ext4 -o loop,ro,noexec,noload,noatime ./cache.img ~/cache
sudo -H thunar ~/cache
edit: optional patch avb/dm-verity with Magisk
(have attached patched boot.img for both)
Click to expand...
Click to collapse
I am sorry but this post went completely over my head. Can you please recommend some step by step tutorial ? Thank you!
no worry, just follow the install instructions, then follow above steps. you can also do it on windows. but when it comes to loop-mount partition images it's far more easier to do it in linux (viewing logs in cache partition). another reason is you don't have to struggle with Qualcomm HS-USB QDLoader 9008 Drivers as linux fully handle all usb drivers automatically.
Prerequisites Step 1 (linux)
open terminal with CTRL + ALT + T and navigate to any directory on your hard disk with cd
Code:
cd /media/xubuntu/*
Prerequisites Step 2
install dependencies
Code:
# Debian/(X)ubuntu/Mint/etc
sudo apt update
sudo apt install adb fastboot python3-dev python3-pip liblzma-dev git
(optional) disable mobile broadband communication (skip this)
Code:
sudo apt purge modemmanager
sudo systemctl stop ModemManager
sudo systemctl disable ModemManager
sudo apt purge ModemManager
Prerequisites Step 3
download build and install edl.py
Code:
# edl.py (required)
git clone -b 3.52.1 https://github.com/bkerler/edl.git
cd edl
# common firehose programmer collection = factory loaders (optional)
git submodule update --init --recursive
# build + install
python3 setup.py build
sudo python3 setup.py install
(optional) set usb permissions so edl.py can run without sudo
Code:
sudo cp Drivers/51-edl.rules /etc/udev/rules.d
sudo cp Drivers/50-android.rules /etc/udev/rules.d
Prerequisites Step 4
connect device in EDL mode and check if linux can see it
Code:
lsusb
now ready for installing own loader and backup everything!
(see above)
- fhloaderparse.py
- edl.py
next step can be skipped because I already did it for you (see attachments)
- download and extract AIK-Linux-v3.8-ALL.tar.gz
- copy boot.img into AIK directory
- execute unpackimg.sh shell script
- modify default.prop
- execute repackimg.sh shell script
once you have backup proceed with flashing modified boot, reboot phone and get a logcat.txt
(see above)
aIecxs said:
no worry, just follow the install instructions, then follow above steps.
Click to expand...
Click to collapse
Install instructions of what ? Linux or edl.py ? Should I boot into xubuntu via a bootable USB flash drive ? Thank you!
- boot into xubuntu via a bootable USB pendrive
- goto - settings - keyboard - add your language and remove english layout
- open your prefered directory on windows hard disk
- right mouse click - open terminal here
- proceed with prerequisites (post #11)
- get a working firehose programmer (trial and error)
- proceed with backup (post #9)
aIecxs said:
Prerequisites Step 4
connect device in EDL mode and check if linux can see it
Code:
lsusb
now ready for installing own loader and backup everything!
(see above)
- fhloaderparse.py
- edl.py
Click to expand...
Click to collapse
Hello friend,after days of trial and error I managed to take a backup of all the partitions using QFIL.
As I want to do it via edl.py ,I have also set up a persistent Xubuntu USB and completed the Step 4.It looks like Linux has recognized the device in EDL mode ?
If I am correct,in the next step, I need to put "prog_emmc_firehose_8953_ddr.mbn" inside "edl" folder (
[email protected]:/media/xubuntu/New Volume/XB/edl) and open Terminal there and run the following commands one by one which will make backups inside "edl" folder.Correct me if I am wrong.
Bash:
mkdir ~/tmp
cp -v ./prog_emmc_firehose_8953_ddr.mbn ~/tmp
cd edl
python3 /media/xubuntu/New Volume/XB/edl/Loaders/fhloaderparse.py ~/tmp Loaders
python3 /media/xubuntu/New Volume/XB/edl/edl.py printgpt
python3 /media/xubuntu/New Volume/XB/edl/edl.py r boot boot.img
python3 /media/xubuntu/New Volume/XB/edl/edl.py r system system.img
python3 /media/xubuntu/New Volume/XB/edl/edl.py r cache cache.img
python3 /media/xubuntu/New Volume/XB/edl/edl.py r metadata metadata.bin
python3 /media/xubuntu/New Volume/XB/edl/edl.py r devinfo devinfo.bin
python3 /media/xubuntu/New Volume/XB/edl/edl.py r userdata userdata.img
python3 /media/xubuntu/New Volume/XB/edl/edl.py r ...
Again,there are 67 emmc partitions ( these are the partitions backed up by QFIL) out there.Nothing like "metadata".How do we find the names of the partition on LInux ? And do we need to do it manually one by one or is there any command to dump all the partitions ?
Thank you!
yes QDL means EDL...
(paths with whitespaces must be quoted "/media/xubuntu/New Volume/XB/edl" but no need to type the whole path at all, just dot ./ is fine if you already cd'd into directory)
yes you can place prog_emmc_firehose_8953_ddr.mbn inside edl directory, just parse the proper file path as first argument to fhloaderparse.py (like tmp/ in example)
./edl.py printgpt is the initial command it will print you all partition names and some device info. if it fails, maybe EDL got timeout and phone needs to reboot into EDL mode again
yes there is command to dump all partitions at once. you don't need it as you already have done this step from QFIL which is great, it means you found working firehose programmer
Code:
python3 edl.py printgpt
python3 edl.py rl dumps
your device obviously don't have metadata partition that was just example code
But you already have cache.bin you should loop-mount file and zip the logs from inside recovery directory. I will have a look into it maybe there is something useful inside. it should not contain anything that violates your privacy, however if you are paranoid about wifi/mac address or IMEI you can password protect zip
yes you can place prog_emmc_firehose_8953_ddr.mbn inside edl directory, just parse the proper file path/name as first argument to fhloaderparse.py (like tmp/ in example)
Complete file path is
/media/xubuntu/New Volume/XB/edl/prog_emmc_firehose_8953_ddr.mbn
Click to expand...
Click to collapse
and I am running terminal inside "edl folder" but despite several attempts I am getting following error.
Am I doing it the wrong way ? Can you please tell me the exact commands to run ?
aIecxs said:
But you already have cache.bin you should loop-mount file and zip the logs from inside recovery directory.
Click to expand...
Click to collapse
How do you do that ? By executing Step 4 of Post #9 ?
Bash:
mkdir ~/cache
sudo -H mount -t ext4 -o loop,ro,noexec,noload,noatime ./cache.img ~/cache
sudo -H thunar ~/cache
Thanks a lot!
one of your paths doesn't exist, either edl/Loaders/fhloaderparse.py is missing or it's because whitespaces in path
"/media/xubuntu/New Volume/XB/edl"
Code:
cd edl
python3 Loaders/fhloaderparse.py . Loaders
or if the above doesn't work
Code:
mkdir ~/tmp
cd edl
cp -v ./prog_emmc_firehose_8953_ddr.mbn ~/tmp
python3 ./Loaders/fhloaderparse.py ~/tmp Loaders
please also double check fhloaderparse.py exist and is spelled correctly and typed case sensitive
aIecxs said:
one of your paths doesn't exist, either edl/Loaders/fhloaderparse.py is missing.
Please also double check fhloaderparse.py exist and is spelled correctly and typed case sensitive
Click to expand...
Click to collapse
Yes,it's missing.There is no file called "fhloaderparse.py" inside "Loaders" folder.
It's also missing in bkerler/Loaders.
it is somehow removed from github
this commit is the last including it
https://github.com/bkerler/Loaders/tree/9b90b81
edit: lol it's still there in edlclient/Tools but without .py suffix
that's why the setup.py is needed, it will install the scripts right in environment so fhloaderparse is in $PATH already
this is new usage
Code:
mkdir ~/tmp
cd edl
cp -v prog_emmc_firehose_8953_ddr.mbn ~/tmp
fhloaderparse ~/tmp Loaders
_____________________________________________________________________delete___________________________________________________________________________

Categories

Resources