[Q] Make a full backup for flashing with busybox - Android Q&A, Help & Troubleshooting

Hello
There's a way for making a backup with RAW extension that can be flashed with fastboot in asus fonepad (i don't know about others)
See this: http://forum.xda-developers.com/showthread.php?t=1818321
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):
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/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:
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 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.
Click to expand...
Click to collapse
But it's for rooted devices only. how can i make a backup with busybox non-root?

Related

Vizio VTAB1008: Clockworkmod recovery initial release Dec 11, 2011

EDIT: March 18th, 2012: See note at bottom regarding upgrade to Honeycomb with CWM installed.
Clockworkmod recovery for the Vizio VTAB1008
As promised here it is.
Use this carefully. Any wrong commands can potentially brick your system
I was able to port Clockwork Mod Recovery to the Vizio and boot into it.
Many thanks to fadefx for testing it.
The zip file is attached to this post. Please unzip and read the instructions in README.txt. It is also given below. Please also read the Caveats below.
### Here is Clockworkmod Recovery for the Vizio VTAB1008 ###
### Released on Dec 11th, 2011 -- rprr ###
### Based on cyanogenmod sources and with some ###
### Vizio VTAB1008 specific mods ###
### Requirements ###
### You need 'adb' access on a rooted device Vizio tablet ###
### AN EXTERNAL MICRO SDCARD MUST BE PRESENT IN ORDER TO ###
### MAKE AND RESTORE BACKUPS. ###
### Installation ###
### The following copies the file to the root of your sdcard ###
adb push recovery-cwm-vtab1008.img /sdcard/recovery-cwm-vtab1008.img
### Login to adb shell ###
adb shell
### Become root ###
su
### The following installs CWM to the recovery partition ###
### Make sure to not make any mistakes here ###
dd if=/sdcard/recovery-cwm-vtab1008.img of=/dev/block/mmcblk0p5 bs=512
### Logout as root ###
exit
### Exit adb ###
exit
### Reboot into recovery ###
### ENJOY !!!! Be careful. ###
### Exercise caution when using this. ###
Click to expand...
Click to collapse
CAVEATS:
Display is in landscape mode only
Cannot restore the kernel and ramdisk backups yet
No ROM manager support yet
Also the edifying scripting has some issues with the mount command. Any commands that begin with
mount(.........)
Click to expand...
Click to collapse
should be replaced as in the following example
run_program("/sbin/busybox", "mount", "/system");
Click to expand...
Click to collapse
Original Recovery
WARNING IF YOU WANT TO UPGRADE to Honeycomb:
Some of us including me have had problems when we attempted to upgrade to Honeycomb with CWM installed. This has resulted in non working devices. It maybe due to CWM. If so, it is possible that you may have to revert back to the stock recovery. I am attaching it to this post. You have to unzip it, move it to the sdcard and then install it. Remember that root will be lost if you follow this.
Code:
dd if=/sdcard/recovery-orig.img of=/dev/block/mmcblk0p5 bs=512
I don't think the bootloader is located on /sdcard/ this partition is fat formatted and the bootloader would be visible to the user in some way either through a filenrowser or when mounted to a windows machine.
FadeFx said:
I don't think the bootloader is located on /sdcard/ this partition is fat formatted and the bootloader would be visible to the user in some way either through a filenrowser or when mounted to a windows machine.
Click to expand...
Click to collapse
Thanks. Using the mmls tool from Ubuntu, I was able to dig up a little further to find unallocated partitions etc. Here is the list.
$ mmls -t gpt mmcblk0.img
GUID Partition Table (EFI)
Offset Sector: 0
Units are in 512-byte sectors
Slot Start End Length Description
00: Meta 0000000000 0000000000 0000000001 Safety Table
01: ----- 0000000000 0000015359 0000015360 Unallocated
02: Meta 0000000001 0000000001 0000000001 GPT Header
03: Meta 0000000002 0000000033 0000000032 Partition Table
04: 11 0000015360 0000017407 0000002048 sm0
05: ----- 0000017408 0000019455 0000002048 Unallocated
06: 07 0000019456 0000035839 0000016384 kernel
07: 00 0000035840 0000052223 0000016384 ramdisk
08: 01 0000052224 0000502783 0000450560 android_system
09: ----- 0000502784 0000666623 0000163840 Unallocated
10: 02 0000666624 0002239487 0001572864 android_data
11: 08 0002239488 0002255871 0000016384 reckernel
12: 04 0002255872 0002272255 0000016384 recovery
13: 05 0002272256 0002273279 0000001024 misc
14: 09 0002273280 0002277375 0000004096 uli_r
15: 10 0002277376 0002281471 0000004096 uli_w
16: 12 0002281472 0002285567 0000004096 HDCP
17: 06 0002285568 0002695167 0000409600 cache
18: 03 0002695168 0007729083 0005033916 mass_storage
19: ----- 0007729084 0007729151 0000000068 Unallocated
Click to expand...
Click to collapse
So far, I have tried various hacks but just cannot get CWM to run on this However, if you are good with Linux/Unix command line stuff and with adb it is possible to make backups of the various partitions. Thus far, I have backed up and restored the recovery partition successfully. This is obviously a very dicey thing to do as it is possible to brick this device.
rprr said:
So far, I have tried various hacks but just cannot get CWM to run on this However, if you are good with Linux/Unix command line stuff and with adb it is possible to make backups of the various partitions. Thus far, I have backed up and restored the recovery partition successfully. This is obviously a very dicey thing to do as it is possible to brick this device.
Click to expand...
Click to collapse
well is there any way we can just modify the existing recovery menu?
plus you did get adb to work with it but that was a simple fix
In order to change the options you have to build the recovery program from the Android source code.
Good Morning! Just a quick note to say thanks for working on this! Keep going...I think you can, I think you can, I can think you can etc etc etc. hahaha
Rprr, i think you have to specify the partition reckernel somewhere in board config as it seams the recovery has its own kernel there and it needs to know where it is located.
Edit: finally obtained root using a win7 64bit machine, pdanet drivers and d00ml0rd v3 and adb files from sdk.
----------------------------------------
tapatalked
Obsolete: Please see OP.
Still no luck with CWM port. Anyway, here is my method for enabling adb when in recovery. This requires linux/unix terminal line usage. On my VTAB the recovery partition is at /dev/block/mmcblk0p5. I assume that this is the case with all Vizio vtab1008 tablets.
Proceed carefully. You can potentially damage your device.
1. Quick Way
Download my recovery-new.img.zip file which is attached to this post and unzip it. You will have a file called "recovery-new.img". Copy this to your sdcard. Then open an adb shell and become root. Run the following command.
Code:
dd if=/sdcard/recovery-new.img of=/dev/block/mmcblk0p5 bs=512
Now reboot into recovery. You will have adb access.
2. Long Way for DIYers
On VTAB using adb as root:
Code:
dd if=/dev/block/mmcblk0p5 of=/sdcard/recovery.img bs=512
On my Mac (in terminal), Should work on linux as well:
Code:
adb pull /sdcard/recovery.img
cp recovery.img recovery.cpio.gz
gunzip -f recovery.cpio.gz
mkdir recovery
cd recovery
cpio -i -F ../recovery.cpio
Edit the 'default.prop' to make the needed changes. It should look like.
Code:
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=0
persist.service.adb.enable=1
On my Mac again:
Code:
cpio -i -t -F ../recovery.cpio | cpio -o -H newc -O ../recovery-new.cpio
cd ..
gzip recovery-new.cpio
dd if=/dev/zero of=recovery-new.img count=16384 bs=512
dd if=recovery-new.cpio.gz of=recovery-new.img conv=notrunc
adb push recovery-new.img /sdcard/recovery-new.img
On Vizio using adb as root:
Code:
dd if=/sdcard/recovery-new.img of=/dev/block/mmcblk0p5 bs=512
Now reboot VTAB into Recovery mode. You should have adb access.
PS: If you have made any mistakes, you can reflash the original recovery.
Code:
dd if=/sdcard/recovery-orig.img of=/dev/block/mmcblk0p5 bs=512
PPS: Once you have adb root shell access in recovery, you can backup and potentially restore the /system partition.
PPPS: I am also attaching the original recovery if you would like to flash it back using dd. It is called recovery-orig.img.zip. Please unzip it.
rprr said:
Still no luck with CWM port. Anyway, here is my method for enabling adb when in recovery. This requires linux/unix terminal line usage.
Proceed carefully. You can potentially damage your device.
On VTAB using adb as root:
Code:
dd if=/dev/block/mmcblk0p5 of=/sdcard/recovery.img bs=512
On my Mac (in terminal), Should work on linux as well:
Code:
adb pull /sdcard/recovery.img
cp recovery.img recovery.cpio.gz
gunzip -f recovery.cpio.gz
mkdir recovery
cd recovery
cpio -i -F ../recovery.cpio
Edit the 'default.prop' to make the needed changes. It should look like.
Code:
#
# ADDITIONAL_DEFAULT_PROPERTIES
#
ro.secure=0
ro.allow.mock.location=0
ro.debuggable=0
persist.service.adb.enable=1
On my Mac again:
Code:
cpio -i -t -F ../recovery.cpio | cpio -o -H newc -O ../recovery-new.cpio
cd ..
gzip recovery-new.cpio
dd if=/dev/zero of=recovery-new.img count=16384 bs=512
dd if=recovery-new.cpio.gz of=recovery-new.img conv=notrunc
adb push recovery-new.img /sdcard/recovery-new.img
On Vizio using adb as root:
Code:
dd if=/sdcard/recovery-new.img of=/dev/block/mmcblk0p5 bs=512
Now reboot VTAB into Recovery mode. You should have adb access.
PS: If you have made any mistakes, you can reflash the original recovery.
Code:
dd if=/sdcard/recovery.img of=/dev/block/mmcblk0p5 bs=512
PPS: Once you have adb root shell access in recovery, you can backup and potentially restore the /system partition.
PPPS: I am attaching my recovery-new.img. It is in zip format.
Click to expand...
Click to collapse
great tutorial i will give it a try, it would be nice if someone could do this and backup the system partition on a new vtab that way if something goes wrong you can reflash it
additional thoughts could this lead to rom porting as well http://android.modaco.com/topic/348695-guide-how-to-port-a-rom/
dylanparrish said:
great tutorial i will give it a try, it would be nice if someone could do this and backup the system partition on a new vtab that way if something goes wrong you can reflash it
Click to expand...
Click to collapse
Users cannot modify the system partition. Therefore the only difference between a new system partition and after rooting should be the root that were installed such as su, busybox etc.
PS: I assume that all Vizio tablets have the same partition structure with an 8MB recovery partition at /dev/block/mmcblk0p5.
rprr said:
Users cannot modify the system partition. Therefore the only difference between a new system partition and after rooting should be the root that were installed such as su, busybox etc.
PS: I assume that all Vizio tablets have the same partition structure with an 8MB recovery partition at /dev/block/mmcblk0p5.
Click to expand...
Click to collapse
But after root one can modify /system and thus brick the device. If wed have a backup we can dd it back while in recovery mode.
Yes, since there is only one vizio tablet model, all have the same partition layout.
----------------------------------------
tapatalked
Obsolete. Please see OP.
HOWTO: Backup/Recovery of /system using command line tools.
Once you have adb working in recovery mode this is what you can do to backup and recover your /system partition.
### Backup Procedure ###
Boot into recovery mode.
Code:
adb shell
You will get the following error. Ignore it.
Code:
sh: getcwd: No such file or directory
Now do the following. Assumes internal sdcard at mmcblk0p4 and /system at mmcblk0p2
Code:
cd /
mount -o rw -t vfat /dev/block/mmcblk0p4 /sdcard
dd if=/dev/block/mmcblk0p2 of=/sdcard/system.img bs=4096
The system.img file contains a backup of the /system. In principle one can recover from this.
### Recovery Procedure ###
Reboot into recovery.
Code:
adb shell
cd /
mount -o rw -t vfat /dev/block/mmcblk0p4 /sdcard
dd if=/sdcard/system.img of=/dev/block/mmcblk0p2 bs=4096
Reboot into normal mode.
I have not yet had a need to do the recovery part yet so that has not been tested by me.
HTH.
Linked in my howto thread...
----------------------------------------
tapatalked
I have not been able to get this to work. After booting into recovery my win7 sees the vtab as usb storage and not usb composite. I guess this is whats causing ADB to not see it as a device. Any suggestions?
grekco said:
I have not been able to get this to work. After booting into recovery my win7 sees the vtab as usb storage and not usb composite. I guess this is whats causing ADB to not see it as a device. Any suggestions?
Click to expand...
Click to collapse
I have been using a Mac. I don't know what would be causing this issue on Windows. In my situation I need to restart adb.
Good work as always rprr and fade... appreciate the time u guys are putting into this tab, i'm always checking the threads for updates.
error: device not found.
My computer says its connect and ready but adb not recognizing it. Any ideal?
abtxpress said:
error: device not found.
My computer says its connect and ready but adb not recognizing it. Any ideal?
Click to expand...
Click to collapse
Can you try "adb kill-server" followed by "adb start-server" before connecting the device? Then connect the device and do "adb devices".
Unfortunately I don't have easy access to a Windows machine.
Edit: I wonder if the Windows drivers required are different depending on whether one is accessing adb through recovery mode when compared to normal mode.
Update on CWM: Still no luck with CWM porting.
But,
I decided to go back to the android stock source source code for 2.3.2 which is on the Vizio tablet. This time I was able to build the recovery binary and then copy it to the recovery partition. I was able to get this to run but the graphics is all distorted in the following way.
1) I see 4 exclamation symbols in landscape mode and 2 recovery menus (see pic)
2) It does not respond to the volume buttons + power button
I am guessing that there are frame buffer issues + input issues.

