Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,332 Members 52,455 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL]Howto backup whole phone and restore back in case hardbricked

Tip us?
 
mdfzhi
Old
(Last edited by mdfzhi; 16th June 2014 at 03:23 PM.)
#1  
mdfzhi's Avatar
Senior Member - OP
Thanks Meter 3606
Posts: 3,990
Join Date: Jun 2011
Location: Behind you
Default [TUTORIAL]Howto backup whole phone and restore back in case hardbricked

Code:
Select Code
#include <std_disclaimer.h>
/*
 * Your warranty is now void.
 *
 * I am not responsible for bricked devices, dead SD cards,
 * thermonuclear war, or you getting fired because the alarm app failed. Please
 * do some research if you have any concerns about features included in this TUTORIAL
 * before doing anything! YOU are choosing to make these modifications, and if
 * you point the finger at me for messing up your device, I will laugh at you.
 */
Quote:
In this tutorial i'll guide howto create full phone backup and restoring back in case got hardbricked. Tested and confirmed working myself (yes i've hardbricked my phone two days ago and managed to restore back to fully working state). My phone is nokia x, so this is confirmed to be working for the nokia x. For x+ and xl should be working too because basically theres not many different between the three. The backup created using this tutorial is low level whole disk backup, different from cwm or twrp backup because those recoveries will only backup certain partitions only, can be useful to restore back from the recoveries itself but became useless if got hardbricked. This backup can be used to restore back from hardbrick state. Attempting to do this backup alone is also dangerous on its own, i've warned u
Also special thanks to nikozzzzzz and AngSanley for chatting with me, giving idea and helping me in two days my phone got bricked
PART 1 - TO BACKUP

THINGS THAT U NEED
Quote:
  1. Many spare times to read and follow this tutorial.
  2. Your phone with battery not below 50%.
  3. Busybox installed already.
  4. Custom recovery installed already. I recommend cwm 6.0.2.8.
  5. A reliable pc with adb installed.
  6. A reliable usb cable.
  7. Sdcard with more than 6GB free space. Later we will backup with custom recovery first and the backup could be 1GB, then came the whole disk backup that would be 4GB, and 1GB more for safe read/write io operation. So 1GB+4GB+1GB=6GB.
THE STEPS
Quote:
  1. Connect phone to pc via usb cable.
  2. Mount usb storage and copy whole data from INTERNAL SD safely somewhere in the pc.
  3. Boot into cwm recovery. At this time u should already have the requirement from above, the sdcard with at least 6GB free space inserted into the phone.
  4. Do the usual whole rom backup using cwm. Backup to EXTERNAL SD not INTERNAL SD because we will format internal sd in next step.
  5. Wipe internal sd, system, data, cache and dalvik cache from cwm.
  6. Still in cwm and your usb cable should be connected between phone and pc, open windows cmd and do
    Code:
    Select Code
    adb shell
  7. Still in cwm, and still connected between pc and phone using usb cable and still in windows cmd, do
    Code:
    Select Code
    dd if=/dev/block/mmcblk0 of=/sdcard/mmcblk0.img
    The backup process could take few minutes. The process is done when cmd showed something like
    Code:
    Select Code
    7634944+0 records in
    7634944+0 records out
    3909091328 bytes (3.9 GB) copied, 3367.93 s, 1.2 MB/s
    The backup result is mmcblk0.img single file in root of your sdcard, around 3.9GB in size. U can transfer it to your pc and compress it if u want, after compress the size should be smaller, around 1.3GB. Make as many copy of it as u can and store it safely, in dropbox, in your sisters pc, in your grandma pc etc.
  8. Now u can restore back your rom using previous cwm backup in step 4.
  9. Backup process done.
Restore process continued to PART 2 below.
The Following User Says Thank You to mdfzhi For This Useful Post: [ Click to Expand ]
 
mdfzhi
Old
(Last edited by mdfzhi; 17th June 2014 at 10:08 AM.)
#2  
mdfzhi's Avatar
Senior Member - OP
Thanks Meter 3606
Posts: 3,990
Join Date: Jun 2011
Location: Behind you
part 2 - to restore

things that u need
Quote:
  1. many spare times to read and follow this tutorial. The restore process can be long upto an hour.
  2. obviously a hardbrick phone. The phone can be turn on by pressing power button but just vibrate, no nokia logo, no recovery mode, no fastboot mode, just blackscreen. Probably the bootloader is gone missing or corrupted. The phone is not hardbricked per se, its still alive if it vibrate after pressing power button. If the phone doesn't show any sign of life, doesn't even vibrate when pressing power button then probably battery depleted. Try to charge the battery using external charger, or find the same phone and charge the battery in it. If still doesn't work even after battery charge then probably thats total lost, only nokia aka microsoft mobile can repair, or until we find another way ourselves.
  3. a reliable pc with a linux os installed. The pc need to have stable power source too because the restoring process could be long upto an hour or so. We dont want the pc to turn off or restart halfway of the process or risking totally messed up the phone disk. So what is linux? Where could u get it? Howto install it? Google for it yourself. I recommend linuxmint. The linux should also be installed, not in live mode because live mode usually unstable, again same as previous reason, we dont want unstable linux in live mode to make pc turn off or restart halfway of the restore process.
  4. a reliable usb cable.
  5. the backup file from previous part 1, the mmcblk0.img file. If u compress it earlier then decompress it.
