this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Good idea to post that (used it too with some backups). If you can't get into your device (bootloop etc) you should be able to do it on your pc. I tried doing it with md5sum (see attached) but it then adds an extra x0D (carriage return)... so if someone knows how to do this, please add to this topic
Regards,
Nika.
Thnx. can be very usefull
I have ca. 3 archives where I get md5 mismatch only one is restorable. Only for understanding do I only create an empty folder and make this or must I use the backup folder from my backup ?
Thx in advance
Dontron
DonTron said:
I have ca. 3 archives where I get md5 mismatch only one is restorable. Only for understanding do I only create an empty folder and make this or must I use the backup folder from my backup ?
Thx in advance
Dontron
Click to expand...
Click to collapse
Please explain what you mean. You have 3 backups that give you this error? Then you should go to each of those backup-folders and run "md5sum *img > nandroid.md5" (without the quotes off course). This will regenerate the md5 file and then the restore should work if the backup files are intact (I've had some backups with 0 kb files too)
..I tried and get "bad substitution"
Dontron
Edit: I renamed the folders and now I can use the command..give a try.
Gesendet von meinem GT-I9001 mit Tapatalk
..thx now it works like a charm and I can restore my old working rom.
Dontron
Gesendet von meinem GT-I9001 mit Tapatalk
You want to do it automatically through ADB? Here's a script:
Code:
@echo off
set FixMD5backup=[COLOR=Red][B]/mnt/sdcard/clockworkmod/backup/011-12-16.12.56.43[/B][/COLOR]
echo cd %FixMD5backup% >FixMD5.adb
echo pwd >>FixMD5.adb
echo ls -l -a * >>FixMD5.adb
echo chmod 666 nandroid.md5 >>FixMD5.adb
echo rm nandroid.md5 >>FixMD5.adb
echo md5sum *img *tar ^>nandroid.md5 >>FixMD5.adb
echo ls -l -a * >>FixMD5.adb
echo cat nandroid.md5 >>FixMD5.adb
echo exit >>FixMD5.adb
adb -d shell <FixMD5.adb
del FixMD5.adb
pause
Make sure the path is correct
Regards,
Nika.
rideriang said:
this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Click to expand...
Click to collapse
If you are using a back from your sdcard, you will need to mount r/w.
Here is what I did, and it worked perfect.
BETAlatform-tools akelly$ ./adb shell
# mount -o remount rw /sdcard
# cd sdcard/clockworkmod/backup/
# ls
2011-11-09.MIUI-1.11.4-base 2011-12-12-CM7-GlitchV13
2011-11-09.MIUI-GLITCH-1.11.4-loaded 2011-12-12-CM7-GlitchV13-basic
# cd 2011-12-12-CM7-GlitchV13
# ls
boot.img datadata.yaffs2.img system.yaffs2.img
cache.yaffs2.img nandroid.md5
data.ext4.tar recovery.img
# rm nandroid.md5
# md5sum *img > nandroid.md5
Click to expand...
Click to collapse
rideriang said:
this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Click to expand...
Click to collapse
Worked out perfectly. You are a scholar and a gentleman.
nikagl said:
Good idea to post that (used it too with some backups). If you can't get into your device (bootloop etc) you should be able to do it on your pc. I tried doing it with md5sum (see attached) but it then adds an extra x0D (carriage return)... so if someone knows how to do this, please add to this topic
Regards,
Nika.
Click to expand...
Click to collapse
For reference, attached is md5.exe and dos2unix.exe.
Here's the script to execute md5.exe (see attached) and make the nandroid.md5 on your pc:
Code:
@echo off
del nandroid.md5
for %%i in (boot.img,cache.ext4.tar,data.ext4.tar,recovery.img,system.ext4.tar,.android_secure.vfat.tar) do md5 %%i>>nandroid.md5 && echo %%i>>nandroid.md5
dos2unix nandroid.md5
pause
Btw, for everyone good to know, you can always run the md5sum from adb in clockworkmod recovery too (just before doing the backup, even when you're in the backup screen!):
Code:
adb shell
# cd /sdcard/clockworkmod/backup/[B]BACKUPDATE[/B]
# rm nandroid.md5
# md5sum *img >nandroid.md5
# exit
Regards,
Nika.
nikagl said:
... reference, attached is md5.exe and dos2unix.exe.
Here's the script to execute md5.exe (see attached) and make the nandroid.md5 on your pc:.
Click to expand...
Click to collapse
Hi,
Could you guide how to use the file? I'm totally newbie here. Using ClockWorkMod Touch Recovery Lilg for Galaxy Mini
Tq
exz8 said:
Hi,
Could you guide how to use the file? I'm totally newbie here. Using ClockWorkMod Touch Recovery Lilg for Galaxy Mini
Tq
Click to expand...
Click to collapse
Can you first check the filesize of each file that the backup created? If there's 0kb files you will not be able to restore them, do it with Advanced Restore one by one and you may be able to get back stuff...
If you don't know how to use the files I uploaded, I doubt a guide will help you
nikagl said:
Can you first check the filesize of each file that the backup created? If there's 0kb files you will not be able to restore them, do it with Advanced Restore one by one and you may be able to get back stuff...
If you don't know how to use the files I uploaded, I doubt a guide will help you
Click to expand...
Click to collapse
Inside backup folder have 2 files.
both files are same size. Under CWM Folder I found 2 files as attach.
Anything wrong?
exz8 said:
Inside backup folder have 2 files.
both files are same size. Under CWM Folder I found 2 files as attach.
Anything wrong?
Click to expand...
Click to collapse
That does not seem like a complete backup. Normally you also have a system.ext4.tar, data.ext4.tar and cache.ext4.tar. I guess this backup failed.
The only things you have is a kernel (boot.img) and the recovery.
wintel_mac said:
That does not seem like a complete backup. Normally you also have a system.ext4.tar, data.ext4.tar and cache.ext4.tar. I guess this backup failed.
The only things you have is a kernel (boot.img) and the recovery.
Click to expand...
Click to collapse
Right, I'd talk to the one that supports your cwm (touch recovery Lilg for Galaxy Mini)
I think I know already. Today, I had try backup and it's fine. Probably last time, I'm not use the proper method. Anyway, thanks for intention to help.
Tq
i am newbie
sorry for my question :
i have 03 clockworkmod backup in my ext_sd card named :
1 - 2012-05-08.16.48.10
2 - 2012-05-08.16.17.27
3 - 2012-05-02.02.25.41
i renamed them to :
1 - nitrox
2 - moon
3 - kqb
but when i try to restor i have md5 mismatch for all them
how to do for fix them all
please
EDIT : i finally understund the way :
i have moved clockworkmod from external_sd to sdcard
put the phone in usb debug
and than call adb shell with this :
adb shell
$ su
#
# cd /sdcard/clockworkmod/backup/nitrox
# rm nandroid.md5
# md5sum *img >nandroid.md5
# cd /sdcard/clockworkmod/backup/moon
# rm nandroid.md5
# md5sum *img >nandroid.md5
# cd /sdcard/clockworkmod/backup/kqb
# rm nandroid.md5
# md5sum *img >nandroid.md5
# exit
and then move back the clockworkmod to extrenal_sd and now all my backups work fine
thank you very much
rideriang said:
this is how i did to fix md5 missmatch due to restore from feamod recovery
-firstly make a folder clockworkmod/backup/2011-12-16.12.56.43 IN INTERNAL SDCARD
open terminal emulator
type su
#cd / sdcard/clockworkmod/backup/2011-12-16.12.56.43
#rm nandroid .md5 (if u get this rm failed for nandroid. read-only file system just leave it)
#md5sum *img > nandroid.md5
reboot to recovery
restore from internal
Click to expand...
Click to collapse
worked like a charm!!
THANK YOU!!!!
HTC EVO 4G CM7
very helpful
thanks ..
Related
Hey all,
I had the sense to use the Rotobackup method on my new Sprint Tab after rooting it with the Z4root package. I then proceeded with the ( now outdated ) CWM Flash process adapted from the Epic 4g. Now, I can get into CWM and the process appears to be functional, but I can't get the "Wipe Data/Factory Reset" to work. It all goes well, but when I boot back into android, all the junk is still there.
Now, I know this wouldn't normally be a big deal... However.. In set'n up for my Rotobackup, I punched in a spare Gmail account in case someone wanted a copy of the backup for dissection,etc... Now, since I can't get the factory wipe to work ( neither from the Privacy menu, nor CWM ), I can't get that acct off my Tab so I can get to all my purchased apps on my main account.
Since I have the Rotobackup, I'm thinking that I can just restore one of those packages and get the stock recovery image back in place. I just want to verify which one I should restore before I move forward.
My expectation is that I need to restore the 'boot.bin' file. Can someone confirm this?
For the record, these are the files I have saved:
Code:
-rw-r--r--. 1 root root 262144 Dec 22 19:00 boot.bin
-rw-r--r--. 1 root root 32768000 Dec 22 19:00 cache.rfs
-rw-r--r--. 1 root root 25620093 Dec 22 19:23 data.tgz
-rw-r--r--. 1 root root 86507520 Dec 22 19:00 dbdata.rfs
-rw-r--r--. 1 root root 6553600 Dec 22 19:00 efs.rfs
-rw-r--r--. 1 root root 336068608 Dec 22 19:00 factoryfs.rfs
-rw-r--r--. 1 root root 16777216 Dec 22 19:00 modem.bin
-rw-r--r--. 1 root root 1310720 Dec 22 18:58 param.lfs
-rw-r--r--. 1 root root 262144 Dec 22 19:00 pit.pit
-rw-r--r--. 1 root root 1310720 Dec 22 19:00 Sbl.bin
-rw-r--r--. 1 root root 7864320 Dec 22 18:59 zImage
Thanks in advance,
LK
Or, can I simply do an rm -rf /data/* to get the effect of a factory wipe?
Thanks,
LK
Ok, I figured it out..
So, the thought of flashing the recovery image came from my root experiences on Evo. I decided while waiting for a response to do more digging through the CWM installation routine and noticed that it made a backup of the original recovery file ( since on Epic and Tab, it's a redirector method instead of an image on the Evo ). AND.. it had a 'Remove root/CWM' option!
I modified the run.sh script to NOT remove root on that option and only put the original CWM in place, ran it.. and VIOLA!
Hope this may help someone else.
LK
are you saying you have a working CWM running on your Sprint-flavored tab?
Hello Zoinks,
Nope... the CWM wasn't working properly on my Samsung Tab. I reverted to the stock recovery on my Tab to regain the ability to wipe it.
Thanks,
LK
and you were so close to being my new best friend
which modem are you using? we have not been able to properly export the factory modem
I'm afraid neither of us are that lucky.
I'm still using the original modem. Nothing has actually been flashed to the device aside from what it took to root it.
Nothing to see here...
LK
ok, so I also just rooted my new sprint tab. using the z4root method. I also have learned about rooting through my evo. I have not however got as far as you have as in getting a recovery image. If i understand what I have tried to absorb on this from the board, is that A) I should have gone with tmobile for the tab!!!! lol and B) this aint no EVO!!!!!
So could you point me in the right direction/advice with what I should do now, because I am lost!!!!
thanks in advance
I'd install bash with the 'Bash Installer' app from the market, and then any other goodies you like for rooted devices ( Adfree Android is a personal fav ).
Aside from that, hang tight and watch for more advancements in alternative ROMS and Recovery managers. Don't install any recovery manager at this time as they are too buggy for normal use and don't really have much in the way of usable features yet.
Clockwork Mod is the closest, but still doesn't support nandroid backup and the like.
Oh, also.. you should check into creating a 'Rotobackup' of your device per the instructions found in another thread of this sub-form.
Enjoy!
LK
linuxkidd said:
Ok, I figured it out..
So, the thought of flashing the recovery image came from my root experiences on Evo. I decided while waiting for a response to do more digging through the CWM installation routine and noticed that it made a backup of the original recovery file ( since on Epic and Tab, it's a redirector method instead of an image on the Evo ). AND.. it had a 'Remove root/CWM' option!
I modified the run.sh script to NOT remove root on that option and only put the original CWM in place, ran it.. and VIOLA!
Hope this may help someone else.
LK
Click to expand...
Click to collapse
I'm having the same problem, can you tell me how to do that? Where's the run.sh file?
Thanks.
Hello zephyrd,
The problem I had was because I used the CWM process outlined in this thread. The 'run.sh' script is the one included with the downloads in that thread.
I edited the run.sh file as follows:
* FInd the section that starts with 'function remove {'
* Inside that section, find the following two sub-sections:
- echo Running root file cleaner on device
- echo Removing remount binary
* Comment out the lines under those sections with # so that the final 'function remove {' section looks like this:
Code:
function remove {
clear
echo +++++++++++++++++++++++++++++++++++++++++++++++++++++
echo "Simple Root and ClockworkMod Uninstaller 2.01";
echo +++++++++++++++++++++++++++++++++++++++++++++++++++++
echo Bash Scripts by DRockstar and Firon
echo exploit by joeykrim, original uninstaller by noobnl
echo
echo REMOVES ALL ROOTS AND CLOCKWORKMOD REDIRECTOR
echo MODIFIED FOR USE WITH GALAXY TAB
chooser
startserver
checkroot
echo Mount device RW
$adb shell mount -t rfs -o remount,rw /dev/block/stl9 /system
#echo Running root file cleaner on device
#$adb push rclean /system/xbin/rclean
#$adb shell chmod 755 /system/xbin/rclean
#$adb shell /system/xbin/rclean
#$adb shell rm /system/xbin/rclean
#echo Removing remount binary
#$adb shell rm /system/bin/remount > /dev/null 2>&1
#$adb shell rm /system/xbin/remount > /dev/null 2>&1
echo Removing ClockworkMod redirector
$adb shell rm /system/bin/recoveryfiles/*
$adb shell rmdir /system/bin/recoveryfiles
$adb shell rm /system/bin/recoveryres/images/*
$adb shell rmdir /system/bin/recoveryres/images
$adb shell rm /system/bin/recoveryres/*
$adb shell rmdir /system/bin/recoveryres
$adb shell rm /system/bin/recovery
echo Restoring original recovery file
$adb push recovery /system/bin/recovery
$adb shell chmod 755 /system/bin/recovery
echo Rebooting phone
$adb reboot
checkboot
echo
echo SIMPLE ROOT UNINSTALLER COMPLETED.
end
}
When you run the 'run.sh' command, pick the 'Simple Root and ClockworkMod Uninstaller' option. This will restore your recovery manager back to the stock one, while leaving your Tab rooted.
NOTE: This same logic can be applied to the 'run.bat' file. The sections that need to be commented out are the same. Instead of using a # to comment the lines, place the word 'REM ' in front of them.
The run.bat 'remove' function will look as follows when done:
Code:
:remove
cls
echo +++++++++++++++++++++++++++++++++++++++++++++++++++++
echo Simple Root and ClockworkMod Uninstaller 2.01
echo +++++++++++++++++++++++++++++++++++++++++++++++++++++
echo Batch Scripts by DRockstar and Firon
echo exploit by joeykrim, original uninstaller by noobnl
echo.
echo REMOVES ALL ROOTS AND CLOCKWORKMOD REDIRECTOR
echo MODIFIED FOR USE WITH GALAXY TAB
call :chooser
if "%a%"=="m" goto :menu
call :startserver
call :checkroot
echo Mount device RW
adb shell mount -t rfs -o remount,rw /dev/block/stl9 /system
rem echo Running root file cleaner on device
rem adb push rclean /system/xbin/rclean
rem adb shell chmod 755 /system/xbin/rclean
rem adb shell /system/xbin/rclean
rem adb shell rm /system/xbin/rclean
rem rem echo Removing remount binary
rem adb shell rm /system/bin/remount > nul
rem adb shell rm /system/xbin/remount > nul
echo Removing ClockworkMod redirector
adb shell rm /system/bin/recoveryfiles/*
adb shell rmdir /system/bin/recoveryfiles
adb shell rm /system/bin/recoveryres/images/*
adb shell rmdir /system/bin/recoveryres/images
adb shell rm /system/bin/recoveryres/*
adb shell rmdir /system/bin/recoveryres
adb shell rm /system/bin/recovery
echo Restoring original recovery file
adb push recovery /system/bin/recovery
adb shell chmod 755 /system/bin/recovery
echo Rebooting phone
adb reboot
call :checkboot
echo.
echo SIMPLE ROOT UNINSTALLER COMPLETED.
goto :end
If you have any questions, please let me know. It's better to ask now than screw up your tab.
Hope this helps!
LK
linuxkidd said:
Hello zephyrd,
The problem I had was because I used the CWM process outlined in this thread. The 'run.sh' script is the one included with the downloads in that thread.
I edited the run.sh file as follows:
* FInd the section that starts with 'function remove {'
* Inside that section, find the following two sub-sections:
- echo Running root file cleaner on device
- echo Removing remount binary
* Comment out the lines under those sections with # so that the final 'function remove {' section looks like this:
When you run the 'run.sh' command, pick the 'Simple Root and ClockworkMod Uninstaller' option. This will restore your recovery manager back to the stock one, while leaving your Tab rooted.
NOTE: This same logic can be applied to the 'run.bat' file. The sections that need to be commented out are the same. Instead of using a # to comment the lines, place the word 'REM ' in front of them.
The run.bat 'remove' function will look as follows when done:
If you have any questions, please let me know. It's better to ask now than screw up your tab.
Hope this helps!
LK
Click to expand...
Click to collapse
Thanks so much for the help! However, this doesn't solve my problem, which is outlined in this thread.
I think my factory setting is modified somehow and can not be removed.
I don't expect any solutions any time soon but if you think you can help I can provide more info on the problem.
Thanks again!
Copy of stock recovery
Think you could post of a copy of the stock recovery file?
wolfson292 said:
Think you could post of a copy of the stock recovery file?
Click to expand...
Click to collapse
yea i could really use that right now too
Recovery process
Can you give me a guide to follow to
A. Return to stock: titanium back up on sd card. Unfortunately no way to get titanium bac on tab as market has disapeared. Unless I can down load .apk and then install from card.
B. Replace voodoo kernal with different one that restores screen rotation, market etc.
Will make generous donation to coffee/beer funds.
Any help for a noob in trouble?
[email protected] for mail, gtalk and pm's
can any one tell me how to make a copy of the original recovery image or send me a link to where i could find that information i searched the net but couldnt find an answer
plz help or email me at [email protected]
Hey Guys i'm trying to do the network unlock on my captivate, its rooted but when i do the command cat /sdcard/nv_data.bin >> /efs/nv_data.bin it comes back with not enough space.
so than i df efs and i get:
EFS: 6064k total, 6064k used, 0k available (block size 1024)
so than i ls efs and i get:
nv_data.bin
nv.log
imei
so since i am replacing the nv data anyways i figured i could remove the nv_data in hopes of clearing space so I do rm nv_data.bin and it comes back with:
rm failed for nv_data.bin, Read-only file system
can somone help? would my method of thinking even work?
thanks
edit would it work if i did
# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
# rm /efs/nv_data.bin
edit 2:
so i found out that when i removed it through adb it worked, but maybe the edited nv_data file is bigger than the original?
this is what i did to check
- adb shell
- su
- rm /efs/nv_data.bin (no error)
- ls /efs (did not see nv_data.bin in there)
- cat /sdcard/nv_data.bin >> /efs/nv_data.bin (gave me the no space error)
what can i do now?
Talk about timing - your second edit made my post pointless.
Just to satisfy my curiousity, why are you using the cat command? Wouldn't it make sense to cp /sdcard/nv_data.bin /efs/nv_data.bin, as there isn't an nv_data.bin file in /efs to use the cat command on? (My CLI commands are a little rusty, I'll admit...)
If you're using a rom with CWM, try rebooting to CWM and accessing the phone from there first. In my experience, adb access from CWM gives you the read/write permissions you'll need.
Also, if you're trying to replace the nv_data.bin file, I think the commands in adb be:
adb root
adb pull /efs/nv_data.bin (backing up current)
adb shell
rm -i /efs/nv_data.bin
cp /mnt/sdcard/nv_data.bin (or /sdcard/nv_data.bin)
(ls /efs to confirm)
Or something like that?
thanks for the advice, but I ended up just doing a factory reset and redid the whole process and it worked.
Hey all
I have the same error message. when i ls efs i had few more files in there than the OP they are
nv_data.bin
imei
nv.log
cryptprop_onetimeboot
cryptprop_securewipedata
nv_data.bin.md5
this to try putting the original nv_data.bin file back. Id like to put the a modified one which im hoping will let me unlock my captivate.
thanks
Use:
The main purpose is to make a file that contains all data in android specific partition. This is really handy in case of dumping leak firmwares.
Pr-requirement:
- Rooted device.
- Knowledge of how to use adb or Terminal Emulator.
The first step of making dump files out of device partitions is to locate its mounting points..!!
So in our tutorial, we will make it in 2 sections. Section 1 for how to get mounting points, and section 2 for how to get partition dumped..
Keep in mind that this is xda-university; so my target is to show beginners how to do that manually, without the aid of any tool, so they can get the concept behind it.. OK let's begin..!!
Section 1:
Getting mounting pointsThere are several methods to achieve this, but we will discuss the easiest methods that give efficient information about the partition that you want to know its mounting point.
All these methods will be described using adb shell.
Way #1
Code:
adb shell
cat /proc/partitions
This one needs from you to figure out which block belong to which partition name.!!
{
"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"
}
Way #2
Code:
adb shell
ls -al /dev/block/platform/[B][COLOR="Blue"]dw_mmc[/COLOR][/B]/by-name
This one will give you info about the dev block names WITH their familiar names (i.e, boot, recovery, system... etc)
This command is not universal between devices, and you will need to gather its pieces (/dev/block/platform/dw_mmc/by-name).
How?
- In your device, use any explorer that can get you to the device root (personally I use ES Explorer, by pressing on "/" on navigation bar).
- Go to "/dev/block/platform/" folder
- Here you will see some files and folders, we need to open folders and search for the folder called "by-name" inside one of them; in my situation it was "dw_mmc" folder which has the folder "by-name" inside it.
- At the end, my targeted piece info will be (/dev/block/platform/dw_mmc/by-name)
- Now open adb shell and put that command..
Way #3
By pushing parted binary to /system/bin folder and run it (you can find it in attachment).
Code:
adb remount
adb shell "su" "" "mount -o remount,rw /system"
adb push parted /system/bin/parted
adb shell
chmod 0755 /system/bin/parted
parted /dev/block/[B][COLOR="Blue"]mmcblk0[/COLOR][/B]
print
Here, your mounting points will start with /dev/block/mmcblk0p* where (*) is the number shown in the table above for each partition.
example:
The hidden partition mounting point will be mmcblk0p10
The radio partition mounting point will be mmcblk0p7
The system partition mounting point will be mmcblk0p9
The recovery partition mounting point will be mmcblk0p6
and so on
Don't forget to "quit" the parted action after grasping your device mounting points.
N.B:
- You may need to run first:
Code:
adb shell
cat /proc/partitions
to know what is the initial name for your device partition.. In the example above, it was mmcblk0.
- Also to be able to do adb push to /system partition for parted binary, you will need insecure boot.img used in your ROM or adbd insecure installed in your device (Check this thread for that app), or just push parted binary manually by any root explorer and then fix permissions to rwxr-xr-x (755).
***
Section 2:
Dumping ROM partitionAfter locating the mounting point of the partition you want to dump, open adb shell command prompt and type:
Code:
adb shell
su
dd if=[B][COLOR="Blue"]/yourMountingPoint[/COLOR][/B] of=[B][COLOR="Green"]/yourDestination[/COLOR][COLOR="Red"]/partitionType[/COLOR][/B]
Let's say I want to take a dump out of system partition from above example. So the adb commands will be:
Code:
adb shell
su
dd if=[B][COLOR="Blue"]/dev/block/mmcblk0p9[/COLOR][/B] of=[B][COLOR="Green"]/sdcard[/COLOR][COLOR="Red"]/system.img[/COLOR][/B]
This may take a while to complete the dumping process, depending on the size of your dumped partition; so be patient..
Note:
If the partition is formatted as ext3/4 then the dumped partition will have .img as an extension.
Other partition dumps have different extensions; examples:
radio.bin
param.lfs
Sbl.bin
zImage (without extension)
***
Optional:
Read Partition ImageAfter dumping an image from android partition, you can mount it to extract a particular file for sharing, or the whole dump content in case the ROM chief wants to make a ROM out of dump files..
For Linux Users:
- Open terminal and type:
Code:
su -
mkdir -p /mnt/disk
mount -o loop [B][COLOR="Red"]yourImage.img[/COLOR][/B] /mnt/disk
cd /mnt/disk
ls -l
For Windows Users:
- Download LinuxReader from this site here.
- Open it -> Drives -> Mount Image -> Then choose your dumped image and hit Mount. A new driver will appear that contains all files inside the dumped image called "Linux native Volume 1". Just double click it to get inside the dumped image.
I hope you will find this tutorial beneficial,,,
Yours;
Actions Explanation
★ Tutorial Legends ★
In this post, I will try to explain the use of each binary used in the tutorial, so you can make sense of each action taken.
#1
Code:
adb shell
Run remote shell interactively, as if you are in linux terminal.
Click to expand...
Click to collapse
#2
Code:
cat /proc/partitions
cat binary is used to concatenate file(s) and print them to standard output display. In our example, it prints the content of partitions file which is found in proc folder to screen display.
Click to expand...
Click to collapse
#3
Code:
ls -al /dev/block/platform/dw_mmc/by-name
ls binary is used to list directory contents.
-al is the used option for ls which means to include entries that started with "." in long listing format. There are a lot of options for ls binary. You can always print ls --h to display help menu for other options available.
Click to expand...
Click to collapse
#4
Code:
adb remount
Remounts the /system partition on the device read / write. This has been disabled in some devices (those with secure boot image); so you need to make sure that you have patched adbd that can run this command effectively.
Click to expand...
Click to collapse
#5
Code:
su
Used to get super-user privilege.
Click to expand...
Click to collapse
#6
Code:
mount -o remount,[B][COLOR="Red"]rw[/COLOR][/B] /system
Specific command to mount the /system partition on the device read / write (rw).
If you change rw to ro, you will get /system partition mounted as read only.
Click to expand...
Click to collapse
#7
Code:
adb push parted /system/bin/parted
adb push is used to copy file/dir from your local computer to android device. The usual format is adb push <local> <remote>
Click to expand...
Click to collapse
#8
Code:
chmod 0755 /system/bin/parted
chmod binary is used to set permissions for the specified file/dir.
The number after chmod is the permission used. See the next box for better understanding of chmod formatting:
Code:
[CENTER][B][COLOR="Red"]----------------
| CHMOD SCHEME |
----------------[/COLOR][/B][/CENTER]
[B] r w x[/B]
[B]4 2 1 [COLOR="Green"]= 7 (Full Permissions)[/COLOR][/B]
User ( ) ( ) ( ) [B][COLOR="Green"]--> 2nd digit[/COLOR][/B]
Group ( ) ( ) ( ) [B][COLOR="Green"]--> 3rd digit[/COLOR][/B]
Other ( ) ( ) ( ) [B][COLOR="Green"]--> 4th digit[/COLOR][/B]
Special UID GID STK
( ) ( ) ( ) [B][COLOR="Green"]--> 1st digit, ignored on most cases or put 0[/COLOR][/B]
In the above example, it is set to 0755 which means the following scheme:
Code:
[B] r w x[/B]
[B]4 2 1[/B]
User ([B][COLOR="Red"]*[/COLOR][/B]) ([B][COLOR="Red"]*[/COLOR][/B]) ([B][COLOR="Red"]*[/COLOR][/B]) [B][COLOR="Green"]--> This equals to 7 (rwx)[/COLOR][/B]
Group ([B][COLOR="Red"]*[/COLOR][/B]) ( ) ([B][COLOR="Red"]*[/COLOR][/B]) [B][COLOR="Green"]--> This equals to 5 (r-x)[/COLOR][/B]
Other ([B][COLOR="Red"]*[/COLOR][/B]) ( ) ([B][COLOR="Red"]*[/COLOR][/B]) [B][COLOR="Green"]--> This equals to 5 (r-x)[/COLOR][/B]
Special UID GID STK
( ) ( ) ( ) [B][COLOR="Green"]--> This equals to 0 (---)[/COLOR][/B]
As you can see, if you said 0755, it will be as same as saying ---rwxr-xr-x
Click to expand...
Click to collapse
#9
Code:
dd if=/dev/block/mmcblk0p9 of=/sdcard/system.img
dd binary is used to copy a file with converting and formatting.
if means input file; here we pointed to the whole partition, not specific file.
of means outputting file to specific destination path; here it is to sdcard with system.img name.
Click to expand...
Click to collapse
#10
Code:
mkdir -p /mnt/disk
mkdir binary is used to make folder dir.
-p is mkdir option which means to create folder with sub-folder at the same time. Here we want to create mnt folder that contains disk sub-folder in it. If the folder and or sub-folder(s) are already exists, it will not give error but nothing will be created.
Click to expand...
Click to collapse
#11
Code:
mount -o loop yourImage.img /mnt/disk
This is linux way to mount images into specific directory (/mnt/disk in this example).
Click to expand...
Click to collapse
#12
Code:
cd /mnt/disk
cd used to get inside specific dir path.
Click to expand...
Click to collapse
#13
Code:
ls -l
ls binary is used to list directory contents as described above.
-l is the used option for ls which means to list contents in long listing format.
Click to expand...
Click to collapse
Cheers
another way to get common names
on way #2, I've often used:
Code:
cat /proc/emmc
on a few devices to reveal similar info.
Rob
can i able to mount boot.img in android itself...actually i wanted to extract boot.img frm mobile without any tools or without the help of PC...if there be any possibilities..??
hasan4791 said:
can i able to mount boot.img in android itself...actually i wanted to extract boot.img frm mobile without any tools or without the help of PC...if there be any possibilities..??
Click to expand...
Click to collapse
if you mean extract to modify boot.img, then I don't think there is away to do that from device itself in the moment..
if you mean dumping boot.img then yes you can, just install terminal emulator from Google play and you can run adb shell commands directly from the device
Great guide hopefully makes it easier for us to get dumps! if you add logcats etc, i find they have trouble executing "adb logcat >> log.txt" -.-
also you should teach them the easy tar method, so while booted "tar -c /system/* >> /sdcard/system.tar" or via adb shell
ricky310711 said:
Great guide hopefully makes it easier for us to get dumps! if you add logcats etc, i find they have trouble executing "adb logcat >> log.txt" -.-
also you should teach them the easy tar method, so while booted "tar -c /system/* >> /sdcard/system.tar" or via adb shell
Click to expand...
Click to collapse
Yup that is possible and easy to extract but it is only for partitions that is shown in android os,,, you can't use it for boot.img, sbl.bin, modem.bin...etc right
majdinj said:
Yup that is possible and easy to extract but it is only for partitions that is shown in android os,,, you can't use it for boot.img, sbl.bin, modem.bin...etc right
Click to expand...
Click to collapse
ofcoarse, i actually had a project going where it detects all partitions(modems, boot.img, system etc..) that archives itself into a .zip
it was going well until i did something in the script, now it only works on the s3 it shall be continued one day!
Such great tutorial, this is definitely going to come in handy for me. I have a question, how can you dump (extract) a bootloader? Can i use the same method as dumping the ROM?
Could you explain how to extract stock recovery image please?
Sent from my HTC One using xda app-developers app
Where did the parted binary come from?
For Gods Sake
http://forum.xda-developers.com/sho...IDE] Unpack/repack ext4 Android system images
http://forum.xda-developers.com/sho... Creator (deployable over all kernel sources)
http://forum.xda-developers.com/sho...ipt]Backup all paritions on i9505 to odin rom
http://forum.xda-developers.com/sho...al 4.3 TW Custom Rom/ The ORIGINAL WIFI TRICK
... use Forum Search Engine first, then start asking all your 'important' questions
¤ GT-I9505 - powered by KitKat ¤
insink71 said:
on way #2, I've often used:
Code:
cat /proc/emmc
on a few devices to reveal similar info.
Rob
Click to expand...
Click to collapse
Thx for this. On my HTC One there is no "by-name" folder. It only has "by-num". cat /proc/emmc works fine though.
Cheers.
I also wrote a guide, It just using the "by-name"
and needs root
[HOWTO] dump your rom
Code:
dd if=/dev/block/platform/msm_sdcc.1/by-name/system of=/storage/extSdCard/system.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/recovery of=/storage/extSdCard/recovery.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/param of=/storage/extSdCard/param.img
dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/storage/extSdCard/boot.img
Hi,
I tried this on my I-9505G. It is NOT rooted, so I thought I could enter the system through Clockworkmod Recovery.
I did it, but at first I didn't mount the DATA partition (later on I did through CWM Recovery); I still ran the command:
dd if=/dev/block/platform/msm_sdcc.1/by-name/system of=/data/media/TEST/system.img
Thought I hadn't mounted anything, the media folder was still there, I only created the TEST folder.
After the image was created I typed the "ls" command and the system.img file was in /data/media/TEST/.
I then rebooted once again in CWM and ran the "adb shell" command once again, I entered /data/media/ e neither the img file nor the TEST folder I had created were there.
My question is: where have they gone?? Are they still occupying some of my space or they just got deleted automatically when I rebooted??
Please let me know as I'd like to free that extra unuseful 1.2 Gb system.img file.
Anyway, just as side information, I later on mounted the /data through CWM interface and was able to see the folders ("/data/media/0/") I can see by plugging the phone normally to the computer. I then dumped the image.
I have some other questions:
I can I mount the /data folder (or the external SD) via command?
What extention should I give to the other partitions? (All of them)
Why did you say that it's MANDATORY that the phone be rooted if it can be done this way?
Are the images I'm dumping flashable through fastboot?
Thank you all for your time!
Anybody? Please.
•I can I mount the /data folder (or the external SD) via command?
I have not been able to find the SD card in clockwork on the I9505G, hence one of my rooting procedures send the root file vi "adb sideload".
I might be able to pull the data from the phone but the clockwork recovery is still not working 100% when fastbooting it.
•What extention should I give to the other partitions? (All of them)
.img are fine.
•Why did you say that it's MANDATORY that the phone be rooted if it can be done this way?
currently it is required that the phone be unlocked. Something need to be fixed in clockwork to make it work any other way.
•Are the images I'm dumping flashable through fastboot?
They should be, but I have not been able to flash anything on the I9505G vi fastboot because of the secure boot.
without a full official image this make my playing around a little concerning (slowing me down).
I will look into this at my leisure. I would love to be able to pull a rom off a phone with only unlocking it.
I will test some stuff using my old galaxy nexus.
I actually dumped everything WITHOUT being rooted. I only unlocked the bootloader... So it works.
Further, I tried to run "fastboot boot recovery.img" with recovery.img being the image file I dumped. The phone froze and I had to pull the battery... So I assume they're not flashable as well, though I'd like other feedbacks.
I've not clearly understood what "secure boot" means. Any guide or wiki?
Thanks!
---------- Post added at 06:56 PM ---------- Previous post was at 06:55 PM ----------
I actually dumped everything WITHOUT being rooted. I only unlocked the bootloader... So it works.
Further, I tried to run "fastboot boot recovery.img" with recovery.img being the image file I dumped. The phone froze and I had to pull the battery... So I assume they're not flashable as well, though I'd like other feedbacks.
I've not clearly understood what "secure boot" means. Any guide or wiki?
Thanks!
Hey, great guide! I need some help but. I can't retrieve the common names / labels of my devices partitions. It's a GT-i8150 and there is no 'by-name' sub directory. Furthermore, parted does not work on mmcblk0 for some reason (unable to satisfy partition restraints or something). I also have no emmc file in proc.
Does anyone know how some other methods for getting the names of the partitions?
EDIT:
Another question - using ADB shell, is it possible to dump a partition straight from the phone onto the computers hard drive? My little 2GB sd card isn't coping! Thanks
a very basic but good guide
Sent from my GT-P1000 using xda app-developers app
How to backup - let's say boot - partition to a fastboot flashable file (*.img) format?
For example:
Code:
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/sdcard/boot.img
and so on.
Kostyan_nsk said:
For example:
Code:
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/sdcard/boot.img
and so on.
Click to expand...
Click to collapse
Thanks. So fastboot is using dd images. Please do confirm.
Regards.
You can use only boot and recovery images extracted by dd for flashing via fastboot.
Kostyan_nsk said:
You can use only boot and recovery images extracted by dd for flashing via fastboot.
Click to expand...
Click to collapse
Thanks
Kostyan_nsk said:
For example:
Code:
dd if=/dev/block/platform/hi_mci.0/by-name/boot of=/sdcard/boot.img
and so on.
Click to expand...
Click to collapse
I have done the backup to the image file as you have suggested.
I have copied image file to the linux computer, but when I try to mount the image file I get:
mount -o loop boot_orig_B830.img /mnt/boot/
mount: /dev/loop0 is write-protected, mounting read-only
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
What is the file system for this image?
Length of the image file is:
ls -l boot_orig_B830.img
-rw-rw-r-- 1 test test 16777216 Lis 13 22:04 boot_orig_B830.img
For Linux: google "unpackbootimg", "gunzip" and "cpio".
For Windows: google "AndImgTool".
I put the boot.img to the MagiskManager folder but this does not work. What do I need to do? I read something about gzipping but I'd be grateful for instructions
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data
You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
ckpv5 said:
AFAIK you don't have to put stock boot.img anywhere as Magisk should have a backup of the stock boot at \root\data
You just need to select uninstall - restore images in Magisk Manager to restore stock boot.img
Click to expand...
Click to collapse
Oh I forgot to say I used your images and fastboot but fastboot doesn't work currently for me so i tried to use the normal method.
Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.
No idea how to fix your fastboot issue.
Benjamin_L said:
Edit: Now i tried complete removal and now I am stuck on recovery screen with "no command". Fastboot is always reporting requested size more than allowed...
Click to expand...
Click to collapse
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
ckpv5 said:
Don't you have the magisk backup stock boot at that location ?
Just check my current 9.6.13.0 (as example), both stock boot.img & magisk backup are same.
No idea how to fix your fastboot issue.
Shouldn't try that before restore images is done.
Sorry.. no idea how to fix it without fastboot.
Click to expand...
Click to collapse
Fixed it with another laptop. Thank you for the time
How did you fix it ?
usernome said:
How did you fix it ?
Click to expand...
Click to collapse
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
JDKerados said:
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
Click to expand...
Click to collapse
I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.
Other than that it worked like a charm, thanks!
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
JDKerados said:
FIX IT:
1 - Create a gzip archive named: stock_image_0.img.gz
2 - Put the file in your "/data" folder.
3 - GoTo "/root/sbin/.magisk" folder (is an hidden folder so you need to enable hidden files)
3 - Open file "config" and edit SHA1 string to "0". Usually that string is a SHA1 of the img file but i used "_0" so my SHA1 must be equal to "0".
4 - Now you are able to restore your stock boot image and you can do all other stuff to install your OTA Updates.
Click to expand...
Click to collapse
lap0 said:
I needed to change that to /data/stock_boot_${SHA1}.img.gz ("boot" instead of "image") as found in Magisk sources.
Other than that it worked like a charm, thanks!
Click to expand...
Click to collapse
rophiroth said:
Is this info updated? im on android 12 magisk 24.7 and couldnt find those file and folders root and hidden acivated
Click to expand...
Click to collapse
I'm in the same boat - I read that Magisk was supposed to autocreate a backup, if it did; it doesn't know where it went and I've tried a number of places (boot.img and gz zipped) and still nothing.
Android 12, Magisk 25.1
Thanks for any help!
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
This wanted me today on the Nothing Phone 1. Thanks so much!
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.
how to get past this?
v.konvict said:
1.Create a gzip archive named: stock_image_0.img.gz
Guys how are you making this gzip.what application are you using or is just renaming the boot.img file to that.
Click to expand...
Click to collapse
That set of instructions didn't work for me - the one below that did (I'll quote it here):
b_fizzle said:
I found this website:
fix-magisk-stock-backup-does-not-exist.md
GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
I will post the edits I had to make below, but for the original, see the website.
** Load up Command Prompt on Windows**
# put stock boot.img into /sdcard/boot.img
# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)
# repack boot.img.gz
gzip -9f /sdcard/boot.img
# restore backup
mkdir /data/magisk_backup_${SHA1}
mv /sdcard/boot.img.gz /data/magisk_backup_${SHA1}/boot.img.gz
chmod -R 755 /data/magisk_backup_${SHA1}
chown -R root.root /data/magisk_backup_${SHA1}
I was able to follow the guide to update from there, though to be fair, it's still "optimizing". Crossing my fingers.
Click to expand...
Click to collapse
JustinChase said:
Magisk is refusing to allow superuser rights when I type su. I believe I have allowed apps and adb in magisk, but it's denying the su request.
how to get past this?
Click to expand...
Click to collapse
Honestly, I'm not sure. It sounds like ADB Debugging may not be enabled on the phone's Developer Settings(?)
b_fizzle said:
That set of instructions didn't work for me - the one below that did (I'll quote it here):
Click to expand...
Click to collapse
I fixed the problem with just making sure i root my phone by letting magisk patch the boot image as it backs up the stock one while making the patched one.
I dug a bit deeper and discovered that shell was disallowed from within Magisk for some reason. I have no recolleciton of it asking me, but once i enabled it in magisk, I was able to su in a prompt and get my problem solved.