[Q] How to pipeline pipe contents from android phone via adb to my computer?

Suppose that I do the following command from windows:
Code:
adb shell cat /sdcard/myfile.zip > c:\file.zip
The result is that the two files don't match, even they have much different file size. Using 'adb pull' works but is not compatible with pipelining or fifos.
Any help?
EDITED: here is the solution:
Antonine said:
Right, I'm currently working on a project which involves imaging Android phones - specifically, the program I've written is mean to automate identifying the memory block containing the userdata and then using the following sequence of commands (using Android Debug Bridge) to copy it to the computer that the phone is connected to:
Code:
adb forward tcp:5555 tcp:5555
adb shell
busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]
This is done in command prompt and then you have to manually open another command prompt and type in:
Code:
adb forward tcp:5555 tcp:5555
nc 127.0.0.1 5555 | dd of=[chosen file name].bin -- progress
This copies the memory block over without any problems when done manually and even shows you in real time how much data has been transferred.
The problem I have is with automating the process in C#. Specifically, I can get every stage of it to work through using a process to write the commands to standard input and using a tcp listening port to receive the data. Apart from this crucial element of the process:
Code:
adb shell "busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]"
For some reason, no matter how I try to phrase it or do it, C# hates that command and won't execute it. I can manually type the exact same thing into the command prompt and it works fine but trying to do it in C# just leads to busybox acting as though I typed the command in incorrectly - this is what it gives me:
Code:
BusyBox v1.15.2 <2009-11-27 10:38:30 GMT> multi-call binary
Usage: nc [-in] [-wN] [-l] [-p Port] [-f FILENAME|PADDR PORT] [-e PROG]
Open a pipe to IP:port or file
Options:
-e PROG Run prog after connect
-i SEC Delay interval for lines sent
-w SEC Timeout for connect
-f FILE Use file <ala /dev/ttyS0> instead of network
-l Listen mode, for inbound connects
<use -l twice with -e for persistent server>
-p PORT Local port
The problem appears to be particularly with the use of bs=[bytes] but I've no idea why - and I've spent several hours searching all over the web for solutions.
So basically, I was wondering whether anyone else might have encountered this issue before and if anyone has any ideas to get around it? At the moment I'm using a script to send the commands to the command prompt but that's a kludge that I'd really prefer not to have to use.
Thanks in advance for any suggestions or comments and apologies if I've posted this in the wrong place.
Click to expand...
Click to collapse
zeppelinrox said:
Probably has to do with syntax.
In the first instance you don't have it in quotes.
Code:
busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]
Then you do have quotes the second time.
Code:
adb shell "busybox nc –l –p 5555 –e dd if=/dev/mtd/mtd[mtd block number]"
Sometimes, using a newer busybox helps too... 1.15.2 is kinda old
Click to expand...
Click to collapse
NOTE: you have to use unix paths with cygwin, not DOS ones. Use cygpath to convert:
Code:
cygpath -u "C:\your path\folder\archive"
Thanks man, you saved my life! I just deleted some pictures from my Nexus 7 and I had to find a way to dump the internal storage to my computer in order to use it with PhoroRec...
scandiun said:
Suppose that I do the following command from windows:
Code:
adb shell cat /sdcard/myfile.zip > c:\file.zip
The result is that the two files don't match, even they have much different file size. Using 'adb pull' works but is not compatible with pipelining or fifos.
Any help?
EDITED: here is the solution:
Click to expand...
Click to collapse
can't seem to get the -- progress part to work it kicks back error of invalid command
Code:
" adb forward tcp:5555 tcp:5555 "
" adb shell "
" su "
" busybox nc 127.0.0.1 5555 | dd of=C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img bs=4096 "
After inputting the last line I get:
: cannot open for write: Read-only file system
any Ideas? I don't understand how my pc desktop could be read only
Thanks in Advance
Phatboyj420 said:
can't seem to get the -- progress part to work it kicks back error of invalid command
Code:
" adb forward tcp:5555 tcp:5555 "
" adb shell "
" su "
" busybox nc 127.0.0.1 5555 | dd of=C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img bs=4096 "
After inputting the last line I get:
: cannot open for write: Read-only file system
any Ideas? I don't understand how my pc desktop could be read only
Thanks in Advance
Click to expand...
Click to collapse
You can't use DOS paths on cygwin, you have to use unix ones:
Code:
busybox nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img bs=4096
You can convert any DOS path to unix with cygpath if you don't figure out directly (even on other drives):
Code:
cygpath -u "C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img"
Result:
Code:
/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img
scandiun said:
You can't use DOS paths on cygwin, you have to use unix ones:
Code:
busybox nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img bs=4096
You can convert any DOS path to unix with cygpath if you don't figure out directly (even on other drives):
Code:
cygpath -u "C:\Users\PB-2\Desktop\GN-3_MJ5_Full.raw.img"
Result:
Code:
/cygdrive/c/Users/PB-2/Desktop/GN-3_MJ5_Full.raw.img
Click to expand...
Click to collapse
Awesome Thanks,
I'm assuming this is true in both cd & dd via cygwin?
I was originally trying to input the commands in DOS because your OP doesn't specify, or say to use cygwin.
I came to the realization of using cygwin after reading other guides.
I've been looking at some of your other guides I owe You many thanks as a Result
Phatboyj420 said:
Awesome Thanks,
I'm assuming this is true in both cd & dd via cygwin?
I was originally trying to input the commands in DOS because your OP doesn't specify, or say to use cygwin.
I came to the realization of using cygwin after reading other guides.
I've been looking at some of your other guides I owe You many thanks as a Result
Click to expand...
Click to collapse
Yes, since cygwin is to be compatible with unix scripts paths must be always in unix format.
You can use dos paths directly
Code:
cd `cygpath -u "C:\your path\folder\archive"`
I've updated the first post
scandiun said:
Yes, since cygwin is to be compatible with unix scripts paths must be always in unix format.
You can use dos paths directly
Code:
cd `cygpath -u "C:\your path\folder\archive"`
I've updated the first post
Click to expand...
Click to collapse
Awesome share Thanks
I still can't get this to work "for the life of me" I know, I now have cygwin setup right, as it works with your example here
Phatboyj420 said:
Awesome share Thanks
I still can't get this to work "for the life of me" I know, I now have cygwin setup right, as it works with your example here
Click to expand...
Click to collapse
Are you still getting "cannot open for write"?
scandiun said:
Are you still getting "cannot open for write"?
Click to expand...
Click to collapse
Nope you set me strait on that one
In the first window I do
Code:
" adb forward tcp:5555 tcp:5555 "
" adb shell "
" su "
" system/xbin/busybox nc –l –p 5555 –e dd if=/dev/block/mmcblk0 bs=4096 "
and get the usage response
Code:
BusyBox v1.22.1-Stericson (2014-01-25 17:27:18 CET) multi-call binary.
Usage: nc [-iN] [-wN] [-l] [-p PORT] [-f FILE|IPADDR PORT] [-e PROG]
Open a pipe to IP:PORT or FILE
-l Listen mode, for inbound connects
(use -ll with -e for persistent server)
-p PORT Local port
-w SEC Connect timeout
-i SEC Delay interval for lines sent
-f FILE Use file (ala /dev/ttyS0) instead of network
-e PROG Run PROG after connect
If I trade out the string from your other example here, " The only problem i'm having with your other example is that I can't specify the " bs=4096 " "
I can get through to the second window
Example
Code:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ adb shell
[email protected]:/ $ su
su
[email protected]:/ # /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 bs=4096
555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0 bs=4096 <
The second terminal then gives me an error at the last string
Output of second terminal
Code:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw bs=4096 -- progress
dd: unrecognized operand `progress'
Try `dd --help' for more information.
If I run it with out, " -- progress " it runs but with-out the desired effect of the progress response
Code:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw bs=4096
I'm at a loss I need to figure out how to run the pv and the dd of= in the same line i guess
or to some how combine
Code:
" nc 127.0.0.1 5555 | dd of=/cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw bs=4096 "
&
Code:
" nc 127.0.0.1 5555 | pv -i 0.5 > /cygdrive/c/Users/PB-2/Desktop/GN-3_Tmp/mmcblk0.raw "
So as to achieve both the bs= & the Read-out notification
Thanks tremendously, for your assistance thus far.
That's right, some android implementations of dd lack advanced parameters. You can try either installing Busybox from Stericson or just skip the bs option.
Removed all the "bs=4096" from quotations in first post, since it's not needed at all.
I keep getting
write error: File too large, when trying to dump my /data partition to my external sd card.
The external card is exFat formatted, which is supposed to be able to handle larger than 4Gig files
here's my command
Code:
busybox dd if/dev/block/mmcblk0p29 of=/mnt/extSdCard/data.ext4.img
any ideas?
p.s. yes, I do have more than 4G's of software on my phone
kevp75 said:
I keep getting
write error: File too large, when trying to dump my /data partition to my external sd card.
The external card is exFat formatted, which is supposed to be able to handle larger than 4Gig files
here's my command
Code:
busybox dd if/dev/block/mmcblk0p29 of=/mnt/extSdCard/data.ext4.img
any ideas?
p.s. yes, I do have more than 4G's of software on my phone
Click to expand...
Click to collapse
Two ideas:
1 - Try from recovery
2 - If that doesn't work put the sd into a card reader and connect it as otg drive.
scandiun said:
Two ideas:
1 - Try from recovery
2 - If that doesn't work put the sd into a card reader and connect it as otg drive.
Click to expand...
Click to collapse
I can try from recovery sure, but how would #2 solve the issue? (don't know what otg drive means)
kevp75 said:
I can try from recovery sure, but how would #2 solve the issue? (don't know what otg drive means)
Click to expand...
Click to collapse
Search google images for otg
scandiun said:
Search google images for otg
Click to expand...
Click to collapse
didnt work. I get the same issue
Rockin' it from my Smartly GoldenEye 35 NF1 (muchas gracias:* @iB4STiD @loganfarrell @muniz_ri @Venom0642 @ted77usa @rebel1699* @iB4STiD) ~ 20GB free cloud https://copy.com?r=vtiraF
Check me out online @ http://kevin.pirnie.us
kevp75 said:
didnt work. I get the same issue
Click to expand...
Click to collapse
Format a pendrive in NTFS or HFS+ and connect it to your phone via OTG, if it's not detected directly there are some apps on play store.
scandiun said:
Format a pendrive in NTFS or HFS+ and connect it to your phone via OTG, if it's not detected directly there are some apps on play store.
Click to expand...
Click to collapse
NTFS worked. My data partition is over 8Gigs! But I was under the impression that exFat was able to support that... but I guess not...
kevp75 said:
NTFS worked. My data partition is over 8Gigs! But I was under the impression that exFat was able to support that... but I guess not...
Click to expand...
Click to collapse
Next time you can try copying some big data to the exfat from the computer itself, just to see if prompts some error.
scandiun said:
Next time you can try copying some big data to the exfat from the computer itself, just to see if prompts some error.
Click to expand...
Click to collapse
tried that too had a 9.7g dvd imaage i tried with and it failed at the 4g mark. ext4 should be the standard
Rockin' it from my Smartly GoldenEye 35 NF1 (muchas gracias:* @iB4STiD @loganfarrell @muniz_ri @Venom0642 @ted77usa @rebel1699* @iB4STiD) ~ 20GB free cloud https://copy.com?r=vtiraF
Check me out online @ http://kevin.pirnie.us

