Tuesday, May 21, 2019

How to do a full nandroid backup via pc



How to do a full nandroid backup via pc using adb or anything or any software specialised for it.




Answer



The easiest way is to make the via a third party recovery (E.g. CWM, TWRP, PhilZ etc.) and copy that onto your PC of course. If this option isn't possible:


From XDA Developers on Nandroid to PC


This guide is intended to make a full backup of your android phone (the entire memory block with all partitions) or a single partition (including sdcards, etc) directly to your computer, in either




  • Block level (with dd): for single partitions or whole memory block (all partitions in one piece). The backup always has the same size which is the size of the partition.


    File level (with tar): only for individual partitions. This only includes files and folders, so occupies much less space, depending on how much filled is the partition. It can be done with the phone powered on or from ClockWorkMod Recovery (from both ADB works, while in Fastboot doesn't so won't apply). Unless specified the commands meant to be used from Windows. For Linux and Unix is similar.





REQUIREMENTS



  • Rooted Android Phone Busybox installed on your phone. If you are using Linux / OS X you have native tools, for Windows download Cygwin, and install with it netcat, pv and util-linux. Cygwin's setup.exe

  • ADB installed. Make sure adb.exe is in your windows' path. See here and here, or use Path Manager.

  • Android phone with USB Debugging enabled, and the proper drivers installed on Windows so the phone is recognized. Typing 'adb devices' on a terminal should show your device.


PARTITION IDENTIFICATION


You now have to identify the partition or block device that you want to backup. For a single partition you can use either tar or dd, while for the entire memory block you can only use dd.


For example, on Galaxy Nexus you have the list of partitions here .


Usually on android, the entire block containing all partitions is located at /dev/block/mmcblk0 and the data partitions is a subpartition of it. You can push parted with GPT support to your device and see all information on a partition or block.



Whole phone memory -> /dev/block/mmcblk0 (may vary, in some phones this is the sdcard) Subpartitions -> depends on each device. Usually at /dev/block/platform/dw_mmc/by-name/ there are listed by name linking to the real device.


Back up of the whole memory block (via adb) Connect the phone in ADB mode and unlock the screen. Open one Cygwin Terminal and enter (replace mmcblk0 if needed):


adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0

You will see the cursor blinking at the left. Now the phone is waiting to send the block over the network.


Open another Cygwin terminal and type:


adb forward tcp:5555 tcp:5555

cd /path/to/store/the/backup
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw

You will see how the image size is growing until it finishes. Now you have the whole phone backed up in raw format. You can see the contents of the GPT partition with gptfdisk tool, available for windows, linux and such. See official website and sourceforge to get it. You can do it the same from ClockWorkMod Recovery but you have to mount first the /system partition since the busybox included with clockworkmod does not come with netcat and you have to use the one from the system partition. With further linux tools you could edit or extract single partitions from the whole block.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...