(solved) How restore /cust partition?

Rodiandrea

Member
Nov 10, 2014
49
2
28
Tried one hour ago, with a 8gb trascend sdcard
Again stopped at 5%

Tried to flash multiple version, from last Ota, to marshmallow ota

Nothing works


I think that the error is in the file that I modified in /cust following the guide

But I don't know how to revert this changes, because I can't flash nothing


That only time I flashed something was before my twrp vanished
I flashed the original 6.0 rom, twrp said that flash failed because I "was not allowed "(followed by some /cust errors) but the flash worked
So this success saved me from hard brick, but locked me in this situation
 

rey_lagarto

Senior Member
Jul 30, 2010
188
15
0
Tarragona
I had an issue with /cust partition and managed to fix it last night.

This was a complicated process but I'll try and explain as best as I can.

You need to obtain the original stock CUST.img file. You can download the full system images from https://mega.nz/#!Kg9UiKiD!cCh9UK0Oi-P1UNk-e1RBk_jlUEHGm0MGYa_HSlQ-3c4

You also need simg2img from https://github.com/KinglyWayne/simg2img_win

copy CUST.img into the simg2img directory, edit convert.bat to change the command to: simg2img.exe CUST.img cust.ext4.img

Or open a command prompt and navigate to the folder, running simg2img.exe CUST.img cust.ext4.img

Once run you'll have an ext4 image. The original image is a sparse image - useless for direct writing.

Boot your device into TWRP. Mount internal storage then copy the new cust.ext4.img file to your device.

You need ADB on your computer for the next step. Open adb shell:

now do the following:

dd if=/sdcard/cust.ext4.img of=/dev/block/mmcblk0p23

assuming you copied the cust image to your internal storage

Once the dd process has completed, test this worked by mounting the cust partition inside TWRP. If it mounts then the dd worked correctly and your cust is restored.
Sorry, but the pc doesn't recognize me as a command from Adb.

Can you help me?. Thank you very much.
 

rey_lagarto

Senior Member
Jul 30, 2010
188
15
0
Tarragona
Usb debugging enabled?
Yeah, sorry, I didn't misunderstand.
It doesn't recognize when I enter the command "dd", I can't find the way to run it.
Surely that line is correct or has some error?, some part of the code is missing because it is taken for granted that the others know how to use the command line, or it is because I erroneously run the whole process in fastboot mode and it is done from twrp?
Oh, thank you.
 

Jay_SEAN

Senior Member
Jun 22, 2013
97
9
38
San Fernando City La Union
I had an issue with /cust partition and managed to fix it last night.

This was a complicated process but I'll try and explain as best as I can.

You need to obtain the original stock CUST.img file. You can download the full system images from https://mega.nz/#!Kg9UiKiD!cCh9UK0Oi-P1UNk-e1RBk_jlUEHGm0MGYa_HSlQ-3c4

You also need simg2img from https://github.com/KinglyWayne/simg2img_win

copy CUST.img into the simg2img directory, edit convert.bat to change the command to: simg2img.exe CUST.img cust.ext4.img

Or open a command prompt and navigate to the folder, running simg2img.exe CUST.img cust.ext4.img

Once run you'll have an ext4 image. The original image is a sparse image - useless for direct writing.

Boot your device into TWRP. Mount internal storage then copy the new cust.ext4.img file to your device.

You need ADB on your computer for the next step. Open adb shell:

now do the following:

dd if=/sdcard/cust.ext4.img of=/dev/block/mmcblk0p23

assuming you copied the cust image to your internal storage

Once the dd process has completed, test this worked by mounting the cust partition inside TWRP. If it mounts then the dd worked correctly and your cust is restored.
how can i get one for huawei p9?
 
  • Like
Reactions: soroush3m