Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,778,591 Members 36,583 Now Online
XDA Developers Android and Mobile Development Forum

[TUT] Full U8800 backup with Linux howto

Tip us?
 
bonowax
Old
(Last edited by bonowax; 3rd December 2011 at 07:47 PM.) Reason: Complement information
#1  
Junior Member - OP
Thanks Meter 25
Posts: 24
Join Date: Nov 2011
Post [TUT] Full U8800 backup with Linux howto

I hope this information is useful to you. It allowed me to restore my phone, after flashing the 2.3.5BETA from Huawei, effectively reverting the process. If you follow these procedures, you do so at your own risk. A typo in the needed commands may render your phone useless, so if you feel uneasy DON'T DO IT! That being said, on with the show.


Rationale: The U8800's memory is accessible as a mass storage device, when the phone is powered up in pink screen mode. This device holds the boot sector, partitions, operating system and user data. As such, it can be treated as any other block device and can be imaged to a file, through a bit-by-bit copy. The inverse is also possible and thus constitutes a valid backup/restore method.

Motives: Some weeks ago, I imaged my U8800 having in mind that spending time flashing ROMs, recovery and boot images could at some point go wrong and brick the device. Having a full dump of the device, done while it was in good working condition, would give me a chance of disaster recovery.

Requirements: Linux box and familiarization with Linux. I use Slackware 13.37 x86_64, but any flavour of Linux should do.


1 - Enter pink-screen mode by pressing power + vol up + vol down;

2 - Connect the USB cable. I recommend using the USB ports on the back of your PC (irrelevant if it's a laptop) as some PC cases have inadequate wiring to the front ports and will only allow slow data transfer. I've done it all while logged in as root, and not running X. If you're running X and HALD (automount of CD's and USB sticks, etc), you should unmount whatever units get automaticaly mounted when you plug the U8800 in. Avoid X if possible;

3 - Run 'dmesg' to ensure your U8800 was correctly detected. last output on screen should look like this:

[ 4444.026295] usb 1-2: New USB device found, idVendor=12d1, idProduct=1035
[ 4444.026300] usb 1-2: New USB device strings: Mfr=3, Product=2, SerialNumber=0
[ 4444.026304] usb 1-2: Product: Qualcomm CDMA Technologies MSM
[ 4444.026308] usb 1-2: Manufacturer: Qualcomm, Incorporated
[ 4444.029209] usb 1-2: selecting invalid altsetting 1
[ 4444.029265] scsi4 : usb-storage 1-2:1.20
[ 4445.031474] scsi 4:0:0:0: Direct-Access Qualcomm MMC Storage 2.31 PQ: 0 ANSI: 2
[ 4445.031755] sd 4:0:0:0: Attached scsi generic sg2 type 0
[ 4445.034576] sd 4:0:0:0: [sdb] 7733248 512-byte logical blocks: (3.95 GB/3.68 GiB)
[ 4445.035947] sd 4:0:0:0: [sdb] Write Protect is off
[ 4445.035952] sd 4:0:0:0: [sdb] Mode Sense: 0f 0e 00 00
[ 4445.035956] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 4445.042568] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 4445.053569] sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 sdb8 sdb9 sdb10 sdb11 sdb12 sdb13 sdb14 >
[ 4445.059328] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[ 4445.059335] sd 4:0:0:0: [sdb] Attached SCSI removable disk"

"sdb" is the device name alocated to the U8800. It can be "sdc", "sdd", "sde". Depends on the number of block devices (hard disks, USB sticks, card readers, etc) already present on your system.

4 - If your U8800 is showing up in "dmesg"' output, you are ready to create the image file, by typing "dd if=/dev/sdb of=u8800.img bs=512". Remeber: this example assumes the device name to be "sdb", yours may be different. If all goes well, you'll end up with the "u8800.img" file in the current directory. This is a 4GB transfer so it will take some time and there will be no progress indicator whatsoever. Final output should look like:

3959420000 bytes (3866621 KB) copied, [ time spent], [KB/s] ( These figures vary according to your transfer speed )

If the transfer fails, the output will show how many bytes were transfered along with the indication that there was an error; should it indicate an error, retry from the beginning, using a different USB port.

The resulting u8800.img file can be ziped, gziped, bziped, rared, whatever to reduce it's size to around 600 MB.

4A - This concludes the backup part;

5 - Having hold of the u8800.img file, you can restore it back to your U8800. Connecting and finding the device name of your mobile through the output of "dmesg" is the same as for backup and is described in (1), (2) and (3). To restore it, and assuming the img file resides in the current directory, type "dd if=u8800.img of=/dev/sdb bs=512". Don't forget to decompress the file in case you ziped it. Again, your device name may be other than "sdb".

Since writing to flash memory is a slower process than reading it, this operation will take longer than performing the backup. As an example, mine took around 45 minutes to complete, while other user reported 25 minutes for the same operation.

BEWARE: There's no way to perform a sanity check of the img file you're dumping back! Those commands will hapilly flash an Excel spreadsheet to your mobile's memory if you give it as a parameter to the "dd" command!


Final words

I used this method to revert to a pre 2.3.5BETA state. Huawei's update wrote a new bootloader, which is something not included in CWM backups and restores. Furthermore: CWM restores showed up errors about mountpoints. Ignoring these errors and performing a factory reset would allow FROYO to boot up and run, but my carrier's costumizations, which reside in the same volume as boot.img, and restore.img, were ignored afterwards. I didn't want this to be used as an argument by the carrier to consider my warranty void, should I need it...