[GUIDE][TUTORIAL][SHARE] How to make a nandroid backup directly to your computer with

Note: I'm just sharing the work of the XDA member.This guide was tested on Galaxy Y GT-S5360.Here's a little introduction:
scandiun said:
INFORMATION
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. Get them from 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 and for Galaxy S2 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):
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/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:
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 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.
You can use adb via wifi as well with applications like WiFi ADB.
Back up of the whole memory block (via wifi)
Original post: [Q] Nandroid directly to computer w/o sdcard
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
Tips:
- Fifos only can be made on linux native filesystems, for example on a FAT partition is not possible.
- Reading from a partition does not modify it.
Now check on Filezilla Server the speed
Back up of the whole memory block (USB tethering, Wifi tethering)
To use 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:
Computer Phone Internet
Conputer 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.
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 and ImDisk Virtual Disk Driver. You can also use recovery software on individual partitions like Recuva in combination with VHD Tool or command line tools included with operating systems.
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 there
Code:
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.
LINKS
[GUIDE] Internal Memory Data Recovery - Yes We Can!
How to Create and Attach a Virtual Hard Disk in Windows 7
[Guide] Types of Android backups
Click to expand...
Click to collapse
Original Thread : http://forum.xda-developers.com/showthread.php?t=1818321
And here is the guide to make nandroid backup through terminal app in android with switching off the phone in sdcard!!!
http://forum.xda-developers.com/showthread.php?t=1620255

