I made a backup of my internal storage using this:
adb exec-out 'tar --create --exclude=data/media/0/TWRP \
data/media/0 2>/backup-errors.txt | \
gzip' | \
dd of=sdcardbakup-$(date +%Y%m%d).tar.gz && \
adb shell cat /backup-errors.txt
I did it this way because I want FOLDERS and FILES to keep the modified dates...
How do i extract/restore that directly to my Android?
Using Android 11
Try this
Code:
adb devices
adb push <file.tar.gz> /data/local/tmp
adb shell "tar -xvf /data/local/tmp/<file.tar.gz>"
jwoegerbauer said:
Try this
Code:
adb devices
adb push <file.tar.gz> /data/local/tmp
adb shell "tar -xvf /data/local/tmp/<file.tar.gz>"
Click to expand...
Click to collapse
not directly to data/media/0 ?
Of course it's possible, too. Above I gave only a generic example.
I
jwoegerbauer said:
Of course it's possible, too. Above I gave only a generic example.
Click to expand...
Click to collapse
How would I do it if I want it to extract to internal storage? I'm sorry I don't know much about this...
Bro I have problem to activate my Windows, please let me know how to solve. Thanks
Confused.
All what isn't external storage memory ( e.g. external SD-card ) is internal storage memory. Directory data/media/0 you mentioned is part of internal storage memory.
jwoegerbauer said:
Confused.
All what isn't external storage memory ( e.g. external SD-card ) is internal storage memory. Directory data/media/0 you mentioned is part of internal storage memory.
Click to expand...
Click to collapse
I meant like the /sdcard directory...
jwoegerbauer said:
Confused.
All what isn't external storage memory ( e.g. external SD-card ) is internal storage memory. Directory data/media/0 you mentioned is part of internal storage memory.
Click to expand...
Click to collapse
My backup is 28 gigabytes and pushing that to tmp will just add up and extracting it would add up leading to no free space. Is there away to extract it directly from the windows pc to android ?
jwoegerbauer said:
Try this
Code:
adb devices
adb push <file.tar.gz> /data/local/tmp
adb shell "tar -xvf /data/local/tmp/<file.tar.gz>"
Click to expand...
Click to collapse
I tried this and it just led to a bootloop?
Andrei the Android Guy said:
Is there away to extract it directly from the windows pc to android ?
Click to expand...
Click to collapse
I do not know of any.
jwoegerbauer said:
I do not know of any.
Click to expand...
Click to collapse
Sad... I found this tho but it doesn't work Can you tell me what's wrong with it?
Code:
adb exec-in 'tar --extract --preserve-permissions --file - data/media/0' < "sdcardbakup-20210207.tar"
extracted the tar.gz then did that command
FYI:
exec-in executes a command and copies all STDIN to this command:
STDIN is the standard input stream - means this accepts text as its input.
BTW:
Of course you can extract the tarball into a specified directory by using the parameter “-C”.
Code:
tar -xzf <PATH-TO-ARCHIVE.tar.gz> -C <NAME-OF-TARGET-FOLDER>
it
jwoegerbauer said:
FYI:
exec-in executes a command and copies all STDIN to this command:
STDIN is the standard input stream - means this accepts text as its input.
BTW:
Of course you can extract the tarball into a specified directory by using the parameter “-C”.
Code:
tar -xzf <PATH-TO-ARCHIVE.tar.gz> -C <NAME-OF-TARGET-FOLDER>
Click to expand...
Click to collapse
it doesnt extract anything
Andrei the Android Guy said:
it doesnt extract anything
Click to expand...
Click to collapse
My last 2 cents here:
Avoid piping, use command
Code:
adb shell
instead of the ( hidden ) commands
Code:
adb exec-out
adb exec-in
and you'll be fine.
Related
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 <---Wifi---> Phone <---3G---> Internet
USB Tethering:
Computer <---USB---> Phone <---Wifi---> Internet
Conputer <---USB---> Phone <---3G---> 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
mohsyn said:
On newer android versions (Im on 7.2) data folder has a folder media which is link to sdcard and one ends up backing up entire sd card. I had a 64gb backup which wasn't necessary
In order to avoid skipping the media folder i had to do some trial and error because busybox tar command is not completely the same as GNU tar.
Would appreciate if you can mention it in the mail guide to use the following command to backup /data folder without copying sdcard files
In first terminal
tar cv --exclude data/media/0 -f /cache/myfifo /data
in 3rd terminal
nc 127.0.0.1 5555 | pv -i 0.5 > data.tar
no change in second terminal
Cheers
Click to expand...
Click to collapse
Umm...how to restore back from computer?
Sent from MARVEL
I am a little new to this, I have installed Android sdk and i am able to see my device by using "adb devices" , i have also installed Cygwin, now i want to backup whole phone memory block so i tried executing the first line on cygin "adb forward tcp:5555 tcp:5555" i get an error saying -bash: adb :command not found.
I am sorry if i am missing any thing, please guide me, and also what do you mean by "download Cygwin, and install with it netcat, pv and util-linux"
Thanx a ton !!
aunriz said:
I am a little new to this, I have installed Android sdk and i am able to see my device by using "adb devices" , i have also installed Cygwin, now i want to backup whole phone memory block so i tried executing the first line on cygin "adb forward tcp:5555 tcp:5555" i get an error saying -bash: adb :command not found.
I am sorry if i am missing any thing, please guide me, and also what do you mean by "download Cygwin, and install with it netcat, pv and util-linux"
Thanx a ton !!
Click to expand...
Click to collapse
You've done almost everything! But you skipped the section "make sure adb is in your path"
Probably you have adb.exe in the path
Code:
C:\Program Files (x86)\android-sdk\platform-tools\adb.exe
So you have to just add it to the Cygwin's path (would be better if you had added it earlier to the windows' path and cygwin will import it automatically but it is ok)
Code:
export PATH="/cygdrive/c/Program Files (x86)/android-sdk/platform-tools":$PATH
Remember to backup the path previously if you want.
Code:
echo $PATH > mypathbackup.txt
scandiun said:
You've done almost everything! But you skipped the section "make sure adb is in your path"
Probably you have adb.exe in the path
Code:
C:\Program Files (x86)\android-sdk\platform-tools\adb.exe
So you have to just add it to the Cygwin's path (would be better if you had added it earlier to the windows' path and cygwin will import it automatically but it is ok)
Code:
export PATH="/cygdrive/c/Program Files (x86)/android-sdk/platform-tools":$PATH
Remember to backup the path previously if you want.
Code:
echo $PATH > mypathbackup.txt
Click to expand...
Click to collapse
Thanks for replying but i cant seem to run the 3rd line , see this
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ adb shell
$ /system/xbin/busybox nc -l -p 5555 -e /system/xbin/busybox dd if=/dev/block/mmcblk0
reloc_library[1311]: 10182 cannot locate 'android_reboot'...
CANNOT LINK EXECUTABLE
i hav sucessfully installed busybox v1.14.3, i am not sure what is causing the problem
EDIT:
i found that my directory ws system/bin instead of xbin
so i changed it and first part worked correctly, now i cant seem to get the second part
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ cd c:/
[email protected] /cygdrive/c
$ nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
-bash: nc: command not found
-bash: pv: command not found
aunriz said:
[email protected] /cygdrive/c
$ nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
-bash: nc: command not found
-bash: pv: command not found
Click to expand...
Click to collapse
You don't have installed pv and netcat on cygwin. Run the setup.exe and install them.
If you run
Code:
whereis pv
whereis nc
should give you some path (in cygwin) but applies similar inside android.
scandiun said:
You don't have installed pv and netcat on cygwin. Run the setup.exe and install them.
If you run
Code:
whereis pv
whereis nc
should give you some path (in cygwin) but applies similar inside android.
Click to expand...
Click to collapse
Now i hav installed cv and nc and commands run sucessfully, but i get the raw file as just 1kb
First terminal:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
adb shell
[email protected] ~
$ adb shell
$ /system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0
/system/bin/busybox nc -l -p 5555 -e /system/bin/busybox dd if=/dev/block/mmcblk0
$
second terminal:
[email protected] ~
$ adb forward tcp:5555 tcp:5555
[email protected] ~
$ cd c:/
[email protected] /cygdrive/c
$ nc 127.0.0.1 5555 | pv -i 0.5 > mmcblk0.raw
55 B 0:00:00 [10.7kiB/s] [<=> ]
[email protected]
No idea what you may be doing wrong
Listen, I appreciate the guide, and it being basically the only one which popped up in google results, I can't gripe too much, but... you really, really need to make it more clear.
The point of a guide is to help a large group of people with varying degrees of knowledge (and if it's a guide targeted at a specific group of people, i.e tech savvy, then it needs to be indicated as such).
With that working definition in place, it follows that you should be as specific as possible; think of *everything*. By doing so, you not only avoid headaches for the people reading the guide, but for yourself as well since you don't have to reply to comments which might've otherwise been avoided.
I would post a question, but I'll probably have figured this out (with a good 1+ hours of searching no doubt) before anyone responds.
Here are some examples of what could be more specific:
"ADB installed." - what is ADB? Where's the link? It's not reasonable to assume people use these tools on a regular basis or remember them.
"You can push parted with GPT support to your device and see all information on a partition or block." - okay, so we know what it does but not how to install it or use it.
"ADB mode" - is this important? What is it? Not sure because it was glossed over.
These are just some examples. It's not the most horrendous trespass ever committed, but definitely annoying. Just spell it out from one step to the next, it works far better than topics with subheadings and unintuitive concepts being assumed as general knowledge on the behalf of noobs like me.
Edit: I'm just going to take everything off my SD card, use nandroid, and then copy the nandroid backup to computer as well. Please improve the guide, thanks.
Greatly appreciate this!
For me, a long-time UNIX and Linux administrator, this little guide was a breath of fresh air. Scandiun, *Thank You* for putting it together. It makes perfect sense to me -- just treat the phone as the linux machine it is. I'm becoming convinced that most of the more recent "developers" hanging around the android community have never used a linux machine before -- they don't seem to know what's going on, they go way out of their way to write overkill tools to do things clumsily that can already be done cleanly and quickly from the command line, and then they wrap those tools in so much mystery, black magic, and script-kiddie terminology that I can't figure out what they do either, and I certainly don't trust them doing things to my phone.
For example, I've got a new Galaxy S3, and just wasted a whole day digging around on xda, reviewing all of the "kewl rooting mods" until I got sick of it. Why the *heck* are people flashing entire partitions just to install a setuid /system/xbin/su on these devices? The rooting method I wound up using was dirt simple -- just find an rc exploit and use it to install an 'su' binary, by typing a few commands via adb. I used a variation of the exploit mentioned in http://seclists.org/fulldisclosure/2012/Aug/171, and elaborated in http://forum.xda-developers.com/showthread.php?t=1790104, http://forum.xda-developers.com/showthread.php?t=1792342, http://galaxys3root.com/galaxy-s3-root/how-to-root-u-s-canadian-dual-core-galaxy-s3-on-mac-osx/, and http://forum.xda-developers.com/showthread.php?t=1827518. If you are a UNIX person, you'll recognize what's going on with that exploit and be able to come up with something that suits your own needs. If you aren't a UNIX person, then you'll be completely lost. Sorta like this guide.
For anyone who doesn't yet know what adb is, or who's never used standard UNIX/Linux tools like dd, netcat, gparted, or busybox, I agree that this guide is not only not going to help you, but may actually aid you in shooting yourself in the foot with extreme efficiency. But please don't criticize or nag the OP in return for helpful advice freely given. You won't learn much about UNIX tools on an Android-related web site in any case. I recommend starting with a Linux systems administration book -- the Nemeth series is always good. But if you do take that route, you need to expect to take time to learn the basics.
Absolutely beautiful!
Thank you for this work. I was able to recover deleted files from my Galaxy Nexus' internal memory using this technique. I made a [GUIDE] using most of what you accomplished here: http://forum.xda-developers.com/showthread.php?p=34185439
Thank you, thank you, thank you! It can't be said enough. I had family photos that I would not have been able to reproduce. Much love to you and yours!
:good: :highfive: :victory:
so did anyone dare to restore the drive (all of storage, everything !)? without bricking the thing ?
mai77 said:
so did anyone dare to restore the drive? w.o bricking the thing ?
Click to expand...
Click to collapse
What drive? A partition?
scandiun said:
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
Click to expand...
Click to collapse
netcat is obsolete (mark to even find it) install net / nc instead
---------- Post added at 01:03 PM ---------- Previous post was at 01:03 PM ----------
scandiun said:
What drive? A partition?
Click to expand...
Click to collapse
all of storage I mean. the full monty ...
----------------------
parted seems to not work fully with Samsung galaxy Y = SGY proprietary rfs filesystem
on SGY mmcblk0 gives you the sd card, not internal storage with android.
backing up my sd card was a thing I could even do before I read this (lol)
mai77 said:
netcat is obsolete (mark to even find it) install net / nc instead
Click to expand...
Click to collapse
nc is an abbreviation for netcat. On Cygwin, you choose to install either, but for the original, written by the *Hobbit*, that allows direct execution of commands with -e and -t, you have to uncheck "Hide obsolete packages" on Cygwin's setup.exe.
The two of them are here:
Netcat 1.10 (netcat.traditional): http://www.netgull.com/cygwin/release-legacy/netcat/
Netcat 1.107 (netcat.openbsd): http://www.netgull.com/cygwin/release/nc/
mai77 said:
parted seems to not work fully with Samsung galaxy Y = SGY proprietary rfs filesystem
on SGY mmcblk0 gives you the sd card, not internal storage with android.
backing up my sd card was a thing I could even do before I read this (lol)
Click to expand...
Click to collapse
Can you post where is your whole memory block then or even the PIT file for that phone? You have an example here:
[Info] List of Samsung Galaxy S2 GT-I9100 devices and partitions
scandiun said:
Can you post where is your whole memory block then or even the PIT file for that phone? You have an example here:
[Info] List of Samsung Galaxy S2 GT-I9100 devices and partitions
Click to expand...
Click to collapse
I don't know where the "whole memory block" is or what it is. is it internal storage = NAND ?
here is the pit file:
mai77 said:
I don't know where the "whole memory block" is or what it is. is it internal storage = NAND ?
Click to expand...
Click to collapse
Yes it is the NAND. See your pit analysis here:
[INFO] Samsung Galaxy Y GT-S5360 PIT File Analysis
OK
scandiun said:
Yes it is the NAND. See your pit analysis here:
[INFO] Samsung Galaxy Y GT-S5360 PIT File Analysis
Click to expand...
Click to collapse
very interesting tool.
but how do I backup NAND in one piece on SGY ?
mmcblk0 = sd card
???blk0 = NAND
it must be somewhere ...
mai77 said:
but how do I backup NAND in one piece on SGY ?
mmcblk0 = sd card
???blk0 = NAND
it must be somewhere ...
Click to expand...
Click to collapse
Is almost sure that is under /dev/block. Please post the output of
Code:
ls -lR /dev/block
how i am know if my tablet "loop devices" support
or how i am kae him to suport loop devices
Code:
cd /sdcard/wherever/
cp /proc/config.gz ./
gunzip ./config.gz
cat ./config | grep LOOP
"LOOP" must be in all caps, or it won't work.
thanks
EndlessDissent said:
Code:
cd /sdcard/wherever/
cp /proc/config.gz ./
gunzip ./config.gz
cat ./config | grep LOOP
"LOOP" must be in all caps, or it won't work.
Click to expand...
Click to collapse
thanks bat you say
Code:
cd /sdcard/wherever/
bat what it is
Code:
wherever
what i am need put there
or how i am loop my device
mihael1996 said:
thanks bat you say
Code:
cd /sdcard/wherever/
bat what it is
Code:
wherever
what i am need put there
or how i am loop my device
Click to expand...
Click to collapse
It means to just cd wherever you like. It doesn't matter where you unzip the file. Just do it in whatever folder you want. All those commands do is copy the kernel configuration to whichever folder you're in, unzip it, search for the loop device configuration options, and print it to the screen.
EndlessDissent said:
It means to just cd wherever you like. It doesn't matter where you unzip the file. Just do it in whatever folder you want. All those commands do is copy the kernel configuration to whichever folder you're in, unzip it, search for the loop device configuration options, and print it to the screen.
Click to expand...
Click to collapse
realy thank you
can you say to me from where downlode this zip file ?
from here it ok ? http://forum.xda-developers.com/showthread.php?t=2246062
and do you have a skype ?
mihael1996 said:
realy thank you
can you say to me from where downlode this zip file ?
from here it ok ? http://forum.xda-developers.com/showthread.php?t=2246062
and do you have a skype ?
Click to expand...
Click to collapse
You're not supposed to download anything. You just use the commands I posted to copy and read your current kernel config. It's all on the tablet already. You just need to type the commands.
If you want to know if that kernel supports loop devices, you could flash it before running the commands I posted. Or, just ask in the thread.
No, I don't have Skype. I hate Microsoft and everything they touch.
where i am put this commands ?
Terminal Emulator
I am trying to replace my digitizer firmware so G01 will work in place of the 5185FC I replaced.
I was following a guide which told me to type this in:
$adb push 02-3011-4820.ekt /sdcard/
$adb push 02-3011-4820.ekt /sdcard/
$adb shell
$su
#touch_fw_update command -u /sdcard/02-3011-4820.ekt
Click to expand...
Click to collapse
every time I try to push the new touch firmware I get this
"cannot stat '02-3011-4820.ekt': No such file or directory"
adb detects my device, I havea all the naked drivers, Android studio and JDK 64bit installed.... what else do I need to do?
I'm just wondering what I can do to fix this and get my touchscreen working once and for all!
Thank you so much in advance
And you are in the folder where you have put the file you want to push?
Changed the directory in the command prompt to the correct folder?
edit: ok, if it's linux, not the command prompt, but the shell...
compact_wisdom said:
And you are in the folder where you have put the file you want to push?
Changed the directory in the command prompt to the correct folder?
edit: ok, if it's linux, not the command prompt, but the shell...
Click to expand...
Click to collapse
I put the file on the root if the sdcard. Or should i be putting it in the directory of minimaladb/fastboot?
How do i change the directory in the command prompt?
Im using Windows 7 by the way.
hkp2 said:
I put the file on the root if the sdcard. Or should i be putting it in the directory of minimaladb/fastboot?
How do i change the directory in the command prompt?
Im using Windows 7 by the way.
Click to expand...
Click to collapse
Here is the command you are using to push
Code:
adb push 02-3011-4820.ekt /sdcard/
Maybe try this instead .....
Code:
adb push 02-3011-4820.ekt /sdcard
You can change directory with this
Code:
cd
and you can list files once in adb shell like this
Code:
ls
Thx Josh
I wasn't sure what I should cd to. I also tried ls but wasn't sure what to do from there.
I did look at the tutorial for adb and pushed the file into /sdcard/ from my laptop. It seemed to be successful because this is the message I got
943 KB/s <32868 bytes in 0.034s>
Click to expand...
Click to collapse
I proceed to type in the following
adb shell
su
touch_fw_update command -u /sdcard/02-3011-4820.ekt
Click to expand...
Click to collapse
And that's where I'm stuck with a message
sh: touch_fw_update: not found
Click to expand...
Click to collapse
It seems like I'm at least moving forward a couple steps so that's good.
hkp2 said:
I wasn't sure what I should cd to. I also tried ls but wasn't sure what to do from there.
I did look at the tutorial for adb and pushed the file into /sdcard/ from my laptop. It seemed to be successful because this is the message I got
I proceed to type in the following
And that's where I'm stuck with a message
it seems like I'm at least moving forward a couple steps so that's good.
Click to expand...
Click to collapse
Where is this command coming from, a guide or somewhere like that ?
Code:
touch_fw_update command -u
Thx Josh
This guide
snart[dotcom]/replacing-tf300t-digitizer/
Click to expand...
Click to collapse
I'm getting the adb tutorial from here
http://forum.xda-developers.com/showthread.php?t=2266638
Click to expand...
Click to collapse
Disclaimer
Code:
Whatever you do, it's your decision and you do it on your own risk!
I am not responsible for bricks, any kind of damages, data loss or any other unwanted result!
Everything you do is done on YOUR OWN RESPONSIBILITY!
And I am also not responsible if you lose the chat with your crush.
You might want to transfer your internal storage such as /sdcard to your computer directly and compressed as fast as possible.
So here is how you do it (on linux using bash):
Reboot your phone into TWRP, connect your device to your computer, and run the following command:
Code:
adb shell mkfifo /bk.pipe && adb exec-out 'tar -cvap data/media/0 2>/bk.pipe' | dd of=sdcard.tar & adb shell cat /bk.pipe &
In this example your data (in this case /data/media/0) will be backed up to your computer into the file sdcard.tar.
Compression is done automatically and you will get a nice output on your terminal on which file is being backed up currently.
When everything is finished you should get a message similar to this on your terminal:
Code:
79692237+2 records in
79692238+0 records out
40802425856 bytes (41 GB, 38 GiB) copied, 3550,38 s, 11,5 MB/s
(On the result of this you can see that the speed is around 12 MB/s, means that 1 GB backups in less than 1 minute)
When you get that, it means that your backup has finished and you can safely remove the usb cable.
Note that you can do this with any directory on your device, so if you desire to back up /data, just write data instead of data/media/0.
Example of the resulting sdcard.tar file (opened on my computer):
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Decompressing your data directly to your device might get a little trickier:
Code:
adb shell mkfifo /rst.pipe && adb push sdcard.tar /rst.pipe & adb shell 'cd /; cat /rst.pipe | tar -xv'
If that does not work, you can just extract the content of the tar file normally onto your computer and then copy the files over using adb push or copy the tar file to your phone and extract it using the following command:
Code:
adb push sdcard.tar /sdcard/sdcard.tar
adb shell 'cd /; tar -xvf /sdcard/sdcard.tar'
And that should do the job as well.
---
See also:
tar to pipe but keep -v verbose output separate from STDERR
Transferring binary data over ADB shell (ie fast file transfer using tar)
Compose and pipe a gzipped tar archive in one go
Bash tar and output to log file
GNU Tar
Encrypting and Compressing
How encrypt data/text stream instead of a file?
Post on my blog:
How to backup compressed data from your android device to your computer
Is it possible to do this with windows cmd?
Hmm, that looks really complicated. How about rsync instead?
(Note: This requires root and it requires rsync... It's present on CyanogenMod and probably other custom roms, but usually not on stock ROMs...)
Code:
1. Create rsync.conf:
[root]
path = /
read only = no
uid = root
gid = root
2. Upload the file to the phone
$ adb push rsync.conf /sdcard/
3. Restart adbd with root permissions
$ adb root
4. Set up TCP forwarding of the rsync daemon through adb
$ adb forward tcp:9873 tcp:873
5. Run the daemon on the phone
$ adb shell /system/xbin/rsync --daemon --config /sdcard/rsync.conf --no-detach
6. Copy files in both directions
rsync -v rsync://localhost:9873/root/
rsync --help
Edit: You can also run rsync via SSH, e.g. with the help of SSHdroid:
Code:
rsync -e "ssh -l root -p 2222" -v <phone-ip>:/
adbsync utility by @Renate NST is pretty perfect for this too. I've got a batch automation for Windows packaged up in my Odds and Ends thread but I'm sure it wouldn't be hard to get something similar setup for Linux.
Nice!
Is there a way to do this but instead of coping files, copy the raw data from the internal memory? So that I can recover deleted files from the device from the generated raw file.
Tarcis said:
Nice!
Is there a way to do this but instead of coping files, copy the raw data from the internal memory? So that I can recover deleted files from the device from the generated raw file.
Click to expand...
Click to collapse
Something like (run in the host console)
Code:
adb exec-out "cat <sdcard partition> 2>/dev/null" > sdcard.raw
Or
Code:
adb exec-out "dd if=<sdcard partition> bs=64k 2>/dev/null" > sdcard.raw
This works on Windows too.
Something like on the first post that works on Windows but without the progress report (which is what the FIFO is for):
Code:
adb exec-out "tar czf - /sdcard" > sdcard.tar.gz
adb exec-out is an undocumented adb command that works like adb shell but without creating a pseudoterminal thus it works with binary content.
Has it been confirmed that all files are backed up this way? Main issue I have when backing up via MTP is that not all files seem to be transferred properly e.g. Carbon/Helium backups missing the json file.
tech3475 said:
Has it been confirmed that all files are backed up this way? Main issue I have when backing up via MTP is that not all files seem to be transferred properly e.g. Carbon/Helium backups missing the json file.
Click to expand...
Click to collapse
As far as I know, tar backups all files recursively in the directory you specified. Hence that should work perfectly fine. I recommend to use TWRP 3+ for this, but you can also try it on android itself.
Tarcis said:
Nice!
Is there a way to do this but instead of coping files, copy the raw data from the internal memory? So that I can recover deleted files from the device from the generated raw file.
Click to expand...
Click to collapse
It depends on your device, but in general, you can transfer any binary data over exec-out in highspeed.
Code:
adb root
adb exec-out "dd if=/dev/block/mmcblk0" > mmcblk0.img
In this case it would copy the whole internal storage including all partitions and everything from 0 to end of your internal emmc to your computer.
On newer devices/systems you can also use the following to copy the single partitions (in this example /data) as raw image to your pc:
Code:
adb root
adb exec-out "dd if=/dev/block/bootdevice/by-name/userdata">userdata.img
Examples for partition names: system, data, userdata, cache, boot, LOGO, recovery, ...
If you want to compress all partitions separately into a tar archive, following command should do:
Code:
adb root && adb exec-out 'cd /dev/block/bootdevice/by-name && tar -ca ./' > allpartitions.tar
This would also work on windows.
char101 said:
Something like (run in the host console)
Code:
adb exec-out "cat <sdcard partition> 2>/dev/null" > sdcard.raw
Or
Code:
adb exec-out "dd if=<sdcard partition> bs=64k 2>/dev/null" > sdcard.raw
This works on Windows too.
Something like on the first post that works on Windows but without the progress report (which is what the FIFO is for):
Code:
adb exec-out "tar czf - /sdcard" > sdcard.tar.gz
adb exec-out is an undocumented adb command that works like adb shell but without creating a pseudoterminal thus it works with binary content.
Click to expand...
Click to collapse
xdvs23 said:
It depends on your device, but in general, you can transfer any binary data over exec-out in highspeed.
Code:
adb root
adb exec-out "dd if=/dev/block/mmcblk0" > mmcblk0.img
In this case it would copy the whole internal storage including all partitions and everything from 0 to end of your internal emmc to your computer.
On newer devices/systems you can also use the following to copy the single partitions (in this example /data) as raw image to your pc:
Code:
adb root
adb exec-out "dd if=/dev/block/bootdevice/by-name/userdata">userdata.img
Examples for partition names: system, data, userdata, cache, boot, LOGO, recovery, ...
If you want to compress all partitions separately into a tar archive, following command should do:
Code:
adb root && adb exec-out 'cd /dev/block/bootdevice/by-name && tar -ca ./' > allpartitions.tar
This would also work on windows.
Click to expand...
Click to collapse
Thank you so much for the commands, but I ran them on Windows, and I get no error, but the output file is 1kb.
I tried running on dos prompt, I´ll try again tomorrow on cygwin
thank but too hard for me
can i have another software to do this?
There are a few ways which you can make a Nandroid backup. The recommended way is to use a custom recovery to create one, and it’s the only way to restore from one. You should be able to use any custom recovery that offers Nandroid backup capabilities — if you don’t want to search around, the best choices are CWM and TWRP. Once you’ve flashed a custom recovery onto your device, you can boot into it and choose to create (or later on, restore from) a Nandroid backup. It’ll go through the process and create a backup file on your microSD card or other equivalent storage location.
Emma Tayler said:
There are a few ways which you can make a Nandroid backup. The recommended way is to use a custom recovery to create one, and it’s the only way to restore from one. You should be able to use any custom recovery that offers Nandroid backup capabilities — if you don’t want to search around, the best choices are CWM and TWRP. Once you’ve flashed a custom recovery onto your device, you can boot into it and choose to create (or later on, restore from) a Nandroid backup. It’ll go through the process and create a backup file on your microSD card or other equivalent storage location.
Click to expand...
Click to collapse
Then tell me how to create a nandroid backup from your internal storage (/sdcard or /data/media/0)
Tarcis said:
Thank you so much for the commands, but I ran them on Windows, and I get no error, but the output file is 1kb.
I tried running on dos prompt, I´ll try again tomorrow on cygwin
Click to expand...
Click to collapse
Then open the file using e.g. notepad and show me the contents. It could be an error message or something...
cuddas said:
thank but too hard for me
can i have another software to do this?
Click to expand...
Click to collapse
I'm actually making backup tools which you can then use to create backups easily, maybe I'll also make a program with a user interface for windows where you can do that much easier.
Of course I cant promise anything atm cuz I have some other things to do as well.
xdvs23 said:
Disclaimer
Code:
adb shell mkfifo /bk.pipe && adb exec-out 'tar -cvap data/media/0 2>/bk.pipe' | dd of=sdcard.tar & adb shell cat /bk.pipe &
Click to expand...
Click to collapse
replace with this one
Code:
adb shell mkfifo /bk.pipe && adb exec-out 'tar -cvap data/media/0 2>/bk.pipe' | dd of=sdcard.tar & adb shell cat /bk.pipe &
xdvs23 said:
Then open the file using e.g. notepad and show me the contents. It could be an error message or something...
Click to expand...
Click to collapse
good idea!
The files contained:
allpartitions.tar: /sbin/sh: syntax error: unterminated quoted string on one tr
mmcblk0.img: 0kb
sdcard.raw : /sbin/sh: syntax error: unexpected redirection
userdata:img: dd: can't open '/dev/block/bootdevice/by-name/userdata': No such file or directory
Does this help?
http://syedtahir16.blogspot.in/2014/11/the-ultimate-android-backup-solution.html
syedtahir16 said:
Does this help?
http://syedtahir16.blogspot.in/2014/11/the-ultimate-android-backup-solution.html
Click to expand...
Click to collapse
No, but thanks. The ideia is to be able to backup without being able to load the OS.
how to restore?
when im about to remove the modem files like this from adb menu
dd if=/dev/zero of=/dev/block/bootdevice/by-name/mdm1m9kefs1
dd if=/dev/zero of=/dev/block/bootdevice/by-name/mdm1m9kefs2
dd if=/dev/zero of=/dev/block/bootdevice/by-name/mdm1m9kefs3
dd if=/dev/zero of=/dev/block/bootdevice/by-name/mdm1m9kefsc
im getting "write error: No space left on device" error.
how to fix this. or is there any other way to delete those files.
Those commands will overwrite the named block-devices with zeroes, they don't get deleted means it's not technically erasing.
jwoegerbauer said:
Those commands will overwrite the named block-devices with zeroes, they don't get deleted means it's not technically erasing.
Click to expand...
Click to collapse
ok, so is there a way to overwrite them? cos atm i cant with those commands
To overwrite you have to specify as infile an image ( .img ) and as outfile the block-device wanted
jwoegerbauer said:
Look inside here:
dd: No Space Left on Device | Beamtic
After running dd for a long time, it stops with an error saying no space is left on the device.
beamtic.com
Click to expand...
Click to collapse
would it also be fixed when i format the device and wipe all data?
Raw34 said:
would it also be fixed when i format the device and wipe all data?
Click to expand...
Click to collapse
Re-read my altered post above yours.
jwoegerbauer said:
To overwrite you have to specify as infile an image ( .img ) and as outfile the block-device wanted
Click to expand...
Click to collapse
can u give me an example for the command for adb menu?
i want to get rid of this file mi10orj.bin in the modem
What ADB are you using? AFAIK ADB hasn't a menu,
If device is rooted then you may run
Code:
adb devices
adb shell "stop"
adb shell "rm -f /vendor/mi10orj.bin"
adb shell "start"
if the .bin-file is located in vendor partition what IDK
jwoegerbauer said:
What ADB are you using? AFAIK ADB hasn't a menu,
If device is rooted then you may run
Code:
adb devices
adb shell "stop"
adb shell "rm -f /vendor/mi10orj.bin"
adb shell "start"
if the .bin-file is located in vendor partition what IDK
Click to expand...
Click to collapse
its called "minimal adb and fastboot tool".
yes the device is rooted. im gonna try this commands when im done with my working.
thx so much for your help and insight, so far.