[Guide] [XT16XX] Moto G4/Plus Complete Partition Backup/Restore Zip/Script - Moto G4 Plus Guides, News, & Discussion

Code:
#include <disclaimer.h>
/*
* Your warranty is now.......(wait a minute)........still valid?
*
* I am not responsible for bricked devices.
* YOU are choosing to make these modifications, and if you point
* your finger at me for messing up your device, I will laugh at you.
*/
As we know that on flashing ROMs/kernels/other mods, we sometimes do some mistake or face some issues so it is always recommended to take backup.
But unfortunately, TWRP does not takes backup of all the partitions.
When you open/dev/block/bootdevice/by-name/ you can see the names of the partitions and there are a total of 48 partitions. Of course not every one of them is important to back up, but it's better to be safe than sorry.
This method has been tested on my Moto G4 Plus (XT1643) and all the parts are work on it (backup and restore both using zip file and batch file)
Here is the list to all those partitions along with their number/id (maybe that's what its called, please correct me if there's any mistake)
Code:
Number/ID Name
mmcblk0p1 modem
mmcblk0p2 fsc
mmcblk0p3 ssd
mmcblk0p4 sbl1
mmcblk0p5 sbl1bak
mmcblk0p6 rpm
mmcblk0p7 rpmbak
mmcblk0p8 tz
mmcblk0p9 tzbak
mmcblk0p10 hyp
mmcblk0p11 hypbak
mmcblk0p12 dsp
mmcblk0p13 modemst1
mmcblk0p14 modemst2
mmcblk0p15 DDR
mmcblk0p16 fsg
mmcblk0p17 sec
mmcblk0p18 aboot
mmcblk0p19 abootbak
mmcblk0p20 logs
mmcblk0p21 utags
mmcblk0p22 utagsBackup
mmcblk0p23 cid
mmcblk0p24 logo
mmcblk0p25 clogo
mmcblk0p26 metadata
mmcblk0p27 kpan
mmcblk0p28 boot
mmcblk0p29 recovery
mmcblk0p30 persist
mmcblk0p31 misc
mmcblk0p32 config
mmcblk0p33 limits
mmcblk0p34 mota
mmcblk0p35 devcfg
mmcblk0p36 dip
mmcblk0p37 syscfg
mmcblk0p38 cmnlib
mmcblk0p39 keymaster
mmcblk0p40 frp
mmcblk0p41 padC
mmcblk0p42 sp
mmcblk0p43 hw
mmcblk0p44 customize
mmcblk0p45 oem
mmcblk0p46 cache
mmcblk0p47 system
mmcblk0p48 userdata
modemst1 and modemst2 are your EFS (the IMEI which you see in settings). When we flash Stock ROM, we erase them with fastboot erase commands but they are regenerated with the help of persist, so never ever restore somebody else's persist on your device and always keep a backup of modemst1, modemst2 a.k.a EFS and persist.
@givitago has already made a backup script for all the partitions which can be found here: Complete Partition Backup Script, so huge thanx to him!
Q) So why create another thread?
A) Frankly speaking, this thread does the same work as the above-mentioned thread, but it also talks about restoring the backup.
Also, now you can back up the partitions with a TWRP flashable zip file and restore them too with a TWRP flashable zip too!
The backup and restore will be done using dd commands.
Those who are unaware of dd commands, it is generally used for converting files.
Here is the syntax for dd command (I have used colors so that it is easy to differentiate them):
Code:
[COLOR="Green"]su
dd[/COLOR] [COLOR="Blue"]if=/directoryName/fileName[SIZE="4"].[/SIZE]fileExtension[/COLOR] [COLOR="DeepSkyBlue"]of=/yourDirectoryName/yourFileName[SIZE="4"].[/SIZE]yourFileExtension[/COLOR]
directoryName is the generic name of the directory where the file (which we want to access) is present.
fileName is the generic name of the file which we want to access.
fileExtension is the generic file extension of the file which we want to access.
yourDirectoryName is the generic name of the directory where we will store the file.
yourFileName is the generic name of the file which we will store as backup.
yourFileExtension is the generic file extension of the file which we are taking a backup of.
And lastly, su because we will run these commands under root permissions.
This thread is divided into 2 parts, backup and restore.
We will be using .img extension for the backed up partitions.
Pre-requisites:
You must be on latest Stock ROM
You must be rooted (install Elemental-X kernel first and then flash Magisk otherwise you will have boot issues)
Terminal app or adb drivers in PC/Laptop
Official TWRP only (if you use adb in TWRP)
Note: The below commands are to be typed in a terminal app or adb shell.
Q) How to type in adb shell?
A) Open command prompt in the folder where you have adb and fastboot installed and type:
Code:
adb shell
Code:
su
This command it to get root access for the terminal/shell. Grant the root access and you will see that the $ symbol is replaced with# symbol which means that root access has been granted.
You can skip this command if you are using TWRP (although then you wouldn't be able to backup build.prop)
Note: The flashable zip files are attached as well as their link has been given. The rar files are the ones which contain the commands for backup/restore and also contains the batch file.
Its been a while since I have moved on to a newer device, and not remember quite a few things about the device. Here is something important to note:
echo92 said:
Just a thought, do you think it'd be worth stressing to users of the recovery script to ensure they do NOT include any of the bootloader partitions in their recovery folder? I've seen a couple of users hard brick their devices by attempting to flash older bootloader partitions accidentally ( luckily, now we've got a newer OPJ28.111-22 blankflash).
I think the partitions to avoid restoring are:
mmcblk0p4 sbl1
mmcblk0p5 sbl1bak
mmcblk0p6 rpm
mmcblk0p7 rpmbak
mmcblk0p8 tz
mmcblk0p9 tzbak
mmcblk0p10 hyp
mmcblk0p11 hypbak
mmcblk0p18 aboot
mmcblk0p19 abootbak
Possibly more if there are other critical partitions not accounted for.
Click to expand...
Click to collapse
This method won't backup/restore system, userdata and cache as they take up too much space and are reset on flashing Stock ROM again.

Part 1: Backup
Here are the list of commands which will be used to backup the partitions:
Code:
mkdir /sdcard/Athene_Partitions
dd if=/system/build.prop of=/sdcard/Athene_Partitions/build.prop
dd if=/dev/block/bootdevice/by-name/aboot of=/sdcard/Athene_Partitions/aboot.img
dd if=/dev/block/bootdevice/by-name/abootbak of=/sdcard/Athene_Partitions/abootbak.img
dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/Athene_Partitions/boot.img
dd if=/dev/block/bootdevice/by-name/cid of=/sdcard/Athene_Partitions/cid.img
dd if=/dev/block/bootdevice/by-name/clogo of=/sdcard/Athene_Partitions/clogo.img
dd if=/dev/block/bootdevice/by-name/cmnlib of=/sdcard/Athene_Partitions/cmnlib.img
dd if=/dev/block/bootdevice/by-name/config of=/sdcard/Athene_Partitions/config.img
dd if=/dev/block/bootdevice/by-name/customize of=/sdcard/Athene_Partitions/customize.img
dd if=/dev/block/bootdevice/by-name/DDR of=/sdcard/Athene_Partitions/DDR.img
dd if=/dev/block/bootdevice/by-name/devcfg of=/sdcard/Athene_Partitions/devcfg.img
dd if=/dev/block/bootdevice/by-name/dip of=/sdcard/Athene_Partitions/dip.img
dd if=/dev/block/bootdevice/by-name/dsp of=/sdcard/Athene_Partitions/dsp.img
dd if=/dev/block/bootdevice/by-name/frp of=/sdcard/Athene_Partitions/frp.img
dd if=/dev/block/bootdevice/by-name/fsc of=/sdcard/Athene_Partitions/fsc.img
dd if=/dev/block/bootdevice/by-name/fsg of=/sdcard/Athene_Partitions/fsg.img
dd if=/dev/block/bootdevice/by-name/hw of=/sdcard/Athene_Partitions/hw.img
dd if=/dev/block/bootdevice/by-name/hyp of=/sdcard/Athene_Partitions/hyp.img
dd if=/dev/block/bootdevice/by-name/hypbak of=/sdcard/Athene_Partitions/hypbak.img
dd if=/dev/block/bootdevice/by-name/keymaster of=/sdcard/Athene_Partitions/keymaster.img
dd if=/dev/block/bootdevice/by-name/kpan of=/sdcard/Athene_Partitions/kpan.img
dd if=/dev/block/bootdevice/by-name/limits of=/sdcard/Athene_Partitions/limits.img
dd if=/dev/block/bootdevice/by-name/logo of=/sdcard/Athene_Partitions/logo.img
dd if=/dev/block/bootdevice/by-name/logs of=/sdcard/Athene_Partitions/logs.img
dd if=/dev/block/bootdevice/by-name/metadata of=/sdcard/Athene_Partitions/metadata.img
dd if=/dev/block/bootdevice/by-name/misc of=/sdcard/Athene_Partitions/misc.img
dd if=/dev/block/bootdevice/by-name/modem of=/sdcard/Athene_Partitions/modem.img
dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/Athene_Partitions/modemst1.img
dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/Athene_Partitions/modemst2.img
dd if=/dev/block/bootdevice/by-name/mota of=/sdcard/Athene_Partitions/mota.img
dd if=/dev/block/bootdevice/by-name/oem of=/sdcard/Athene_Partitions/oem.img
dd if=/dev/block/bootdevice/by-name/padC of=/sdcard/Athene_Partitions/padC.img
dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/Athene_Partitions/persist.img
dd if=/dev/block/bootdevice/by-name/recovery of=/sdcard/Athene_Partitions/recovery.img
dd if=/dev/block/bootdevice/by-name/rpm of=/sdcard/Athene_Partitions/rpm.img
dd if=/dev/block/bootdevice/by-name/rpmbak of=/sdcard/Athene_Partitions/rpmbak.img
dd if=/dev/block/bootdevice/by-name/sbl1 of=/sdcard/Athene_Partitions/sbl1.img
dd if=/dev/block/bootdevice/by-name/sbl1bak of=/sdcard/Athene_Partitions/sbl1bak.img
dd if=/dev/block/bootdevice/by-name/sec of=/sdcard/Athene_Partitions/sec.img
dd if=/dev/block/bootdevice/by-name/sp of=/sdcard/Athene_Partitions/sp.img
dd if=/dev/block/bootdevice/by-name/ssd of=/sdcard/Athene_Partitions/ssd.img
dd if=/dev/block/bootdevice/by-name/syscfg of=/sdcard/Athene_Partitions/syscfg.img
dd if=/dev/block/bootdevice/by-name/tz of=/sdcard/Athene_Partitions/tz.img
dd if=/dev/block/bootdevice/by-name/tzbak of=/sdcard/Athene_Partitions/tzbak.img
dd if=/dev/block/bootdevice/by-name/utags of=/sdcard/Athene_Partitions/utags.img
dd if=/dev/block/bootdevice/by-name/utags-Backup of=/sdcard/Athene_Partitions/utags-Backup.img
The first command mkdir is used to create a folder named "Athene_Partitions" in your /sdcard directory, where all the partitions will be saved.
There is also a command to back up build.prop
Note: /sdcard is the same as the Internal storage directory. Do not confuse it with micro Sdcard as it has its directory named as /external_sd
I have not included backup of system, userdata, and cache partitions (system and userdata have huge sizes)
All these commands will create a backup of all the partitions except system, userdata and cache.
You can simply copy and paste them on the terminal and it will execute all of the commands simultaneously one after the other.
I am attaching a .bat file and a .txt file which will basically do the same thing as typing or copy-pasting the above commands.
Note: Backup-Partitions.bat and Backup-Partitions.txt should be saved together in adb and fastboot folder, otherwise the .bat file won't work.
I have created a TWRP flashable zip file which will do the same task as above. Make sure you flash it in Official TWRP only (Unofficial TWRP will also work, but I was facing some problem while restoring the partitions which were backed up using Unofficial TWRP, so just a warning).
Downloads:
Link: https://www.androidfilehost.com/?fid=11410963190603873123
md5: 16b9b34c82ca0cd8674428145961abff

Part 2: Restore
Note: Make sure that you place only the partitions which you want to restore in Athene_Partitions(if its not there, create it and put all the partitions which you want to restore in that folder) folder in /sdcard directory. Its fine if you still run all the commands while restoring partitions, as it will just ignore the files which it didn't find.
If you are using TWRP to restore the partitions, make sure it Official TWRP only (Unofficial TWRP won't work because for some partitions it might reboot in between (It happened with me and I do not know which partitions are causing this (one of them is hw)) so just a warning)
Here are the commands
Code:
dd if=/sdcard/Athene_Partitions/build.prop of=/system/build.prop
dd if=/sdcard/Athene_Partitions/aboot.img of=/dev/block/bootdevice/by-name/aboot
dd if=/sdcard/Athene_Partitions/abootbak.img of=/dev/block/bootdevice/by-name/abootbak
dd if=/sdcard/Athene_Partitions/boot.img of=/dev/block/bootdevice/by-name/boot
dd if=/sdcard/Athene_Partitions/cid.img of=/dev/block/bootdevice/by-name/cid
dd if=/sdcard/Athene_Partitions/clogo.img of=/dev/block/bootdevice/by-name/clogo
dd if=/sdcard/Athene_Partitions/cmnlib.img of=/dev/block/bootdevice/by-name/cmnlib
dd if=/sdcard/Athene_Partitions/config.img of=/dev/block/bootdevice/by-name/config
dd if=/sdcard/Athene_Partitions/customize.img of=/dev/block/bootdevice/by-name/customize
dd if=/sdcard/Athene_Partitions/DDR.img of=/dev/block/bootdevice/by-name/DDR
dd if=/sdcard/Athene_Partitions/devcfg.img of=/dev/block/bootdevice/by-name/devcfg
dd if=/sdcard/Athene_Partitions/dip.img of=/dev/block/bootdevice/by-name/dip
dd if=/sdcard/Athene_Partitions/dsp.img of=/dev/block/bootdevice/by-name/dsp
dd if=/sdcard/Athene_Partitions/frp.img of=/dev/block/bootdevice/by-name/frp
dd if=/sdcard/Athene_Partitions/fsc.img of=/dev/block/bootdevice/by-name/fsc
dd if=/sdcard/Athene_Partitions/fsg.img of=/dev/block/bootdevice/by-name/fsg
dd if=/sdcard/Athene_Partitions/hw.img of=/dev/block/bootdevice/by-name/hw
dd if=/sdcard/Athene_Partitions/hyp.img of=/dev/block/bootdevice/by-name/hyp
dd if=/sdcard/Athene_Partitions/hypbak.img of=/dev/block/bootdevice/by-name/hypbak
dd if=/sdcard/Athene_Partitions/keymaster.img of=/dev/block/bootdevice/by-name/keymaster
dd if=/sdcard/Athene_Partitions/kpan.img of=/dev/block/bootdevice/by-name/kpan
dd if=/sdcard/Athene_Partitions/limits.img of=/dev/block/bootdevice/by-name/limits
dd if=/sdcard/Athene_Partitions/logo.img of=/dev/block/bootdevice/by-name/logo
dd if=/sdcard/Athene_Partitions/logs.img of=/dev/block/bootdevice/by-name/logs
dd if=/sdcard/Athene_Partitions/metadata.img of=/dev/block/bootdevice/by-name/metadata
dd if=/sdcard/Athene_Partitions/misc.img of=/dev/block/bootdevice/by-name/misc
dd if=/sdcard/Athene_Partitions/modem.img of=/dev/block/bootdevice/by-name/modem
dd if=/sdcard/Athene_Partitions/modemst1.img of=/dev/block/bootdevice/by-name/modemst1
dd if=/sdcard/Athene_Partitions/modemst2.img of=/dev/block/bootdevice/by-name/modemst2
dd if=/sdcard/Athene_Partitions/mota.img of=/dev/block/bootdevice/by-name/mota
dd if=/sdcard/Athene_Partitions/oem.img of=/dev/block/bootdevice/by-name/oem
dd if=/sdcard/Athene_Partitions/padC.img of=/dev/block/bootdevice/by-name/padC
dd if=/sdcard/Athene_Partitions/persist.img of=/dev/block/bootdevice/by-name/persist
dd if=/sdcard/Athene_Partitions/recovery.img of=/dev/block/bootdevice/by-name/recovery
dd if=/sdcard/Athene_Partitions/rpm.img of=/dev/block/bootdevice/by-name/rpm
dd if=/sdcard/Athene_Partitions/rpmbak.img of=/dev/block/bootdevice/by-name/rpmbak
dd if=/sdcard/Athene_Partitions/sbl1.img of=/dev/block/bootdevice/by-name/sbl1
dd if=/sdcard/Athene_Partitions/sbl1bak.img of=/dev/block/bootdevice/by-name/sbl1bak
dd if=/sdcard/Athene_Partitions/sec.img of=/dev/block/bootdevice/by-name/sec
dd if=/sdcard/Athene_Partitions/sp.img of=/dev/block/bootdevice/by-name/sp
dd if=/sdcard/Athene_Partitions/ssd.img of=/dev/block/bootdevice/by-name/ssd
dd if=/sdcard/Athene_Partitions/syscfg.img of=/dev/block/bootdevice/by-name/syscfg
dd if=/sdcard/Athene_Partitions/tz.img of=/dev/block/bootdevice/by-name/tz
dd if=/sdcard/Athene_Partitions/tzbak.img of=/dev/block/bootdevice/by-name/tzbak
dd if=/sdcard/Athene_Partitions/utags.img of=/dev/block/bootdevice/by-name/utags
dd if=/sdcard/Athene_Partitions/utagsBackup.img of=/dev/block/bootdevice/by-name/utagsBackup
Like earlier in Step 1, I have not included system, userdata and cache.
You can simply copy and paste them on the terminal and it will execute all of the commands simultaneously one after the other.
I am attaching a .bat file and a .txt file which will basically do the same thing as typing or copy-pasting the above commands.
Note: Restore-Partitions.bat and Restore-Partitions.txt should be saved together in adb and fastboot folder, otherwise the .bat file won't work.
I have created a TWRP flashable zip file which will do the same task as above. Make sure you flash it in Official TWRP only (Unofficial TWRP won't work because for some partitions it might reboot in between (It happened with me and I do not know which partitions are causing this (one of them is hw)) so just a warning).
Just like earlier, just place the partitions you want to restore in Athene_Paritions folder and the zip file will ignore the partitions which aren't present.
Downloads:
Link: https://www.androidfilehost.com/?fid=11410963190603873124
md5: cfd44f834b72342816c308e915791135
Also do note that some people who weren't able to flash hw.img after getting their device changed from Moto G4 Plus to Moto G4, the restoring part wouldn't work for you unless you skip restoring hw.img, but trying won't hurt.

reserved.

Heeth21 said:
reserved.
Click to expand...
Click to collapse
how can i restore system, userdata and cache if i had a 16 gb model? i haven`t enough free space to backup these big parts. :c
commands through termanal app works well, but i want to backup all 48 parts of the stock ROM.
change all "sdcard" to "way_to_my_sd_card" through Msoft Word (faster) and run the script in terminal app, but it crashes and reboot in the process.

vlrgamaley said:
how can i restore system, userdata and cache if i had a 16 gb model? i haven`t enough free space to backup these big parts. :c
commands through termanal app works well, but i want to backup all 48 parts of the stock ROM.
Click to expand...
Click to collapse
I too have 16 GB model. Its just not practically possible to take backup of all these partitions on internal storage.
System, user data and cache will be changed(first erased and then recreated) if you clean flash a Custom ROM.
And on flashing Stock ROM, you will always have them so there isn't much to worry about their backup.
However if you still insist on taking their backup, there are two ways,
0. Reboot to recovery
1. Take their backup in external sd card.
The commands will be:
Code:
su
dd if=/dev/block/bootdevice/by-name/cache of=/external_sd/cache.img
dd if=/dev/block/bootdevice/by-name/system of=/external_sd/system.img
dd if=/dev/block/bootdevice/by-name/userdata of=/external_sd/userdata.img
These commands will save them in your external sd card.
2. Take their backup in PC/Laptop and then convert them
The commands will be:
Code:
adb pull /dev/block/bootdevice/by-name/cache
adb pull /dev/block/bootdevice/by-name/system
adb pull /dev/block/bootdevice/by-name/userdata
These commands will save their copy in your adb folder (so make sure you have enough space in that drive)
These files will have no extension so while restoring them take care of file extensions, so if we want to save them as .img files, we will have to convert them.
Now there are two ways to convert them:
a. Using Command Prompt/Command Line:
In Windows as well as in Linux, their file checksum remains the same, so no worries!
Also, I have restored the converted file (which was converted in Windows) and they work just fine!
Make sure you are running the command prompt/command line from the same directory where your cache, userdata and system files are stored.
Code:
In windows:
ren cache cache.img
ren userdata userdata.img
ren system system.img
In Linux:
mv cache cache.img
mv userdata userdata.img
mv system system.img
b. Directly changing their extension by renaming them:
Just rename the files manually.
Code:
cache->cache.img
system->system.img
userdata->userdata.img
This will change their file extensions.
In Windows as well as in Linux, the checksum remains the same by this method.
Also, I have restored the converted file (which was converted in Windows) and they work just fine!
Though I would still recommend converting them via command prompt/command line!
Edit: If you are using adb pull, it will take time as userdata and system are big partitions, also not to ignore the quality of USB cable, so be patient, it will take a while!
Edit2: @vlrgamaley was your friend able to recover their IMEI, I saw you earlier post in other thread.

Edit2: @vlrgamaley was your friend able to recover their IMEI, I saw you earlier post in other thread.
Click to expand...
Click to collapse
he wrote on phone "persist" twrp backup from Lenovo forum (in ext4 format), and after that phone works. gsm, 3g and calls also works, but 4g isn`t work and imei = 0 is staying. but calls works, and that`s not bad in that situation.
i try to backup userdata on sd and it crashes and boot again and again :c strange.

vlrgamaley said:
he wrote on phone "persist" twrp backup from Lenovo forum (in ext4 format), and after that phone works. gsm, 3g and calls also works, but 4g isn`t work and imei = 0 is staying. but calls works, and that`s not bad in that situation.
i try to backup userdata on sd and it crashes and boot again and again :c strange.
Click to expand...
Click to collapse
He messed up his device for good now. He will never able to recover IMEI now, unless by editing persist.
Backup by rebooting in TWRP.

Heeth21 said:
He messed up his device for good now. He will never able to recover IMEI now, unless by editing persist.
Click to expand...
Click to collapse
i don`t know why he hurry up with that, but he did it and now no way to return)
Heeth21 said:
Backup by rebooting in TWRP.
Click to expand...
Click to collapse
backup userdata in TWRP? ok.

vlrgamaley said:
backup userdata in TWRP? ok.
Click to expand...
Click to collapse
Well, you could do that infact, as TWRP can backup data, system and cache.
If you want to take their backup in .img format, reboot your device in TWRP as TWRP has adb enabled by default and then follow post #6 (https://forum.xda-developers.com/showpost.php?p=78354296&postcount=6)

Heeth21 said:
Well, you could do that infact, as TWRP can backup data, system and cache.
If you want to take their backup in .img format, reboot your device in TWRP as TWRP has adb enabled by default and then follow post #6 (https://forum.xda-developers.com/showpost.php?p=78354296&postcount=6)
Click to expand...
Click to collapse
ooooooooo, hard for me lol) "adb not found" but adb is on (from cmd on windows), and now phone in recovery. what i did wrong? i so stupid, sry)

vlrgamaley said:
ooooooooo, hard for me lol) "adb not found" but adb is on (from cmd on windows), and now phone in recovery? what i did wrong? i so stupid, sry)
Click to expand...
Click to collapse
Make sure you open command prompt from inside the adb folder or direct the command prompt to adb directory.
Open the folder where adb is present, press shift button + mouse right click and then you will see some options like refresh, view, sort by, etc. Select "Open command prompt window here" or "Open powershell window here" or similar to that.
If you open command prompt, then just continue, and if you open powershell, then just type "cmd" and hit enter and then backup.
To check if your device is recognized by pc in adb mode, type "adb devices" and you will see the serial number for your device.
If you have any more questions, do ask, don't do anything stupid as dd commands are very powerful and a mistake could by costly!

Heeth21 said:
Well, you could do that infact, as TWRP can backup data, system and cache.
If you want to take their backup in .img format, reboot your device in TWRP as TWRP has adb enabled by default and then follow post #6 (https://forum.xda-developers.com/showpost.php?p=78354296&postcount=6)
Click to expand...
Click to collapse
very strange error.

vlrgamaley said:
very strange error.
Click to expand...
Click to collapse
Could you explain??

Heeth21 said:
Could you explain??
Click to expand...
Click to collapse
you can see it on attach picture. that command isn`t work and i haven`t backup file of "cache" in adb folder...

vlrgamaley said:
you can see it on attach picture. that command isn`t work and i haven`t backup file of "cache" in adb folder...
Click to expand...
Click to collapse
Sorry, I missed the screenshot. What version of TWRP are you using?? Please use official TWRP, as mentioned in OP. I am using official TWRP and it works fine for me.
Here is the link to Official TWRP: https://dl.twrp.me/athene/
Download the latest version (3.2.1.0) and save the twrp in your adb folder, reboot to bootloader mode and then flash it. Command:
Code:
fastboot flash recovery twrp-3.2.1-0-athene.img
.
Then reboot into recovery from fastboot itself by using volume keys and selecting recovery option
Here is a screenshot when I use adb pull:

Heeth21 said:
Sorry, I missed the screenshot. What version of TWRP are you using?? Please use official TWRP, as mentioned in OP. I am using official TWRP and it works fine for me.
Here is the link to Official TWRP: https://dl.twrp.me/athene/
Download the latest version (3.2.1.0) and save the twrp in your adb folder, reboot to bootloader mode and then flash it. Command:
.
Then reboot into recovery from fastboot itself by using volume keys and selecting recovery option
Here is a screenshot when I use adb pull:
Click to expand...
Click to collapse
i have official twrp 3.2.1 right now and boot into recovery from fastboot through volume keys)
but command in prompt isn't work) wtf?)

vlrgamaley said:
i have official twrp 3.2.1 right now and boot into recovery from fastboot through volume keys)
but command in prompt isn't work) wtf?)
Click to expand...
Click to collapse
Did you wipe cache?? Try the commands for system and userdata and check if they work.
And please attach a screenshot

Heeth21 said:
Did you wipe cache?? Try the commands for system and userdata and check if they work.
And please attach a screenshot
Click to expand...
Click to collapse
ok, now is night in Siberia, and i go to sleep. tomorrow (+12 hrs) i try and write here about results)

vlrgamaley said:
ok, now is night in Siberia, and i go to sleep. tomorrow (+12 hrs) i try and write here about results)
Click to expand...
Click to collapse
If you are okay with a twrp backup, then just backup data, system and cache from twrp and store them.

Related

How do we flash just the baseband?

I haven't seen any releases of baesband packages.
There is no current method to flash just the baseband that I know of. Assuming you want the newest KK1, the method you can use is to flash back to stock, do the official OTA update from AT&T, and then flash the rom you want and the KK1 modem will remain.
This should work with all of the roms listed here--none of them have the modem packaged in it that I know of (and I think I've tried them all...)
Actually, there is Tested and working fine! I have meant to release a CWM updater for this method (it's sitting on my linux partition - but it needs more widespread testing.)
Here is the manual method:
grab the odin.tar containing radio you want
grab amss.bin and mdm.bin from it
adb push them to your /sdcard/
boot into CWM
use the menu to mount /emmc
connect in adb shell
type the following:
dd if=/dev/block/mmcblk0p13 of=/emmc/mmcblk0p13.bin
dd if=/dev/block/mmcblk0p17 of=/emmc/mmcblk0p17.bin
(this gives you a backup of your /system/etc/firmware/misc and /system/etc/firmware/misc_mdm which constitute the modem)
dd if=/emmc/amss.bin of=/dev/block/mmcblk0p13
dd if=/emmc/mdm.bin of=/dev/block/mmcblk0p17
(done, you are now on the new modem firmware)
as a sanity check you can attempt to mount the partition to verify it flashed correctly, unmount and dd your backup if it did not)
PM me a link and I'll test it for you.
Da_G said:
Actually, there is Tested and working fine! I have meant to release a CWM updater for this method (it's sitting on my linux partition - but it needs more widespread testing.)
Here is the manual method:
grab the odin.tar containing radio you want
grab amss.bin and mdm.bin from it
adb push them to your /sdcard/
boot into CWM
use the menu to mount /emmc
connect in adb shell
type the following:
dd if=/dev/block/mmcblk0p13 of=/emmc/mmcblk0p13.bin
dd if=/dev/block/mmcblk0p17 of=/emmc/mmcblk0p17.bin
(this gives you a backup of your /system/etc/firmware/misc and /system/etc/firmware/misc_mdm which constitute the modem)
dd if=/emmc/amss.bin of=/dev/block/mmcblk0p13
dd if=/emmc/mdm.bin of=/dev/block/mmcblk0p17
(done, you are now on the new modem firmware)
as a sanity check you can attempt to mount the partition to verify it flashed correctly, unmount and dd your backup if it did not)
Click to expand...
Click to collapse
Cool...Sorry to be naive here, what if you have a CWM zip, how do you extract the mdm.bin and amss.bin? If someone can post the KK1 equivalent of those two (if they are on 2.3.6), I can probably create a CWM package using above instructions.

[HOWTO] Unlocking i9505G bootloader

This will Wipe every thing on the internal storage SO BACKUP your stuff on the SD card and maybe the onto computer too
This is for the Google edition of the Galaxy S4
Go To setting / about phone /
Tap "Build Number" 7 times
Go back to Main Settings Menu and under now shown "Developer Options" enable "USB debugging"
Download this
http://developer.android.com/sdk/index.html#download
extract to the C drive in the folder adb (you can move it anywhere just adjust the path)
run "SDK Manager.exe"
in the extras select "Google USB Drivers"
click "Install 1 package" and accept license / Install
now go into the device manager on you PC and change the "Samsung ADB driver" to the
"Android Composite ADB Interface" located in this folder
C:\adb\sdk\extras\google\usb_driver
you will have to force that driver to install by selecting it
let it finish installing the drivers
then
unplug and then plug in the USB on the phone
your phone will ask you about "Allow USB debugging?"
check the box "always allow from this computer"
click OK on your phone
If this doesn't work the some thing is wrong with the drivers and reinstall the drivers make sure you select "Android Composite ADB Interface" and not "Android ADB Interface"
Now open up a command prompt (I did this as "run as administrator")
type "cd C:\adb\sdk\platform-tools" (or what ever the directory you extract your files)
enter this command
adb reboot bootloader <enter>
Once in bootloader,
In the command prompt type:
fastboot oem unlock <enter>
It will ask you to unlock you phone and this may void you warranty
Use the volume buttons to change to yes and the power button as enter
At this point everything gets wiped on your phone
The phone rebooted back into bootloader and it now said "bootloader=unlocked" and the bottom left of the screen
Reboot the phone and the unlock icon will appear on the 1st Google screen.
the phone will boot into android like it was new
I have not done any ODIN on my phone so i don't know how this affect it
I am trying to avoid ODIN and get the phone rooted and have a custom recovery on it.
I just did this on my phone and typed this up i think everything is accurate let me know if i need to adjust anything.
fyi the command "fastboot flash recovery recovery.img" don't work because the system is still secure boot enable.
Thanks and Questions
Thanks. Could you please tell where you found this info?
Also, I'm not that experienced and don't understand why this is necessary. Don't our GT-i9505G phones come with unlocked boot loader?
bsam55 said:
Thanks. Could you please tell where you found this info?
Also, I'm not that experienced and don't understand why this is necessary. Don't our GT-i9505G phones come with unlocked boot loader?
Click to expand...
Click to collapse
It still needs to perform fastboot oem unlock just like nexus device does
Sent using GT-i9505~
This is what i did on my galaxy nexus device (nexus 3) and my friend nexus one
I made this from my notes of the old devices
my experience is that i could mess up my phone and lock me out of it it, so i wanted to be sure i could fix it, that is why i did this
I did not try to use fastboot beforehand, so it could work.
but i have a feeling that the ODIN flash changed the bootloader (probably not)
but i have been screwed buy a odin flash messing with the bootloader on the vibrant( but for some reason there looked to be 3 bootloader on that device)
if some one want to try it
just put the ClockworkMod 6.0.3.3 recovery file the
C:\adb\sdk\platform-tools
adb reboot bootloader
fastboot boot recovery.img
this dose take 1 minute after the file is sent to reboot and load
I have tried TWRP but it don't load past the first screen.
This just boots into the file and doesn't change anything
access to the sd cards don't work
I am tempted to flash ClockworkMod but i would like to pull a copy of the recovery first.
BTW after paying $700 for a phone i want to be sure to be able to reinstall the OS, like on a PC.
warwolfx0 said:
This is what i did on my galaxy nexus device (nexus 3) and my friend nexus one
I made this from my notes of the old devices
my experience is that i could mess up my phone and lock me out of it it, so i wanted to be sure i could fix it, that is why i did this
I did not try to use fastboot beforehand, so it could work.
but i have a feeling that the ODIN flash changed the bootloader (probably not)
but i have been screwed buy a odin flash messing with the bootloader on the vibrant( but for some reason there looked to be 3 bootloader on that device)
if some one want to try it
just put the ClockworkMod 6.0.3.3 recovery file the
C:\adb\sdk\platform-tools
adb reboot bootloader
fastboot boot recovery.img
this dose take 1 minute after the file is sent to reboot and load
I have tried TWRP but it don't load past the first screen.
This just boots into the file and doesn't change anything
access to the sd cards don't work
I am tempted to flash ClockworkMod but i would like to pull a copy of the recovery first.
BTW after paying $700 for a phone i want to be sure to be able to reinstall the OS, like on a PC.
Click to expand...
Click to collapse
Maybe you can do a full dump for the community.
before you install custom recovery, I'd like to ask if you could do complete system dump of your device, including stock recovery (recovery.img), stock bootloader (boot.img) and system.img . It would be a big help to the community. You can do it simple after rooting with for example Motochopper exploit (described here http://whatswithtech.com/how-to-root-samsung-galaxy-s4/ )
Then something like this:
Code:
for gaining root access type: su
then:
copy BOOT -> dd if=/dev/block/mmcblk0p20 of=/sdcard/boot.img bs=4096
copy HIDDEN -> dd if=/dev/block/mmcblk0p27 of=/sdcard/hidden.img bs=4096
copy PARAM -> dd if=/dev/block/mmcblk0p19 of=/sdcard/param.bin bs=4096
copy RECOVERY -> dd if=/dev/block/mmcblk0p21 of=/sdcard/recovery.img bs=4096
copy SYSTEM -> dd if=/dev/block/mmcblk0p16 of=/sdcard/system.img bs=4096
Thanks a lot!
System Dump
Plus One on the system dump. There are a lot of knowledgeable people waiting to help as soon as they have this. I don't know enough to do it and did try CWM (which doesn't work, by the way.)
Hope you are able to help. Thanks
bmbm said:
before you install custom recovery, I'd like to ask if you could do complete system dump of your device, including stock recovery (recovery.img), stock bootloader (boot.img) and system.img . It would be a big help to the community. You can do it simple after rooting with for example Motochopper exploit (described here http://whatswithtech.com/how-to-root-samsung-galaxy-s4/ )
Then something like this:
Code:
for gaining root access type: su
then:
copy BOOT -> dd if=/dev/block/mmcblk0p20 of=/sdcard/boot.img bs=4096
copy HIDDEN -> dd if=/dev/block/mmcblk0p27 of=/sdcard/hidden.img bs=4096
copy PARAM -> dd if=/dev/block/mmcblk0p19 of=/sdcard/param.bin bs=4096
copy RECOVERY -> dd if=/dev/block/mmcblk0p21 of=/sdcard/recovery.img bs=4096
copy SYSTEM -> dd if=/dev/block/mmcblk0p16 of=/sdcard/system.img bs=4096
Thanks a lot!
Click to expand...
Click to collapse
cool thank i was looking for that info
Just i couldn't get su to work in adb
I have been able to get Supersu (also tried superuser) on the phone but it complains about the su binaries (busybox in superuser) not being installed i have tried to install it using the market app (which said i am rooted) but i get no popup on the system.
i might try a wipe to see if that fixed it. (i did flash root to the system so it should still be there after a wipe)
first root, then system dump
unless someone knows how to do a system dump without root? or temp root solution.
I will look into the motochopper later today
you don't need "su" to work in adb shell, if you run "adb root" and "adb remount" with a modified adbd binary (inside CWM for example) you will have root access.
pls try out this root zip I just made, maybe it will work
warwolfx0 said:
QUOTE]
DELETed
Click to expand...
Click to collapse
I have root
Thanks broodplank1337
download the root that "broodplank1337" made
and put it in "C:\adb\sdk\platform-tools" (this is my adb.exe folder)
Download ClockworkMod 6.0.3.3 NORMAL from below
http://forum.xda-developers.com/showthread.php?t=2359132&highlight=recovery
aka Miustone_CWM_flash-NORMAL.zip
extract the recovery.img to the folder "C:\adb\sdk\platform-tools"
Now open up a command prompt (I did this as "run as administrator")
type "cd C:\adb\sdk\platform-tools" (or what ever the directory you extract your files)
enter this command
adb reboot bootloader <enter>
Once in bootloader,
In the command prompt type:
fastboot boot recovery.img (this takes 1min to load after the file is sent)
This will boot into ClockworkMod
goto "install zip"
goto "install zip from sideload"
in the cmd type
adb sideload root.zip
This sends to the phone and write to the phones Rom.
Now reboot and we have root without ODIN on a I9505G
BTW my file was missing busybox in the xbin i was playing around with "CWM-SuperSU.zip" as a base
It is kind of late so i may have missed some things in this write up.
Now off to the system dump.
I will repost this later as a new post to keep this clean.
ok i had some issues with viewing the files on the phone
i moved them to the sdcard and then pulled them off the card on my pc using a "sd to usb"
dd if=/dev/block/mmcblk0p20 of=/storage/extSdCard/dump/boot.img bs=4096
dd if=/dev/block/mmcblk0p27 of=/storage/extSdCard/dump/hidden.img bs=4096
dd if=/dev/block/mmcblk0p19 of=/storage/extSdCard/dump/param.bin bs=4096
dd if=/dev/block/mmcblk0p21 of=/storage/extSdCard/dump/recovery.img bs=4096
dd if=/dev/block/mmcblk0p16 of=/storage/extSdCard/dump/system.img bs=4096
Is there any other mmcblk0p i should backup
and is there any issues with posting this info on this forum
so far this only has root
i did notice that clockworkmod did give me access to root but i couldn't find the sd card while fastbooting it.
I don't think that the whole bootloader is part of what i backup, I thought there was a sbl.bin that i need too.
warwolfx0 said:
ok i had some issues with viewing the files on the phone
i moved them to the sdcard and then pulled them off the card on my pc using a "sd to usb"
dd if=/dev/block/mmcblk0p20 of=/storage/extSdCard/dump/boot.img bs=4096
dd if=/dev/block/mmcblk0p27 of=/storage/extSdCard/dump/hidden.img bs=4096
dd if=/dev/block/mmcblk0p19 of=/storage/extSdCard/dump/param.bin bs=4096
dd if=/dev/block/mmcblk0p21 of=/storage/extSdCard/dump/recovery.img bs=4096
dd if=/dev/block/mmcblk0p16 of=/storage/extSdCard/dump/system.img bs=4096
Is there any other mmcblk0p i should backup
and is there any issues with posting this info on this forum
so far this only has root
i did notice that clockworkmod did give me access to root but i couldn't find the sd card while fastbooting it.
I don't think that the whole bootloader is part of what i backup, I thought there was a sbl.bin that i need too.
Click to expand...
Click to collapse
can you please upload your system dump , thank you mate
warwolfx0 said:
Thanks broodplank1337
download the root that "broodplank1337" made
and put it in "C:\adb\sdk\platform-tools" (this is my adb.exe folder)
Download ClockworkMod 6.0.3.3 NORMAL from below
http://forum.xda-developers.com/showthread.php?t=2359132&highlight=recovery
aka Miustone_CWM_flash-NORMAL.zip
extract the recovery.img to the folder "C:\adb\sdk\platform-tools"
Now open up a command prompt (I did this as "run as administrator")
type "cd C:\adb\sdk\platform-tools" (or what ever the directory you extract your files)
enter this command
adb reboot bootloader <enter>
Once in bootloader,
In the command prompt type:
fastboot boot recovery.img (this takes 1min to load after the file is sent)
This will boot into ClockworkMod
goto "install zip"
goto "install zip from sideload"
in the cmd type
adb sideload root.zip
This sends to the phone and write to the phones Rom.
Now reboot and we have root without ODIN on a I9505G
BTW my file was missing busybox in the xbin i was playing around with "CWM-SuperSU.zip" as a base
It is kind of late so i may have missed some things in this write up.
Now off to the system dump.
I will repost this later as a new post to keep this clean.
Click to expand...
Click to collapse
I maybe wrong in this, but I have played with fastboot on my ex HTC device. the proper command to flash recovery is
Code:
fastboot flash recovery recovery.img
the proper command to flash kernel is
Code:
fastboot flash boot boot.img
with
Code:
fastboot boot recovery.img
, the recovery isn't permanent. it will be only be there for the current session. after rebooting, the stock recovery will overwrite the custom recovery. the same goes to kernel.
Sent from my GT-I9505 using Tapatalk 2
warwolfx0 said:
ok i had some issues with viewing the files on the phone
i moved them to the sdcard and then pulled them off the card on my pc using a "sd to usb"
dd if=/dev/block/mmcblk0p20 of=/storage/extSdCard/dump/boot.img bs=4096
dd if=/dev/block/mmcblk0p27 of=/storage/extSdCard/dump/hidden.img bs=4096
dd if=/dev/block/mmcblk0p19 of=/storage/extSdCard/dump/param.bin bs=4096
dd if=/dev/block/mmcblk0p21 of=/storage/extSdCard/dump/recovery.img bs=4096
dd if=/dev/block/mmcblk0p16 of=/storage/extSdCard/dump/system.img bs=4096
Is there any other mmcblk0p i should backup
and is there any issues with posting this info on this forum
so far this only has root
i did notice that clockworkmod did give me access to root but i couldn't find the sd card while fastbooting it.
I don't think that the whole bootloader is part of what i backup, I thought there was a sbl.bin that i need too.
Click to expand...
Click to collapse
NONE of this would pull anything of relation from the I9505G (except System - mmcblk0p16) as our partitions layout is completely different. And more so, it would softbrick your 9505 if you tried flashing.
Check out here - http://forum.xda-developers.com/showthread.php?t=2360346 - for a system dump from the i9505G. It has SYSTEM/BOOT/RECOVERY. Param and Hidden are both empty on our phones. This has already been used a couple times to cook roms for other S4 devices.
donovanbrock said:
NONE of this would pull anything of relation from the I9505G (except System - mmcblk0p16) as our partitions layout is completely different. And more so, it would softbrick your 9505 if you tried flashing.
Check out here - http://forum.xda-developers.com/showthread.php?t=2360346 - for a system dump from the i9505G. It has SYSTEM/BOOT/RECOVERY. Param and Hidden are both empty on our phones. This has already been used a couple times to cook roms for other S4 devices.
Click to expand...
Click to collapse
Since my backup might mess people up i am not going to post it.
but as a backup i will make a full backup of all the mmcblk0pxx file
dd if=/dev/block/mmcblk0pxx of=/storage/extSdCard/dump/mmcblk0pxx.img bs=4096
i think there is like 20 files
Those with a real I9505G google edition samsung, do u have an option in settings to always have the lightkeys light up when screen is on? The menu and the back key, that light up.
hmmm followed step bye step but phones boot loader is still locked
i do have Super User access tho
edit: fail on my part. everything worked smoothly! thanks man!
Hello. Please help me. Can I flash stock ROM GT-I9005 on my Google Edition phone GT-I9005G? Thank for answer
SnegovikRZN said:
Hello. Please help me. Can I flash stock ROM GT-I9005 on my Google Edition phone GT-I9005G? Thank for answer
Click to expand...
Click to collapse
no

Any one with a fully rooted nxt-al10 or l29??? need modemnvm_backup/modemnvm_factory

Hi, as many other people i have unbricked my mate using Dc-phoenix and lost nerwork
is missing modemnvm_backup/modemnvm_factory/modemnvm_system partition in the flash, dc phoenix erase them but not reflashed them after. If any one with working al10 or l29 can extract them and upload this img,
If any one can give this three partition pls help
Thank you
i can not find working phone to get file
Here is a Trwp Modem Backup from L29
Extract and copy in Twrp Folder Backups
You can test,but i dont know if it works
thank you but my problem is this file is missing
modemnvm_backup
modemnvm_factory
modemnvm_system
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_factory of=/external_sd/backup/modemnvm_factory.img
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_backup of=/external_sd/backup/modemnvm_backup.img
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_img of=/external_sd/backup/modemnvm_img.img
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_system of=/external_sd/backup/modemnvm_system.img
dd if=/dev/block/platform/hi_mci.0/by-name/3rdmodemnvm of=/external_sd/backup/3rdmodemnvm.img
dd if=/dev/block/platform/hi_mci.0/by-name/3rdmodemnvmbkp of=/external_sd/backup/3rdmodemnvmbkp.im
dd if=/dev/block/platform/hi_mci.0/by-name/3rdmodem of=/external_sd/backup/3rdmodem.img
its defiant bro
elsokary said:
thank you but my problem is this file is missing
modemnvm_backup
modemnvm_factory
modemnvm_system
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_factory of=/external_sd/backup/modemnvm_factory.img
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_backup of=/external_sd/backup/modemnvm_backup.img
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_img of=/external_sd/backup/modemnvm_img.img
dd if=/dev/block/platform/hi_mci.0/by-name/modemnvm_system of=/external_sd/backup/modemnvm_system.img
dd if=/dev/block/platform/hi_mci.0/by-name/3rdmodemnvm of=/external_sd/backup/3rdmodemnvm.img
dd if=/dev/block/platform/hi_mci.0/by-name/3rdmodemnvmbkp of=/external_sd/backup/3rdmodemnvmbkp.im
dd if=/dev/block/platform/hi_mci.0/by-name/3rdmodem of=/external_sd/backup/3rdmodem.img
its defiant bro
Click to expand...
Click to collapse
This Modemfiles are from my L29,i Backup it with Partition Backup&Restore from Playstore
Working the Phone?
If yes Download the Files from Attachment
Extract the Partitions Backup.zip and copy the Folder Named "PartitionsBackups" in your external or internal Memory
install the apk file and open it
On the 3 Dot Menu Restore the Modem Files
i hope this works for you
Looking the Screenshots in Attachment to Help for the right Partition (mmcblk0p35/14/15/10/6/and 12)
thank you pro
i will try and tell you
Hero
You are my hero!
You saved my day! my week! my month!

[HOW-TO] Recover Bricked U11+

Greetings all.
Several weeks ago, I made this post seeking help with a self-created problem. I am happy to announce that the problem has been resolved with the immense help of sephstyler. He is literally my phone's messiah.
The afore-mentioned XDA member has a device identical to mine. I borrowed his and mirrored most of the data on his device by copying several partitions off his phone on to mine. I followed this guide about changing CID/MID.
I got a hold of a notepad document (you'll find it here) that lists partition information of the U11+. I wasn't sure which of my partitions were corrupt but I was certain the one containing the OS and IMEI information were messed up. My IMEI was blank. The OS version reported in fastboot was 9.99999 or something like that.
So I set out to copy these partitions and their corresponding img files in no particular order - boot, hosd, radio, modemst1, modemst2, cache, system, vendor, persist, and sdf1 (which carries CID info).
Please note that this method fixes the issue where your device is stuck on the bootloader screen with the message, "this phone has been flashed with unauthorised software and is locked....." And you will need a second device that is identical to yours (and functional too) for this process to work. I don't know if they both have to come from the same region (i.e have the same CID and MID). I guess there is no harm in trying. You couldn't possibly do more harm to your device by doing this. Or maybe you could. Either way, I will not be held responsible for any undesirable outcomes.
Steps taken:
- I installed HTC drivers on my computer, running Windows 10 64-bit. And 15-second ADB Installer. Get them both from here and here. I uninstalled HTC Sync Manager after the installation was done as I only needed the drivers.
- I flashed TWRP on the borrowed device so I could have access to adb from recovery.
- I then opened up a command prompt window on my computer, typed adb devices just to be sure that drivers were installed correctly.
The next few steps can be achieved right from within TWRP using the Terminal function. But I chose to use my computer as it'd be much quicker and I am less likely to make typos on a full-sized keyboard.
In a command prompt window, type adb shell. Hit enter.
To copy the system image, type dd if=/dev/block/sda5 of=/sdcard/system.img
For cache, type dd if=/dev/block/sdd21 of=/sdcard/cache.img
For boot, type dd if=/dev/block/sda3 of=/sdcard/boot.img
For radio, type dd if=/dev/block/sdd13 of=/sdcard/radio.img
For modemst1, type dd if=/dev/block/sde2 of=/sdcard/modemst1.img
For modemst2, type dd if=/dev/block/sde3 of=/sdcard/modemst2.img
For persist, type dd if=/dev/block/sde5 of=/sdcard/persist.img
For vendor, type dd if=/dev/block/sda6 of=/sdcard/vendor.img
For sdf1 (board_info), type dd if=/dev/block/sdf1 of=/sdcard/sdf1.img
For hosd, type dd if=/dev/block/sdd12 of=/sdcard/hosd.img
These img files would be saved to your internal storage. I then copied all files to the root folder of my faulty device's storage using Windows Explorer. System.img however refused to transfer. I got creative and used a microSD to make the transfer possible.
Now that these files were sitting comfortably on my phone, I booted to TWRP, connected it to my PC, then entered the following commands in Command Prompt via adb shell.
To copy these images to the appropriate partitions on your phone:
For board_info, type dd if=/sdcard/sdf1.img of=/dev/block/sdf1
For system, type dd if=/sdcard/system.img of=/dev/block/sda5
For cache, type dd if=/sdcard/cache.img of=/dev/block/sdd21
For boot, type dd if=/sdcard/boot.img of=/dev/block/sda3
For radio, type dd if=/sdcard/radio.img of=/dev/block/sdd13
For modemst1, type dd if=/sdcard/modemst1.img of=/dev/block/sde2
For modemst2, type dd if=/sdcard/modemst2.img of=/dev/block/sde3
For persist, type dd if=/sdcard/persist.img of=/dev/block/sde5
For vendor, type dd if=/sdcard/vendor.img of=/dev/block/sda6
For hosd, type dd if=/sdcard/hosd.img of=/dev/block/sdd12
Upon completion, press Ctrl+C or type exit to quit adb shell. Then type adb reboot to reboot your device.
If the above commands were entered correctly (and if the adb gods smile upon you), your device should be restored.
Now I know that copying all images fixed the issue. My guess is the system, boot, and radio images were the crucial ones. I am not entirely sure. But I was desperate for a positive result so I copied the ones that I deemed important.
I hope this helps someone. Cheers.
P.S: My apologies for the formatting. I am still fairly new to this. Also, I just realised I could upload these images for anyone who doesn't have access to a second device. I shall update the post with download links after the upload's completed. Sorry about the brain fart.
[EDIT] Images are up. You can find them here. These files are for the Taiwan-based HTC U11+ (CID - HTC_621)
Nice tutorial.
Hi, I'm having a similar problem with my U11+.... followed ur download link but a decryption key is needed. whats the decryption key?
ChuDust said:
Hi, I'm having a similar problem with my U11+.... followed ur download link but a decryption key is needed. whats the decryption key?
Click to expand...
Click to collapse
Here's the key. I had no idea the files were encrypted to begin with. Sorry about that.
-b087zdU9re0k3e3HHah1w
P.S: Since you're downloading the image files from the link provided, you don't have to go through the first half of the process - copying data from a working phone to an external location.
Best of luck.
Hello. I have an identical situation. My original CID is 622. I changed the CID to 001, but after RUU firmware I could not boot into the system. Now after flash RUU, the phone will reboot into the bootloader. Can anyone help me?
Do you have to be rooted or with unlocked bootloader to be able to backup the phone partitions using this method ?
Or does it just work on completely stock from an db connection to PC ?
Thank you.
The bootloader needs to be unlocked at the very least so you can gain access to the required partitions. Root isn't necessary.
Hope this helps.
Hello, I followed your instructions and made backups of my partitions from HTC U11+ dual-sim european version 401.12.
With unlocked bootloader and rooted with magisk by patched boot image.
Ran adb shell and su while phone was running normally in Android OS and connected to PC.
I'm curious about the sizes of the images created because they don't match with the sizes from partitions.txt.
For example "4210688 sda5 - system" is actually 4,311,744,512 bytes,
"65536 sda3 - boot" is actually 67,108,864 bytes in created image, but the actual boot.img from the OTA file is 38,163,762 bytes.
If these sizes are different can I actually trust the created images ? and use them in need.
Can these created images be flashed by fastboot, for example for system.img: "fastboot flash -S 1G system system.img" ?
Thanks.
andreipaval said:
I'm curious about the sizes of the images created because they don't match with the sizes from partitions.txt.
For example "4210688 sda5 - system" is actually 4,311,744,512 bytes,
"65536 sda3 - boot" is actually 67,108,864 bytes in created image, but the actual boot.img from the OTA file is 38,163,762 bytes.
Thanks.
Click to expand...
Click to collapse
If you divide the 4,311,744,512 bytes by the 1024, you get what you need - 4210688 - this is in Kb.
And so same for boot - 67,108,864 bytes / 1024 = 65536 Kb.
andreipaval said:
Hello, I followed your instructions and made backups of my partitions from HTC U11+ dual-sim european version 401.12.
With unlocked bootloader and rooted with magisk by patched boot image.
Ran adb shell and su while phone was running normally in Android OS and connected to PC.
I'm curious about the sizes of the images created because they don't match with the sizes from partitions.txt.
For example "4210688 sda5 - system" is actually 4,311,744,512 bytes,
"65536 sda3 - boot" is actually 67,108,864 bytes in created image, but the actual boot.img from the OTA file is 38,163,762 bytes.
If these sizes are different can I actually trust the created images ? and use them in need.
Can these created images be flashed by fastboot, for example for system.img: "fastboot flash -S 1G system system.img" ?
Thanks.
Click to expand...
Click to collapse
Hi. I hope your first question was answered. Regarding your second concern, I'm afraid I don't have an answer to that. At the time, flashing any image files onto my device didn't fix the issue even though each flash completed successfully. Copying them manually sure did.
Hope this helps.
Do you have the twrp backup of the stock rom?
andreipaval said:
Hello, I followed your instructions and made backups of my partitions from HTC U11+ dual-sim european version 401.12.
With unlocked bootloader and rooted with magisk by patched boot image.
Ran adb shell and su while phone was running normally in Android OS and connected to PC.
I'm curious about the sizes of the images created because they don't match with the sizes from partitions.txt.
For example "4210688 sda5 - system" is actually 4,311,744,512 bytes,
"65536 sda3 - boot" is actually 67,108,864 bytes in created image, but the actual boot.img from the OTA file is 38,163,762 bytes.
If these sizes are different can I actually trust the created images ? and use them in need.
Can these created images be flashed by fastboot, for example for system.img: "fastboot flash -S 1G system system.img" ?
Thanks.
Click to expand...
Click to collapse
Hello,
do you have the twrp backup of stock rom?
I did not make backups with twrp.

[SOLVED] Help to mount userdata in linux or repair userdata.img

After an Update of Two magisk modules, my Ulefone Armor 11 5G staied stucked on boot logo, I can only enter in recovery or fastboot.
I try to build a TWRP, but it is not able to mount userdata.
I was able to download with the help of mtkclient all the partition on my phone, even userdata , it took 7 hours.
I wanted to load the image in linux but using mount disk imag or using the command sudo mount -o loop userdata.img ~/Armor_11_5G doesn't do anything not even an error message.
I'm wondering if the filesystem was corrupted during the update.
Is it possible to repair the fylesystem like in Windows?
Thanks
did you previously disable encryption and factory reset long time before the modules updates failed?
what do you mean mount doesn't do anything not even an error message? either it give error message or it succeed.
I didn't disable encryption before updating the modules, I already updated this modules many times.
what do you mean mount doesn't do anything not even an error message? either it give error message or it succeed.
Click to expand...
Click to collapse
That is the problem, it doesn't succed and I don't have an error message. The file is 256 Gbyte big, I don't know if it plays a role. I'm using Ubuntu 22
if phone is encrypted that's just 256G garbage. post the output of
Code:
$ parted <file> unit B print
Here are the results of parted
Code:
Error: /home/*****/Public/userdata.bin.img: unrecognised disk label
Model: (file)
Disk /home/osboxes/Public/userdata.bin.img: 249208733696B
Sector size (logical/physical): 512B/512B
Partition Table: unknown
Disk Flags:
Thanks
You may try https://www.cgsecurity.org/wiki/TestDisk_Download
I'd be glad for your feedback.
sorry thought it's whole disk, but it's only 232G file therefore parted won't print partition table
does apply to FDE only
assuming this file is dump of single userdata partition, open with HxD editor. if the partition image is not encrypted, you will see lot zeros within first 1024 bytes.
in that case you can check for file system type is ext4 or f2fs.
Code:
$ xxd -l 1080 dump.img | grep 53ef
$ xxd -l 1024 dump.img | grep 1020.f5f2
But most likely the userdata partition is encrypted, therefore no way to recover data offline.
The easiest way not to load Magisk modules is, not to load Magisk. Flashing stock boot.img will solve it.
Beware, in case you disabled encryption beforehand, booting stock boot.img will force encryption. This may take long time without notice.
I never disabled encryption, I don't know if Magisk do it without informing. I used this phone for an year without a problem.
After the update I left the phone on for one night but nothing happens. I tried to reflash the stock boot image, and again a whole night wait, but again nothing happens.
Reading the fstab the file system should be ext4.
The file is the dump of the whole userdata partition of my Ulefone Armor 11 5G.
I did a backup of the whole system before doing any experiment so if the partition table is corrupted maybe if I reflash back the userdata partition with a working partition table I have again access to the datas.
there is no partition table in userdata partition, I just gave you wrong advise. because the phones total storage is 256G, I made wrong assumptions (you can view partition table from file pgpt.bin)
full 1:1 backup is impossible for FBE encryption because encryption keys are stored in TEE. once you factory reset device backup of userdata + metadata becomes useless.
fstab doesn't tell you what file you just have dumped. if you can't find ext4 super magic (#7) it's impossible to loop mount that file (and impossible to decrypt on linux PC)
if you can't fix boot-loop by stock boot.img then it's unrelated to magisk modules. you can however enable adb in default.prop and capture adb logcat during boot-loop for further analysis. you could also inject own script that deletes some files (only DE encrypted files, CE encrypted files requires lock screen credentials aka pin/pattern)
boot this TWRP and get log from adb
Code:
$ fastboot boot recovery.img
$ adb shell twrp decrypt '1234'
$ adb pull /tmp/recovery.log
https://twrp.me/faq/openrecoveryscript.html
full 1:1 backup is impossible for FBE encryption because encryption keys are stored in TEE. once you factory reset device backup of userdata + metadata becomes useless.
Click to expand...
Click to collapse
With mtk client I was able to do the backup of tee1 and tee2 and also of gpt_backup and gpt_main.
$ xxd -l 1080 dump.img | grep 53ef
$ xxd -l 1024 dump.img | grep 1020.f5f2
Click to expand...
Click to collapse
Doesn't produce any results.
I have immediately the command prompt.
you can however enable adb in default.prop
Click to expand...
Click to collapse
How can I do that? Which value should I change in default.prop?
so your "backup" is encrypted. please note Trustonic Kinibi is TEE OS running in secure memory one can't access or backup with mtkclient. the tee partitions in phone storage do not contain any encryption key (none of the partitions does, secure memory is not even a partition). the only crypto related partition is metadata used for keydirectory of metadata encryption (on top of FBE encryption) but it is useless for backup purposes.
yes you can modify default.prop in boot.img, ro.secure=0 should give root access.
https://forum.xda-developers.com/t/...hone-with-broken-screen.2965462/post-85905033
Code:
ro.secure=0
ro.debuggable=1
persist.service.adb.enable=1
in case the default.prop modification is not sufficient, you need additional command to be executed as root.
Code:
# settings put global adb_enabled 1
as you installed magisk, you could use magisk overlay.d/sbin/ for running startup script.
https://forum.xda-developers.com/t/...ithout-losing-your-data.4383255/post-86934375
aIecxs said:
boot this TWRP and get log from adb
Code:
$ fastboot boot recovery.img
$ adb shell twrp decrypt '1234'
$ adb pull /tmp/recovery.log
https://twrp.me/faq/openrecoveryscript.html
Click to expand...
Click to collapse
How about this TWRP? it should be able to decrypt userdata. if decryption failed, provide recovery.log
Until tomorrow I cannot do a logcat and I cannot find my view logcat on my laptop.
I unpacked boot.img with Carliv Image Kitchen and there is no default.prop, that is present in the recovery as prop.default.
Is there a way to backup secure memory of Trustonic?
How about this TWRP? it should be able to decrypt userdata. if decryption failed, provide recovery.log
Click to expand...
Click to collapse
I already tried that version but it cannot decrypt, that' why I'm trying to build my own version of TWRp with the help of the creator of that version of TWRP, but I'm stucked.
oh, you know how to build TWRP with proper FBE + metadata encryption support? have a look at other Oppo devices how they did... good luck.
regarding default.prop in boot.img (it's a symlink to system unfortunately) you can do it the other way
use magisk overlay.d/sbin/
create a boot script that does the thing with resetprop -n <prop_name> <prop_value>
don't use outdated Carliv Image Kitchen! use osm0sis AIK from link above.
oh, you know how to build TWRP with proper FBE + metadata encryption support? have a look at other Oppo devices how they did... good luck.
Click to expand...
Click to collapse
I'm learning.
I try to integrate the decryption service following the suggestion of ADeadTrouser on Github, but the service doesn't want to start and I don't understand why.
I never checked Oppo, I will take a look at them also, thanks for the suggestion.
I think I figured out now the adb logcat at least. hope that helps
https://forum.xda-developers.com/t/accessing-my-phone-with-a-dead-screen.4542763/post-88016019
I tried your script butr nothing happens, the telephone is not listed when I type
Code:
adb devices
and if I type
Code:
adb logcat
I receive the message waiting for device
you might follow the thread
wenyendev said:
You may try https://www.cgsecurity.org/wiki/TestDisk_Download
I'd be glad for your feedback.
Click to expand...
Click to collapse
I run the software on the image and it identify the contents and can read the encrypted and not encrypted part, that means that all the files are there, but I cannot mount in Linux or in TWRP
The fact that I cannot mount in Linux or TWRP the userdata image/partition can be that is corrupted the partition or the file index?
That would also explain why the script for Magisk provided by aIecxs is not able to copy the adb_key from the cache in the data partition.

Categories

Resources