Restoring From a dd Backup

I made a backup using the following guide here and now I need to restore from it. I would reply directly in the thread however I don't have permission to at the moment.
My issue is that on my phone I don't have enough space to store both a backup and the phone image and it doesn't appear that CWM can restore from a .raw file.
Is it possible to basically reverse the operation and setup this on my Mac
Code:
adb forward tcp:5555 tcp:5555
sudo nc -l -p 5555 -e dd if=/path/to/backup
and then on my phone:
Code:
adb forward tcp:5555 tcp:5555
cd /dev/block/mmcblk0
nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
I get the feeling however (going with my limited understanding of Unix), this will just transfer the .raw file back and it will just possibly brick the phone. (Edit: going back and looking, maybe using …dd of=/dev/block/mmcblk0 and then using netcat to provide the file to write will work?)
I have Googled extensively and another option I have come upon is using gdisk to extract the individual partitions from the backup but this sounds fairly laborious to me.
Alternatively is it possible just to turn the .raw into tars which CWM can restore natively?
Thanks, and apologies if this is in the wrong place.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Moto G (XT1033), Cyanogenmod 11 M6

[TUTORIAL] Nandroid backup/restore directly from your PC

This guide is intended for those who own 16G MI3W which, sadly, often doesn't have enough space to make nandroid backup. This tutorial will show you how you can make nandroid backup directly to your PC and restore it later. Entire procedure will not store any single byte to your phone's internal memory.
Great part of this tutorial (and the whole idea) is taken from scandiun's thread, so some credits go to him.
WAS IT NECESSARY?
As we know, this operation (backup and restore) can, sort of, be done using adb backup command. But this command leaves out sms messages, call logs and some other information. So, backup made with adb backup may not be full, and does not reflect phone's current state.
REQUIREMENTS
This tutorial requires you to have:
ClockworkMod custom recovery installed on your phone
BusyBox installed into /system/xbin directory (your device probably already has it there). But you can check it or install it using this application (requires root).
Linux machine or MS Windows. I recommend linux, but if you're using Windows, please install Cygwin with netcat (nc), pv and util-linux (you can select those binaries in Cygwin setup).
Adb installed into some PATH directory. For windows, adb executable could be put into Windows directory (eg. C:\Windows). For linux, you can use command shown here to install adb, which will automatically put adb into your PATH directory.
Let's get down to business!
Whole philosophy lies behind opening some port on your device, over which will /data, /system or /cache partition be transfered from MI3 to PC's hard drive. Data is also being compressed/decompressed on the fly, so backup size is reduced. You can also see transfer speeds and total amount of data transfered.
Process is tested and it works!
BACKUP
To initiate a backup, we first have to run ADB. Connect USB cable to your phone. Then boot your device into recovery and select system 1. After that, go into Storage and mounts and mount /data, /cache and /system.
Finally, open Cygwin/linux shell and type the following:
Code:
adb kill-server
sudo adb start-server
adb forward tcp:1234 tcp:1234
adb shell
Then open another Cygwin/linux shell and create and enter directory which will hold MI3 backup. I called my directory mibackup.
Code:
mkdir ~/mibackup
cd ~/mibackup
You can see that we are working here with two consoles. First console will always represent phone's memory, and second will always represent our PC.
We will backup total of three partitions: /data, /cache and /system. That is essentially everything you need.
/system holds android system, and /data partition holds internal storage, applications, dalvik-cache and every other data including SMS messages, etc. But be prepared, because backup of this data partition can take up to 12,5GB of PC's hard drive space. It is usually lower because of compression, but just so you know. /system partition can take up to around 600MB, and is also usually lower than that.
/data partition (without internal storage)
Whole backup procedure of /data partition relies on few simple commands. Type this command in your first console, where adb shell is run:
Code:
cd /system/xbin
./busybox tar -pcf - /data --exclude='data/media/0' | ./busybox nc -l -p 1234
And then type command below into another shell:
Code:
nc localhost 1234 | pv -i 0.5 | gzip -c > data.gz
This will start backup process. As you may have noticed, this will backup our /data partition, but without internal storage (internal SD card).
Internal storage backup
After backup is complete, we can also backup our phone's storage (a.k.a. internal SD card), using following commands.
Type these commands in first console:
Code:
cd /system/xbin
./busybox tar -pcf - /data/media/0 | ./busybox nc -l -p 1234
and this command into second console:
Code:
nc localhost 1234 | pv -i 0.5 | gzip -c > sdcard.gz
/cache partition
Cache partition does not hold any important data. But I've noticed that when I wiped it, my current theme reset! This partition can be backed up in a matter of seconds, so why wouldn't we give it a try?
Type these commands in first console:
Code:
cd /system/xbin
./busybox tar -pcf - /cache | ./busybox nc -l -p 1234
and this command into second console:
Code:
nc localhost 1234 | pv -i 0.5 | gzip -c > cache.gz
/system partition
Finally, we can backup our /system partition. But, because BusyBox is located in /system, and we do not want to use this partition while it's in backup/restore phase, we have to copy xbin directory (busybox) to internal SD card.
Type these commands in your first console:
Code:
cp -R /system/xbin /data/media/0
cd /data/media/0/xbin
./busybox tar -pcf - /system | ./busybox nc -l -p 1234
and this command into second console:
Code:
nc localhost 1234 | pv -i 0.5 | gzip -c > system.gz
After the process is done, type following commands in first console to clean up xbin directory from internal storage, and to close adb.
Code:
cd /
rm -rf /data/media/0/xbin
exit
adb kill-server
And you have just created backup of your phone, into chosen directory. Congratulations!
Backup is in this case made of four files: data.gz, sdcard.gz, cache.gz and system.gz.
RESTORE
Before each restore procedure, we should wipe partition we are going to restore. So be careful! It is also important to check if /data, /cache and /system are mounted after each wipe/format.
To prepare things for restoration, open console and type in:
Code:
adb kill-server
sudo adb usb
adb forward tcp:1234 tcp:1234
adb shell
Then open another terminal, and go into directory where backups are stored. When I showed you how to create backup, I used mibackup directory. So, let's go into that directory once again, so we can pull our backups from there.
Code:
cd ~/mibackup
/data partition (doesn't contain internal storage)
If you are going to restore /data and /sdcard, then go to mounts and storage, and choose the last option - format /data and /data/media.
If you are going to restore only phone's data (and not /sdcard), select wipe data/factory reset from CWM menu. Don't skip this step! After that, make sure that /system and /data partitions are mounted.
To restore data partition then, type this commands into first console:
Code:
cd /
/system/xbin/busybox nc -l -p 1234 | tar -px
and this command into second:
Code:
gunzip -ck data.gz | pv -i 0.5 | nc localhost 1234
Internal storage
Make sure that /system and /data are mounted.
If you just restored /data partition, you don't have to wipe/format anything. Otherwise, if you just want to restore your internal SD card, you can type following command into first console, to wipe it first:
Code:
cd /
rm -rf /data/media/0/*
Type these commands into first console to restore your internal SD card (if you've backed it up):
Code:
cd /
/system/xbin/busybox nc -l -p 1234 | tar -px
and this command into second one:
Code:
gunzip -ck sdcard.gz | pv -i 0.5 | nc localhost 1234
/cache partition
Make sure that /system and /cache are mounted, and then format /cache from CWM.
/cache partition will be restored just as fast as it was backed up.
Type these commands into first console:
Code:
cd /
/system/xbin/busybox nc -l -p 1234 | tar -px
and this command into second console:
Code:
gunzip -ck cache.gz | pv -i 0.5 | nc localhost 1234
/system partition
After process is finished, we can restore system partition in a similar fashion we did when we backed it up. Just make sure that /system and /data are mounted, and then format /system from CWM.
Type this commands into first console:
Code:
cp -R /system/xbin /data/media/0
cd /
/data/media/0/xbin/busybox nc -l -p 1234 | tar -px
And this command into second one:
Code:
gunzip -ck system.gz | pv -i 0.5 | nc localhost 1234
After that, we just have to do some housekeeping jobs:
Code:
cd /
rm -rf /data/media/0/xbin
exit
adb kill-server
And last, but not least, if you haven't restored /cache partition, you should format it from CWM recovery.
That's it!

Categories

Resources