Hi all,
I have decided to unlock my bootloader. I know that I need to backup all the data (I know how to do it via adb backup and adb pull); however, when I do adb pull the metadata of files gets lost. This is not a problem in most of the cases, except of photos - as the information about the date the files were created is lost, after restoration gallery orders them in incorrect order.
I know that adb backup preserves metadata; is there a way to include DCIM folder in this backup? Or make adb pull somehow preserve metadata as well?
Thanks!
matus201 said:
Hi all,
I have decided to unlock my bootloader. I know that I need to backup all the data (I know how to do it via adb backup and adb pull); however, when I do adb pull the metadata of files gets lost. This is not a problem in most of the cases, except of photos - as the information about the date the files were created is lost, after restoration gallery orders them in incorrect order.
I know that adb backup preserves metadata; is there a way to include DCIM folder in this backup? Or make adb pull somehow preserve metadata as well?
Thanks!
Click to expand...
Click to collapse
adb pull sometimes doesn't work with a stock adbd. that might have to wait till after you get root and a kernel upgrade.
you may be able to dd it to a file on the sdcard to make an image then mount the sdcard to the computer and copy it to a safe place.
edit: come to think of it, dd might only work on a "device" so you'd have to dd the whole sd card, but where to? maybe a temp folder? maybe you can .tar the directory? not sure but i think tar preserves meta data. then you would just need to unpack it after...
Related
If you want to delete an app, change a file or whatever when you get root, please be smart about it. Think before you delete something. Have a plan B (a failback plan). If you don't know how you will fix whatever you're about to potentially break, DON'T DO IT.
Try to learn ADB. I know it's not for everyone, but it may pull you out of the fire later. Think before you do anything.
No matter what Android device it is, someone always has a post saying "Help! I deleted <insert app here> and I need it back!" Here are some tips:
Don't freeze or delete an app using Titanium Backup without knowing if it will crash your phone or not
If you're using ADB, rename a file instead of deleting it if you're not sure if it will crash your phone or not
Your /system folder is like the base operating system folder (think C:\Windows); before you change something BACK IT UP!
Code:
adb pull /system <destination_folder>
Since we only have temp root for now, if you're disabling packages, back up the packages.xml file
Code:
adb pull /data/system/packages.xml <destination_folder>
Learn from others' mistakes; if someone bricks their phone, read the thread and figure out how NOT to screw yourself and your phone
Heard of measure twice, cut once? Read three times, execute once. Listen to the Devs. Be nice to them. Don't piss them off. They do this on their own time.
Please be smart about whatever you do to your phone. We can't be dumb smart phone users. If you don't know something, ask in the appropriate section or thread. If you know something, don't tease others for not knowing. The occasional flame is funny and all, but at some point someone has to learn whatever they don't know - someone is going to have to step up and help them.
Thanks dawg...
I think and SD backup and Nandroid recovery backup on root will be good enough? <not condascending...just asking from your adb opinion?>
ROM_Guest said:
Thanks dawg...
I think and SD backup and Nandroid recovery backup on root will be good enough? <not condascending...just asking from your adb opinion?>
Click to expand...
Click to collapse
I think of that as another layer. We're not there with the Sensation yet, but I always think it's a good idea to use any and all methods best suited for what you're doing.
For example, if you're flashing a theme someone customized which could change multiple apk and jar files, a Nandroid backup is best.
When someone goes to remove an apk or freeze an app, they usually don't think to take a Nandroid backup (because deleting or freezing takes only a second - Nandroid backups take longer).
1) we don't have that functionality yet and 2) it's very common for someone to try to freeze a critical app which can cause a boot loop, which can easily be fixed by adb (if a Nandroid is not available).
i tried:
adb pull / backup/
it started building a file list and then started the copy. after a time (dont know excatly when because i let it run beside) it stoped working at:
pull: /sys/devices/platform/msm_adc/batt_id -> backup/sys/devices/platform/msm_adc/batt_id
nothing more happend. now i got 4883 files, a total of 3.1 GB, backup directory. but it seems not all files are in. when i browse through the phone dir i see much more files in the dirs.
is there any other way of getting a complete backup? when i rerun the command will it skip the files it allready dumped to disk? any other command?
thx!!!
daSn00p said:
i tried:
adb pull / backup/
it started building a file list and then started the copy. after a time (dont know excatly when because i let it run beside) it stoped working at:
pull: /sys/devices/platform/msm_adc/batt_id -> backup/sys/devices/platform/msm_adc/batt_id
nothing more happend. now i got 4883 files, a total of 3.1 GB, backup directory. but it seems not all files are in. when i browse through the phone dir i see much more files in the dirs.
is there any other way of getting a complete backup? when i rerun the command will it skip the files it allready dumped to disk? any other command?
thx!!!
Click to expand...
Click to collapse
All you really need is /system and /data if you want a complete backup. I know you see other files+folders, but those are mounted by the OS and kernel... or whatever. Someone with more Linux experience can explain better than I can. But if you want a complete backup, just get /system and /data.
The /system folder is like getting the base OS. The /data is all your user/personal data.
dumping /system worked fine: 1366 files pulled. 0 files skipped.
when trying to dump /data it freezes again and allways again at:
pull: /data/d/smem_log/dump_cont -> ../backup2/data/d/smem_log/dump_cont
so i dumped every dir in data manually only /data/d is missing now. but there are so many dirs in it, i dont want to dump every dir on its own
any idea?
daSn00p said:
dumping /system worked fine: 1366 files pulled. 0 files skipped.
when trying to dump /data it freezes again and allways again at:
pull: /data/d/smem_log/dump_cont -> ../backup2/data/d/smem_log/dump_cont
so i dumped every dir in data manually only /data/d is missing now. but there are so many dirs in it, i dont want to dump every dir on its own
any idea?
Click to expand...
Click to collapse
That should be good enough for now. No one else is doing this manually, so until we get an official root this is all you can do to backup. Once we get permanent root, titanium backup will do most of this for us.
I would only make backups of anything you change or delete at this point, but that's just me.
Sent from my HTC Sensation 4G using XDA App
I don't know if ADB is even the best tool to do this, but I want to be able to copy the entire file system off the EEE pad onto a pc. I want everything, starting from the "/" root directory. I want the entire file system and all files copied over so I can work with them on the pc.
I have root (verified by # when entering adb shell and various root apps successfully running.)
My thought was to do "adb pull /" from a dos shell (running windows 7), but not everything copies over. I get lots of messages about "skipping special file", I dont get the /data/data directory, etc etc.
Is there a tool or some way to copy over the entire file system starting from "/" ?
Thank you.
Nvflash will let you download the APP partition which is the system folder. It's an ext4 filesystem that you can mount and poke around.
USP is the data partition.
Be careful not to format your TF!
Clockwork mod will backup the system.img and you can either mount or unyaffs this. I forget which one. Same for data.img
sent from my cyanogen(mod) vision
Is the data.img same as the USP partition? Is the system.img same as the APP partition?
which I can then mount and explore?
I don't want to edit anything, I only want to examine.
In particular, I want to take a snapshot of all the files and filesystem (directory structures, files, etc) before an app is run. After the app is run and exited, I want to take another snapshot and look at what has changed. If there are new files created, existing files edited, etc. I want to search for strings (grep), etc.
I was hoping I could copy all the files to do this, but perhaps there is another way like one of those you suggested (nvlash, clockwordmod, ??)
Thank you.
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
sent from my cyanogen(mod) vision
gee one said:
Nvflash and clockworkmod wouldn't be used on a running system. You might want to look in the /proc and caches, but I'm not an expert on this.
Click to expand...
Click to collapse
Expert or not, I really appreciate your advice.
I took your initial suggestion to be to use NVflash and/or clockworkmod to make backups of the device. It seems from some other threads I've read that the tablet drive consists of up to 15 or 16 partitions, two of which are USP and APP.
So conceivably I could back those up "before", and mount the backup images somewhere to look at, preferably on a pc.
Then, I could install and run the app in question, and use NvFlash and/or CWM again to make backup images, and look at them for comparison.
On another note, I tried installing busybox and running cp to move, for example, /data to the external SD card, but I think I need a bigger SD card.
I wonder if
busybox cp / /Removable/MicroSD/targetdirectory
would work to copy everything?
The danger with that is that some directories and files are virtual- /proc and I think /var are virtual directories. Files like dev/null dev/zero would be problematic!
You might want to do specific parts, such as /data, or even /data/data/your.app's.java.name.here
You could use "find ." and write a script to pull everything with adb, but it would take forever, so it might not be a true snapshot.
Have you looked at the ddms or some of the other tools in the android SDK?
Sorry to confuse. By snapshot I did not mean screenshot. I meant just a record of the state of the device at that point in time. Meaning, all the files before the app was run. Then all the files (any new ones, changes to existing ones, any deleted) AFTER the app was run. I want to look at what has changed.
Still, thanks for the ddms idea. I have to look at any other tools in the adb environment that could be useful.
I'm posting this information because 1 I was asked to and 2 I feel it could be helpful for the "MORE ADVANCED" users.
Do Not try any of my methods, None of them. Unless you WANT to brick your phone.
With that said, here to the best of my memory is what I have done.
I pulled my framework-res file as well as the other 3 that relate to it and tried to theme them. It worked a few times and after tweaking I eventually broke the permission of the files.. Hence putting me in a bootloop.
What I did..
Thankfully I had the Bionic Safestrap installed. (DO NOT INSTALL THE SAFESTRAP) So, I was able to boot into the safestrap and use adb commands. This took some toying around. For the sake of saving people from bricking i'm not going to list all of the adb commands. But I had to mount both the /sdcard and /systemorig. Now simple enough, I just went through and rm every file from inside the folders. (Do not rm the folder, You will not be able to recover the folder and no you can not push the folder) rm all files from /systemorig /apps /osh etc.. then push all my restore files (backup made with safestrap) to the /sdcard. (For some reason they have to be placed on the sdcard before being copied to the root directory otherwise it breaks the permission of the files, idk y?) A few times in order to mount /systemorig as full rw I had to quick toggle safe mode. Now cp all files from the sdcard to their places on the phone turn safe mode off if you had to enable it and reboot. Bam, You just recovered from a soft brick. I have also used this method to restore webtop after breaking that also. Yes it does take a long time to restore and it is cumbersome but at least you can do it. I was also able to mount /emmc to /sdcard and flash a rom from the razr (yes i knew at this point it wouldn't work, this was a test) although it did not boot it did unpack and fully install the rom in the correct locations and it looked as though it would with a little more code boot from the sdcard. What i'm playing with now is trying to use the overclock method from the razr on my a2 but seems how I don't know exactly what files are being changed i'm being cautious. Sorry guys I'm not exactly a linux guy, I do what I can and I am always learning.
I'll edit this post as more info comes to mind. But to let you know I have been able to play with most files w/o fear of bricking so long as you don't mess up the .rc files in /systemorig you will always be able to boot into safestrap.
Hello,
I have LG Optimus Elite Android 2.3.7...it was rooted...
I accidentally deleted /system/bin/sh...gee..oh my god..
The problem is that I am not even able to adb to my phone now..
If I do adb to that phone, it is complained about /system/bin/sh doesn't exist something...
Gee...........
Obviously, factory reset didn't help cuz it didn't restore the sh...
What would be my option ??
When I just reboot my phone, it is just stay "Welcome to" screen...Even though I touched the begin, it won't go next..I think because..
my /system/bin/sh file is deleted..so my phone can't execute anything from the phone shell..
What would be my option to recover my phone?
Please help
Thanks,
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
anotherguy19 said:
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
Click to expand...
Click to collapse
I would follow his advice. Good luck!
Thanks for your suggestion.
BTW, nandroid backup -> I don't think I can use it because I don't have original backup rom?
Odin -> does this also work for LG phone?
anotherguy19 said:
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
Click to expand...
Click to collapse
goforandroid said:
Thanks for your suggestion.
BTW, nandroid backup -> I don't think I can use it because I don't have original backup rom?
Odin -> does this also work for LG phone?
Click to expand...
Click to collapse
No, you can't use nandroid backup. A nandroid is an image file of your system partitions. PC users typically know this as ghosting or cloning. To linux users, it's just a dd. You create the image yourself from a working copy. You don't need the original ROM. You can make a backup of your /system partition (nandroid) any time you have a working copy.
PS I'm an idiot. LG was literally the first thing u said. And you are correct. You need to use LG Flash Tool.
See 1942836
Unfortunately, 1942836 is not the same model I have.
I don't think I can use that instruction.
It really makes me crazy since I can't use adb at all....
I tried creating update.zip and put it in sd card to install..however, as you may know, signature verification failed.
if I could get key file to create signed zip file other than test one, that may work.
Is there anyway I can bypass the signature verification??????
Thanks,
anotherguy19 said:
No, you can't use nandroid backup. A nandroid is an image file of your system partitions. PC users typically know this as ghosting or cloning. To linux users, it's just a dd. You create the image yourself from a working copy. You don't need the original ROM. You can make a backup of your /system partition (nandroid) any time you have a working copy.
PS I'm an idiot. LG was literally the first thing u said. And you are correct. You need to use LG Flash Tool.
See 1942836
Click to expand...
Click to collapse
Can't you reflash your system?
I think you need /bin/bash for adb to start, so without it, you can't push anything from your computer to your phone i guess..
What bootloader do you use?
1bymany said:
Can't you reflash your system?
I think you need /bin/bash for adb to start, so without it, you can't push anything from your computer to your phone i guess..
What bootloader do you use?
Click to expand...
Click to collapse
Obviously, before happening this issue, I was able to use adb...
And..now..if I issue adb, then nothing shows up in the list of devices attached section...I guess because it can't communicate somehow with /system/bin/sh I just accidentally deleted.
I know that I can use Odin to install CWM for Samsung phone....I just found that there is LG Flash tool program on the internet does simialr thing like Odin for LG phone..however, I am not sure where I can find the dll that I can use from LG Flash tool program.
Any idea?
Thanks,
goforandroid said:
Obviously, before happening this issue, I was able to use adb...
And..now..if I issue adb, then nothing shows up in the list of devices attached section...I guess because it can't communicate somehow with /system/bin/sh I just accidentally deleted.
I know that I can use Odin to install CWM for Samsung phone....I just found that there is LG Flash tool program on the internet does simialr thing like Odin for LG phone..however, I am not sure where I can find the dll that I can use from LG Flash tool program.
Any idea?
Thanks,
Click to expand...
Click to collapse
You will indeed have to reflash your device, as you don't have any other way of putting the bash binairy back.
I guess, as you are rooted, you know how to reflash your device. If you don't, search the forum
grtz
anotherguy19 said:
Get a copy of sh and
> adb push sh /system/bin/
But /system is read-only so you need to mount read-write. But you cannot because
> adb shell
Cannot execute sh because it is not there.
You need to restore from nandroid backup. Failimg that, restore back to stock with Odin.
Click to expand...
Click to collapse
perfect
I have a clockworkmod file in the root of sdcard. I can see it in ES File Explorer but I cannot see it when I connect the phone to my computer. I use clockworkmod recovery only by booting into it when I need to...not by flashing it.
Although it dissappears when I delete it in ES File Explorer, if I refresh the screen it is still there. Anyone know what this file is exactly and how to get rid of it for good?
I tried another app called File Manager by Gira.me. It shows this file as ...
Path: /storage/emulated/0/clockworkmod
Type: */*
Size: 0 B
Last modified: Unknown
Permissions: ---
MD5: Unknown
When I try to delete it it says "Not enough permissions". There must be some way to delete this file.
Boot cwm, adb shell, rm the file
beekay201 said:
Boot cwm, adb shell, rm the file
Click to expand...
Click to collapse
I get the same message in adb shell "permission denied". I finally got rid of this by flash booting into TWRP. The file manager included allowed me to delete the clockworkmod folder. However, there was now also a TWRP folder so I deleted that one also before rebooting the system.
Thanks for the suggestion.
xda6969 said:
I get the same message in adb shell "permission denied". I finally got rid of this by flash booting into TWRP. The file manager included allowed me to delete the clockworkmod folder. However, there was now also a TWRP folder so I deleted that one also before rebooting the system.
Thanks for the suggestion.
Click to expand...
Click to collapse
Stuff like this happens when recoveries (or anything that stores files on your SD), puts files in the wrong place. CWM is doing it because it's designed for Jellybean systems.
It's time to move on to TWRP.
Aerowinder said:
Stuff like this happens when recoveries (or anything that stores files on your SD), puts files in the wrong place. CWM is doing it because it's designed for Jellybean systems.
It's time to move on to TWRP.
Click to expand...
Click to collapse
I like TWRP better now but it did the same thing. After leaving Recovery, when I looked at the contents of the sdcard in a File Manager, I had a 0 byte folder that I couldn't delete. I was then forced to boot back into TWRP and delete from there. I wish these recoveries would clean up after themselves when you exit them.
xda6969 said:
I like TWRP better now but it did the same thing. After leaving Recovery, when I looked at the contents of the sdcard in a File Manager, I had a 0 byte folder that I couldn't delete. I was then forced to boot back into TWRP and delete from there. I wish these recoveries would clean up after themselves when you exit them.
Click to expand...
Click to collapse
There isn't anything to clean up, TWRP makes that folder because that's where it stores nandroids.
Try this in a terminal emulator:
su
restorecon -FR /data/media/0/*
Reboot into recovery to recreate TWRP folder, then see if you can delete from Android.
Aerowinder said:
There isn't anything to clean up, TWRP makes that folder because that's where it stores nandroids.
Try this in a terminal emulator:
su
restorecon -FR /data/media/0/*
Reboot into recovery to recreate TWRP folder, then see if you can delete from Android.
Click to expand...
Click to collapse
Do you need to be rooted for that? If you don't, the next time it happens I will try it but it's clean now so I will leave it as is. Can a nandroid backup be used just to restore app data? I don't flash custom recoveries, I just boot into them. I would boot into TWRP, do a Nandroid of my app data, then copy the contents of the TWRP folder to my PC. Then I could do a complete wipe of the phone, recreate the TWRP folder, put the Nandroid backup in it, install the apps and restore their data.
xda6969 said:
Do you need to be rooted for that? If you don't, the next time it happens I will try it but it's clean now so I will leave it as is. Can a nandroid backup be used just to restore app data? I don't flash custom recoveries, I just boot into them. I would boot into TWRP, do a Nandroid of my app data, then copy the contents of the TWRP folder to my PC. Then I could do a complete wipe of the phone, recreate the TWRP folder, put the Nandroid backup in it, install the apps and restore their data.
Click to expand...
Click to collapse
Yes, you need to be rooted for restorecon command (su). A lot of people had troubles like yours when they moved to Lollipop (me too). Now that the recoveries have been updated, it's no longer an issue for most. You may still need to run the command, though. I suppose if you did a full wipe in stock recovery, it would fix the problem.
Your question about restoring app data with nandroid is vague and could be answered in a few ways. With your issue, the data partition is actually where the problem is, so I wouldn't recommend restoring the partition.
Instead, you might use Titanium Backup or something similar to back up only app data. But you need root for that.
Easiest solution is to root, fix issue, then, if you really want to, unroot. Don't need to wipe anything.