How to Make Nandroid Backup Directly to Your Computer Without Using SD Card

0 Flares Twitter 0 Facebook 0 Google+ 0 Reddit 0 StumbleUpon 0 Pin It Share 0 LinkedIn 0 Email -- Buffer 0 Filament.io 0 Flares ×

In this guide we have explain how to make full backup of your android phone without using the SD card directly to your computer.

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 the specified the commands meant to be used from windows, for Linux and Unix is similar.

Requirements:

  • You need to have rooted android phone, then Busybox must be installed on your phone.
  • If you are using Linux/OS X you have native tools, for Windows download Cygwin, and install with with it netcat, pv and util-linux. Get them from Cygwin’s setup.exe.
  • ADB installed.
  • Make sure adb.exe is in your window’s path.
  • Check whether USB Debugging option is enabled in your phone and the proper drivers are installed on Windows so the phone is recognized. Typing the ‘adb devices’ on a terminal should show your device.

WARNING: We and even the developer won’t be held responsible for any damage that takes place to your device while following these steps. So, follow all the given below procedure at your own risk.

Partition Identification:

  • First you need 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.
  • 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.

How to Back up the whole memory block (via adb):

  • For that first you need to connect the phone in ADB mode and unlock the screen.
  • Next, Open one Cygwin Terminal and enter (replace mmcblk0 if needed)

Code:

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

  •   Now, you will see the cursor blinking at the left which means that the phone is waiting to send the block over the network.
  • Now, again open the another Cygwin terminal and type:

Code:

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 sourceforge website 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.
  • You can use adb via wifi as well with applications like WiFi ADB.

How to back up the whole memory block (via wifi):

  • We need to install a FTP server on the computer or the other device, configure a user with a password if we want to, and set some port. It uses by default 21 but this example uses 40. We must set a home dir for the user with write permissions.
  • Usually is a good idea to put myfifo in /cache not in /data because we may overwrite sensitive data in case we want to use that raw image for data recovery.
  • Open one Cygwin terminal:

Code:

                 adb shell
su
mkfifo /cache/myfifo
ftpput -v -u user -p pass -P 40 COMPUTER_IP block.raw /cache/myfifo

  • Open another Cygwin terminal:

Code:

              adb shell
su
dd if=/dev/block/mmcblk0p12 of=/cache/myfifo

NOTE : Fifos only can be made on linux native file systems, for example on a FAT partition is not possible.

  • Reading from a partition does not modify it. Now, check on Filezilla server the speed.

How to Backup the Whole Memory Block (USB tethering, Wifi tethering):

  • To use the tethering you have to disconnect the computer from all networks and connect it only to the phone with the type of connection you want.
  • Once you connect it, you can view the IP of the computer and the IP of the phone from connection properties. The ip is the computer ip and the gateway is the phone’s ip.
  • Wifi Tethering: Computer Phone Internet
  • USB Tethering:
  1. Computer Phone Internet
  2. Computer Phone Internet
  • This is exactly the same as via wifi, except that the transfer speed is much higher because the computer and the phone are directly connected, instead of using a router as a gateway. In this case, the gateway is the phone. USB tethering has the highest transfer rate.

How to do Back up of a single Partition (raw = every bit of the partition):

  • It is exactly the same as the the previous but replacing mmcblk0 by the corresponding partition. You can use in this particular case several software to read the partition from windows, depending on partition filesystem:

DiskInternals Linux Reader,
Ext2Read,
Ext2 File System Driver for Windows,
Ext4Explore,
Plugin for Total Commander
ImDisk Virtual Disk Driver.

  • You can also use recovery software on individual partitions like Recuva in combination with VHD Toolor command line tools included with operating systems.

How to Back up of a single partition (tar = only files and folders):

  • In this case, you need the partition mounted. To see the list of mounted partitions type on Cygwin Terminal

Code:

          adb shell mount

  • Now you need to know where is mounted the partition you want to backup, for example the firmware is mounted on /system, which is the ROM.
  • In this case you will have to open three terminals, because of android limitations:
  • Open one Cygwin terminal and create a fifo, in /cache, for example, and redirect the tar thereCode:adb forward tcp:5555 tcp:5555
    adb shell
    su
    /system/xbin/busybox mkfifo /cache/myfifo
    /system/xbin/busybox tar -cvf /cache/myfifo /system
  • We have to do it this way because redirecting the tar to stdout (with – ) is broken on android and will corrupt the tar file.
  • Open a second Cygwin terminal and type:Code:

adb forward tcp:5555 tcp:5555
adb shell
su
/system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox cat /cache/myfifo

  • Open a third Cygwin terminal and type:

Code:

adb forward tcp:5555 tcp:5555

cd /path/to/store/the/backup

nc 127.0.0.1 5555 | pv -i 0.5 > system.tar

  • You can browse the tar file with Winrar, Total Commander, PeaZip and almost any compression tool. Note that you shouldn’t extract files or edit it since the tar format saves the permission and owner data for each file, that is lost when extracted to FAT / NTFS partitions and you will mess things when restoring.
About Sarvesh Darak

Sarvesh Darak is a blogger, an online marketer, a social media specialist and an Android Lover. At Best Android Blog, he writes Android news & tutorials for Android Rooting. He is the tech head and ensures that the blog keeps running at good pace. He also looks after all the SEO and promotion work. He’s from Surat, India and keep contributing regularly at the blog.

Speak Your Mind

*

0 Flares Twitter 0 Facebook 0 Google+ 0 Reddit 0 StumbleUpon 0 Pin It Share 0 LinkedIn 0 Email -- Buffer 0 Filament.io 0 Flares ×