• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Mods Take a backup of recovery from phone? [Root only]

knoober

Android Enthusiast
I've got a working recovery installed on my device (cwm) and I was going to try an alternate version for various reasons. I no longer have the original file for the current version. Is there a way to pull the recovery img. straight from my device and save it one my hdd?
 
You should be able to use the dd utility (or busybox dd command) to copy the recovery partition to your SD card and then transfer that file to your PC.

Be very careful using dd since that utility is not very forgiving--i.e., if you get the of= target wrong, you could do some serious damage :eek:.

Cheers!

P.S. / edit: I think I'll move your thread over to our Hacks & Mods area if you don't mind :).
 
I've got a working recovery installed on my device (cwm) and I was going to try an alternate version for various reasons. I no longer have the original file for the current version. Is there a way to pull the recovery img. straight from my device and save it one my hdd?

Did dd'ing it work for ya, of course ya gotta know what partition your recovery is on- can get that from your recovery log, probably in /cache/recovery.

If log says something like this-
0 /tmp ramdisk (null) (null)
1 /recovery emmc /dev/block/mmcblk0p22 (null)
2 /boot emmc /dev/block/mmcblk0p21 (null)

You see recovery is on mmcmblk0p22
So dd that, in terminal emulator-
su ( press enter)
dd if=/dev/block/mmcblk0p22 of=/data/local/recovery.img (enter)

I like to dd to /data somewhere, n then copy to where it's wanted.

I was recommended to an app called Rashr, it works well on my device for saving recovery
Good day brother
 
^^^ :thumbup:, phan9998 :).

Yep, dd is one way to do it, but you need to know exactly where/what your recovery partition is called and phan9998 demonstrated one way to find this.

(you wouldn't want to save from or flash to the wrong partition (i.e., overwriting your boot image is one good way to have a bad day :p)

Nowadays, many devices have "by-name" directories in he /dev partition that will point-out what the recovery (and many other) partitions are:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\Scary Alien>adb shell
shell@hammerhead:/ $ su
root@hammerhead:/ # find /dev -name 'by-name' 2> /dev/null

There was a fastboot command on my HTC Droid Eris that would allow dumping of various partitions to the SD card, but that might not be true for all devices.

Cheers!
 
Thanks guys Google has been quite frustrating get lately and was particularly unenlightened on this one. A lotof times the results are over my head as well ( until iI get it figured out and do it of course) i thought it was going to have to be a "pull" command, but had no idea what to pull

Now this dd utility. It seems to be the Linux equivalent of disk part? Make partitions/set filesystems/permissions and so on and so forth? And just to make sure, proper syntax is "dd if=source of=target"? Also it seems that this could be used for a single file? Or is that where pull comes in?

One more quick question... What is the way to dump the entire phone? Would that simply be " dd if=/" or something?
 
knoober said:
Now this dd utility. It seems to be the Linux equivalent of disk part? Make partitions/set filesystems/permissions and so on and so forth?

See this page (dd (Unix)) for elaboration on the dd utility (as a starting point). Can be used for/with partitions and single files--again, be very careful since it does exactly what you ask it to do--without confirmation ;).

knoober said:
And just to make sure, proper syntax is "dd if=source of=target"?

Yes, and there are other switches/arguments that you can use, too.

knoober said:
Also it seems that this could be used for a single file? Or is that where pull comes in?

I'm guessing you're thinking of an adb pull <filename> command (i.e., to transfer a file from your Android device to your PC).

knoober said:
One more quick question... What is the way to dump the entire phone? Would that simply be " dd if=/" or something?

You'll have to dump each partition individually...if you want a whole-phone backup, then you would typically use a custom recovery and make/take a Nandroid backup.
 
Thank you for the reference page about the dd utility, I will be glad to have some of this cleared up. Linux /unix/Android are kind of alien (no pun intended on your name). I just wanted to make sure I had a proper grasp of its general purpose.

Now when you say that a custom recovery is generally the path to a full backup... I thought that only 3 or 4 partitions existed in a nandroid backup Data and System, maybe a cache partition? I was more curious as to making a complete backup of everything on the whole phone. Mostly so I can pick through stuff I dont understand without breaking anything. Even better is there an emulator to test roms on? Kind of like a Virtual Android? If there isn't there should be.
 
Thank you for the reference page about the dd utility, I will be glad to have some of this cleared up. Linux /unix/Android are kind of alien (no pun intended on your name).

:) ;) :D

No worries :thumbup: -- we all had to start somewhere :).

knoober said:
Now when you say that a custom recovery is generally the path to a full backup... I thought that only 3 or 4 partitions existed in a nandroid backup Data and System, maybe a cache partition?

Well, Nandroid backups typically only backup the partitions that might change between backups. The other partitions are presumed to be non-changing and/or flashable from another means and/or source (i.e., a stock / factory image, etc.).

There are, as you might suspect, often a lot of different partitions on an Android device--which vary by model & manufacturer (and some are often hidden or inaccessible except from low-level utilities like fastboot or other diagnostics).

knoober said:
Even better is there an emulator to test roms on? Kind of like a Virtual Android? If there isn't there should be.

Yeah, there's an emulator (AVD - Android virtual device) that comes with the Android SDK. I've never done it since the emulator's been dog slow for me just for testing my apps (I prefer to test my apps directly to a device).

Never flashed a ROM on an AVD, but other's have:


Cheers!
 
Back
Top Bottom