the steps
Quote:
  1. remove from phone the back panel, battery, simcard and sdcard. Leave it for few seconds.
  2. boot pc into linux.
  3. copy backup file from previous part 1, the mmcblk0.img file into root of your home folder of your pc. Dont put it into any folder, just in root of your home folder.
  4. reinsert phone battery and back panel but not the simcard and sdcard. Leave the simcard and sdcard out of the phone when doing restore process.
  5. connect usb cable to pc and phone.
  6. after connect pc and phone via usb cable, the phone should vibrate and linux probably would detect many new partitions mounted and it open many window in filemanager. Close all filemanager window that opens.
  7. open linux terminal and do
    Code:
    Select Code
    sudo fdisk -l | grep 3909091328
    and the terminal will ask for password
    Code:
    Select Code
    [sudo] password for user:
    type your password (which will not be displayed for security reason) and press enter and it should give output like this
    Code:
    Select Code
    disk /dev/xxx: 3909 mb, 3909091328 bytes
    thats what we want, especially the xxx. Remember the xxx, usually its only three letter long eg sdb, sdc, sde, sdf etc.. It may depends on your linux configuration so it may not be the same for everyone.
  8. for this step we need internet connection for installing a package that not installed by default. Again still in linux terminal do
    Code:
    Select Code
    sudo apt-get update && sudo apt-get -y install pv
    if the terminal ask for your password then just type it and press enter. The terminal will continue to give output and finally stop, the last line should be something like
    Code:
    Select Code
    setting up pv (1.2.0-1) ...
  9. now close all filemanager window if u got any.
  10. still in terminal do
    Code:
    Select Code
    sudo umount /dev/xxx
    the xxx will be the one from step 7 above. If it asked again for password then type again your password and press enter. It'll give just one or two line of output after that, or nothing at all.
  11. this is the crucial step here, to restore the disk. Still in terminal and phone still connected to pc via usb cable do
    Code:
    Select Code
    sudo pv -tpreb ~/mmcblk0.img | sudo dd of=/dev/xxx
    again, the xxx will be the one from step 7 above. If the terminal asked for password again just type your password and press enter. It'll give output something like
    Code:
    Select Code
    859mb 0:12:50 [1.48mb/s] [======>....................................................................] 23% eta 0:42:30
    and wait for it to finish. This will take long, probably an hour. In this time dont use the pc, don't watch movie, dont surf the net, dont do anything with it. Also dont touch the phone and the usb cable. Just leave it be, go out, take your girlfriend out, feed your cats or anything in the meantime. It'll finish when the percent goes 100% and give another output, something like
    Code:
    Select Code
    3.64GB 0:56:02 [1.11MB/s] [========================================>] 100%
    7634944+0 records in
    7634944+0 records out
    3909091328 bytes (3.9 gb) copied, 3367.93 s, 1.2 mb/s
  12. now just remove usb cable from pc and phone, remove the phone back panel and battery. Leave it for few seconds.
  13. now reinsert the simcard, sdcard, battery and back panel.
  14. turn on the phone by pressing power button and volume up to boot into recovery.
  15. wipe internal sd, system, data, cache and dalvik cache from recovery.
  16. i strongly suggest u got b-rom flashable zip file already in sdcard. Then just flash the b-rom zip. The b-rom i think doesn't provide kernel in it so u can flash my kernel. Why did i recommend b-rom? Because its pure stock based rom. We want to be on stock rom in first boot after the restore process.
  17. restore process done. Now u just need to boot into rom, check all, ril, wifi, bt, wifi mac, bt mac, imei, serial etc if all in correct order.
 
mdfzhi
Old
#3  
mdfzhi's Avatar
Senior Member - OP
Thanks Meter 3606
Posts: 3,990
Join Date: Jun 2011
Location: Behind you
Reserved #2
 
AngSanley
Old
#4  
AngSanley's Avatar
Senior Member
Thanks Meter 526
Posts: 786
Join Date: Apr 2012
Location: Medan, ID

 
DONATE TO ME


Sent from my Nokia_X using Tapatalk
 

the creator of Nokia X Flasher and Nokia X Manager.

Like my work?
Tags
backup, brick, hardbrick, nokia x, restore
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Device Review: OnePlus One

Seemingly every day, there are a bunch of new devices being released. Some are budget devices and some are … more

Browse the Internet with the Innovative Atlas Web Browser

For the most part, Chrome, Firefox, and Dolphin Browser have no real rivals among … more

Choose from Over a Thousand Battery Styles with 3Minit Battery Mod

The battery style in stock Android looks pretty dull. It doesn’t … more

Organize Your Cloud Storage Files with Unclouded

Cloud storage services like Dropbox or Google Drive have grown in popularity dramatically … more