Cheers
The Following 24 Users Say Thank You to bonowax For This Useful Post: [ Click to Expand ]
 
sewa2k
Old
#2  
Senior Member
Thanks Meter 40
Posts: 221
Join Date: Jan 2011
Location: Villa Alemana

 
DONATE TO ME
First of all, thanks for your tut, it's very helpfull for those who have linux

I have a question

The u8800.img contains all partition data?

Thanks in advance, regards
 
bonowax
Old
#3  
Junior Member - OP
Thanks Meter 25
Posts: 24
Join Date: Nov 2011
Quote:
Originally Posted by sewa2k View Post
First of all, thanks for your tut, it's very helpfull for those who have linux

I have a question

The u8800.img contains all partition data?

Thanks in advance, regards

Yes. You can mount the image through /dev/loop and run fdisk on it to see the partition table.

There are windows tools to accomplish the same tasks of byte-copying to a file and vice-versa, but I haven't used them, since it was straight-forward with Linux.

Cheers
 
sport_billy
Old
#4  
Member
Thanks Meter 10
Posts: 41
Join Date: Jun 2009
Thank you very much for this tutorial.

But what about us who have not made this backup when we had the original froyo and flashed the original 2.3.5?
I have several CWM backups but none of them works(it keeps booting in recovery mode or not booting at all),unless i restore to factory data which is useless.

Can you or someone else please upload a clean froyo backup so we can flash it and go back to our 2.2 backups via CWM?
 
sewa2k
Old
#5  
Senior Member
Thanks Meter 40
Posts: 221
Join Date: Jan 2011
Location: Villa Alemana

 
DONATE TO ME
Quote:
Originally Posted by bonowax View Post
Yes. You can mount the image through /dev/loop and run fdisk on it to see the partition table.

There are windows tools to accomplish the same tasks of byte-copying to a file and vice-versa, but I haven't used them, since it was straight-forward with Linux.

Cheers
Thanks m8, i'll do it tonight, so i can start to porting roms to U8800-51
 
Blefish
Old
#6  
Blefish's Avatar
Senior Member
Thanks Meter 1802
Posts: 776
Join Date: Aug 2011
Location: Paluküla, Hiiumaa

 
DONATE TO ME
Wow nice. I was waiting for something like this. I ran "sudo -i" before the process and it's copying right now. This is good for recovering the phone in case of soft brick.
 
m!xal!s
Old
#7  
Junior Member
Thanks Meter 14
Posts: 21
Join Date: Dec 2011
That was a great tutorial! Thank you!

I did it on an Atom netbook last night, booting Linux from a USB thumb drive.
I saved the image on an external USB ntfs HDD, that it had to first be mounted, of course. I had to to this because the internal disk is an 8GB SSD with no room for a 4GB image file.

The imaging process took about 25 minutes on this machine, with all 3 USB 2.0 ports occupied (Boot USB drive, u8800, external USB drive). Transfer speed was about 2.7 MB/s.

Right now I'm trying to compress it with 7zip (maximum) and at 65% progress it has a 45% compression ratio (output/total). (The phone has many apps installed (1GB) and also I have the ndrive folder on the internal memory as a backup in case there is a problem with the ext SD.)
So I suggest you, to do the backup on an empty phone if possible, if you want the smallest size for your image.

Regards.
 
bonowax
Old
(Last edited by bonowax; 6th December 2011 at 12:07 AM.) Reason: Typo
#8  
Junior Member - OP
Thanks Meter 25
Posts: 24
Join Date: Nov 2011
Quote:
Originally Posted by sport_billy View Post
Thank you very much for this tutorial.

But what about us who have not made this backup when we had the original froyo and flashed the original 2.3.5?
I have several CWM backups but none of them works(it keeps booting in recovery mode or not booting at all),unless i restore to factory data which is useless.

Can you or someone else please upload a clean froyo backup so we can flash it and go back to our 2.2 backups via CWM?
It should be possible to dump and restore only the first two partitions, in which case it would make a much smaller up/download. This would restore the previous bootloader and allow CWM to operate normally ( or at least I hope so ).
I'll look into it.

EDIT: I dumped primary partitions 1, 2 and 3 to a image file which is around 140 MB after ziped. This could be enough to restore the old bootloader. "Could" is the keyword here, as it assumes the partition scheme is the same in every U8800.
The Following User Says Thank You to bonowax For This Useful Post: [ Click to Expand ]
 
sport_billy
Old
#9  
Member
Thanks Meter 10
Posts: 41
Join Date: Jun 2009
bonowax can you please upload it so we can give it a try?
I am having bootloops even with the new beta v2 they released today.
So your solution is the only way to revert back to 2.2 .
 
skifyr123
Old
#10  
skifyr123's Avatar
Senior Member
Thanks Meter 671
Posts: 592
Join Date: Mar 2011
Location: Republic City
Quote:
Originally Posted by sport_billy View Post
bonowax can you please upload it so we can give it a try?
I am having bootloops even with the new beta v2 they released today.
So your solution is the only way to revert back to 2.2 .
you could just install stock 2.2 firmware normal way ... easy as that


Sent from my u8800 using XDA App
Nexus 5
Google Nexus 7 (2012)
Sony Xperia S
#HOLO

Tags
backup restore image dump
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes