Can't move TWRP backup files to PC - Nexus 4 Q&A, Help & Troubleshooting

So, before I do a firmware update (In this case 4.2.2 to 4.3 OTA) I do a Titanium backup and a TWRP backup and copy both sets of backup files to my PC; it obviously makes no sense to only have backups on the device you are backing up. I upgraded to TWRP 2.6.0.0, did a full backup, and as usual I went to copy my backup files over to my Windows 7 computer using Windows Explorer and I can only get a couple of the files to move over. No warning, no error, no nuttin. This has always worked before......Did something change, and if so, how do I fix it?

I see from another post that TWRP changed the permissions of the backup files in the latest version of the program, and in my case the location as well. The workaround is to a) change the permissions on all those backup files, which I could see the nightmare problems that could cause later on when doing a restore and/or the security issues or b) doing an adb pull.

SOLVED.
The adb pull did the trick. All files were transferred over to my PC.
I had several issues getting adb to work:
1) I had an old version of the SDK installed on my PC which was causing a devices not recognized problem or something similar.
2) I didn't notice the message about verifying the RSA on my phone, which once verified, fixed the phone "offline" problem.
3) The screen lock on my phone was coming on after its timeout and locking me out from seeing the phone.

reverted to twrp 2.5.0.0
Same problem here with Google Nexus i9250 / twrp 2.6.0.0 / win7 64bit. Tried to copy backup of (BOOT/SYSTEM/DATA) via MTP or ftp from Nexus to PC. Only the first two files (boot.emmc.win/-md5) were copied. After downgrading to twrp 2.5.0.0 everthing was fine.

I had the same problem. It is caused by strange suid permissions set by TWRP. Solved it using chmod 0664 /data/media/0/TWRP/... (as root)
I was not able to adb pull before changing the files' permissions.
More details here:
http://forum.xda-developers.com/showpost.php?p=44120545&postcount=14
(Google found that HTC One thread first, so I didn't search any further)

Type this in Terminal Emulator:
su
busybox chown - R 1023.1023 /data/media/*
That should solve all permissions problems.

I had no trouble at all by doing the following:
Access the sdcard from /data/media/0
Copy data.ext4.win and system.ext4.win to a temporary location.
(The "Set UID" and "Set GID" permissions were automatically removed. If not, you can change them from here.)
Copy the files to PC using MTP.
The remaining backup files from the TWRP directory can be copied normally.
Done
Note: You can instead just change the permissions on these two files inside the TWRP directory, but I did the temporary location copy just to be safe.

Mercado_Negro said:
Type this in Terminal Emulator:
su
busybox chown - R 1013.1023 /data/media/*
That should solve all permissions problems.
Click to expand...
Click to collapse
coming up with chown: unknown user -
is that a space between 1023 and /data?

daryllh said:
coming up with chown: unknown user -
is that a space between 1023 and /data?
Click to expand...
Click to collapse
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023

Mercado_Negro said:
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Click to expand...
Click to collapse
After I did this command, my pc can't detect the back up

handols said:
After I did this command, my pc can't detect the back up
Click to expand...
Click to collapse
Did you plug/unplug your device after running this command? There shouldn't be any problems. Furthermore, now you should be able to copy your TWRP and TiBu backups successfully to your computer. It's a pretty straight forward process.

Im on twrp 2.5.0.0 with Android 4.3. I cant copy the BACKUP folder directly to my PC with the default windows explorer because the backup isnt stored in /sdcard/TWRP. How can I fix this? I used to be able to do this without adb push/pull...

Mercado_Negro said:
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Click to expand...
Click to collapse
Thanks for this. I'm able to backup TWRP folder to PC now :highfive:

Since my original post 3 months ago I updated all my programs to 4.3 friendly versions as each was released (superuser 1.0.2.1, Windows drivers, TWRP 2.6.3.0, etc.) and now I don't need to do adb pulls any more and I can just copy and paste files from my phone to my pc and all files are copied over without missing any of them. Now I see the updated programs are already starting to show up for Android 4.4; here we go again.

Now see 0 / legacy emulated
Mercado_Negro said:
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Click to expand...
Click to collapse
Hi just wondering, Is there a way to cancel this command (just add a +R maybe) I did it on my phone and I think it may be the cause that I have a Legacy emulated 0 path problem Ive searched around and cant seem to find a solution. Thanks

NightCrawler504 said:
Hi just wondering, Is there a way to cancel this command (just add a +R maybe) I did it on my phone and I think it may be the cause that I have a Legacy emulated 0 path problem Ive searched around and cant seem to find a solution. Thanks
Click to expand...
Click to collapse
What's the problem? That's a valid path.

Legacy emulated 0
Mercado_Negro said:
What's the problem? That's a valid path.
Click to expand...
Click to collapse
I have an external sd (sdcard1) = /storage/sdcard1 so gr8 but then I have emulated (??) Storage/emulated/legacy and Storage/emulated/0 and sdcard0 storage/sdcard0 they were complety different folders been reading around seems to be a problem with cm when I go from 4.2 and over my phone is a e970 att, cant delete the emulated folder... already erased all my data previously, any help will do,I'm almost sure it had nothing to do with the chown command but had to give a try.

NightCrawler504 said:
I have an external sd (sdcard1) = /storage/sdcard1 so gr8 but then I have emulated (??) Storage/emulated/legacy and Storage/emulated/0 and sdcard0 storage/sdcard0 they were complety different folders been reading around seems to be a problem with cm when I go from 4.2 and over my phone is a e970 att, cant delete the emulated folder... already erased all my data previously, any help will do,I'm almost sure it had nothing to do with the chown command but had to give a try.
Click to expand...
Click to collapse
No, it doesn't have anything to do with this command since it's just a way to set different permissions.

Related

Get Apk file from Market

When i download and install an App from the Android Market where the Apk installation file is temporary placed? Which path?
tnx in advance
the apk's are stored at /data/app and /data/app-private after you installed the app and will be removed if you uninstall it.
Tnx for the answer mopodo, but if i hard reset the device, can i will use theese files to reinstall them?
i'm sorry for my bad english...
sidvizioso said:
Tnx for the answer mopodo, but if i hard reset the device, can i will use theese files to reinstall them?
i'm sorry for my bad english...
Click to expand...
Click to collapse
No, you can make a backup to your SD card with apps like MyBackup or Backup For Root Users.
So which is the temp path of the downloaded apk from market?
i want to grab them...
Pinesal said:
No, you can make a backup to your SD card with apps like MyBackup or Backup For Root Users.
Click to expand...
Click to collapse
of course you can.
you just have to copy them to your sdcard or pc an install them again, with «adb install something.apk» or «Astro File Manager» (or a similar file managerapp)
a hard reset will delete everything on «/data»
If you have root copy the contents of both folders to your SD card.
mkdir /sdcard/apps
cp /data/app/* /sdcard/apps
cp /data/app-private/* /sdcard/apps
Then after you wipe (I've never heard anyone call it a 'hard reset' before) you can use an app like Astore or ApkInstaller to reinstall them.
If you don't have root then not only will you not be able to read app-private, but your ROM wont have busybox so you wont be able to bash in those commands. In that case use an app like Astro or AppManager to copy non-private apks to the sdcard, but for private apps you'll have to redownload them (without being charged of course.)
Pinesal said:
No, you can make a backup to your SD card with apps like MyBackup or Backup For Root Users.
Click to expand...
Click to collapse
Only if they're non-private (reside in /app, private being /app-private).
He's probably coming from WinMo. We called a factory reset/wipe a hard reset.
mopodo said:
the apk's are stored at /data/app and /data/app-private after you installed the app and will be removed if you uninstall it.
Click to expand...
Click to collapse
Slightly off topic lol But i see you said Private does that mean you could manually back up Private apps you buy off market by just copying them /w root access?
When I run the following from an adb shell, with or without SU root:
cp /data/app/* <my location on sd>
I always get:
cp: permission denied
In fact, no matter how or where I cp from or to, and no matter what I am trying to copy, even if I leave all arguments blank, I still get "cp: permission denied" -- I have busybox installed in /system/xbin from /data/local and as far as I can tell it installed ok. Phone is a rooted Sprint hero 1.56.651.2 running stock ROM.
I have also tried to 'adb pull /data/app' and it always find 0 files. None of this is a big deal for me, however, as I am just trying to backup a bunch of apks for free apps in case versions change too much. Mostly just curious...
Any ideas?
EDIT: Both Astro and AppManager handled the (non-private) apk backups fine -- so I have no real need for the cp method to work, but I am still wondering why it will not -- is it the adb shell? must I use a terminal emulator from on the phone instead? something else? Anyways, if I really want to pursue it, perhaps I should take it to a busybox thread at this point...
EDIT2: It appears as if the 'cp' command as I was running it wasn't getting passed through busybox (not sure why). From what I can piece together reading other threads, it seems that if you have installed busybox on top of a ROM that doesn't already have it (like stock, after rooting and recovery setup) than you must prefix commands with 'busybox' when entered, as in 'busybox cp /data/app/* <my location>' and it does work for me that way. Still cannot seem to copy /data/app-private which I thought having root access would allow -- I guess I just don't understand nearly enough about busybox implementation, linux permissions, and, well, linux in general.
You could try an app manager and back 'em up from there.
Just try the following command.
busybox cp /data/app/* /sdcard/<your backup loc>
askwhy said:
When I run the following from an adb shell, with or without SU root:
cp /data/app/* <my location on sd>
I always get:
cp: permission denied
In fact, no matter how or where I cp from or to, and no matter what I am trying to copy, even if I leave all arguments blank, I still get "cp: permission denied" -- I have busybox installed in /system/xbin from /data/local and as far as I can tell it installed ok. Phone is a rooted Sprint hero 1.56.651.2 running stock ROM.
I have also tried to 'adb pull /data/app' and it always find 0 files. None of this is a big deal for me, however, as I am just trying to backup a bunch of apks for free apps in case versions change too much. Mostly just curious...
Any ideas?
EDIT: Both Astro and AppManager handled the (non-private) apk backups fine -- so I have no real need for the cp method to work, but I am still wondering why it will not -- is it the adb shell? must I use a terminal emulator from on the phone instead? something else? Anyways, if I really want to pursue it, perhaps I should take it to a busybox thread at this point...
EDIT2: It appears as if the 'cp' command as I was running it wasn't getting passed through busybox (not sure why). From what I can piece together reading other threads, it seems that if you have installed busybox on top of a ROM that doesn't already have it (like stock, after rooting and recovery setup) than you must prefix commands with 'busybox' when entered, as in 'busybox cp /data/app/* <my location>' and it does work for me that way. Still cannot seem to copy /data/app-private which I thought having root access would allow -- I guess I just don't understand nearly enough about busybox implementation, linux permissions, and, well, linux in general.
Click to expand...
Click to collapse
Well in windows
'adb pull' is used if that helps

[Q] Honeycomb Keyboard

I'm kinda new to android
I've started to delete useless apps through Titanium Backup(acer staff,games etc) , and exidently deleted smth connected with honeycomb stock keyboard.
Now every time when i want to use stock keyboard, pops up a messege "The application Android keyboard (process com.google.android.inputmethod.latin) has stopped unexpectedly. plz try again".
Ive tryied to reset factory data but it wont helped. Is thera any solution for this problem? if there no, plz tell how to completely reset tablet) ive read "system Images " thread but i didn understand some things
here is my recover steps: (for a500 which is bricked)
for a500 is normal:
root it
put the system.img into a500
connect to the computer with adb and follow the codes:
su
dd if=/sdcard/system.img of=/dev/block/mmcblk0p3
then reboot
Click to expand...
Click to collapse
connect to the computer with adb and follow the codes:
su
dd if=/sdcard/system.img of=/dev/block/mmcblk0p3
what that means)
You might very well have ruined your tablet.
I'm not a developer or coder so I can't make any sense of the code you posted but if a reset didn't fix it then you've certainly deleted something important. Hopefully someone has some ideas.
If not, then maybe you can return it? And next time, don't delete something unless you know what it is you're deleting.
ok ive recovered from image, but now wifi is not working , what should i do?
There are posts about having to change file permissions to fix wifi. Search this forum, there are a few.
edit - linked post
http://forum.xda-developers.com/showthread.php?t=1074449&highlight=wifi+permission
yeah ive read this but i dont know how to move that files to system folder on devide, wifi is down , so i cant download any file managing apps from market and theres no any file managers on stock Rom
If you've got the adb working, you can use the command mv to move the file.
I'm not sure of the exact path involved, but for example. the file is in /mnt/sdcard/filetobemoved and needs to go into /sytem/lib/modules
mv /mnt/sdcard/filetobemoved /system/lib/modules
That'd put it in the location you need. To change the permissions, you'd use the command chmod
chmod 655 /system/lib/modules/filetobemoved
The 655 is an octal(0-7) representation of the file's permissions. I'm not sure what permissions it needs, but you could try 655 as a start unless someone else knows for sure.
if you want, hit me up on msn, I can try to walk you through it: [email protected]
Glebaka said:
ok ive recovered from image, but now wifi is not working , what should i do?
Click to expand...
Click to collapse
Ah *phew* Good to hear.
gammaRascal said:
Ah *phew* Good to hear.
Click to expand...
Click to collapse
lol How'd he get in that shape to begin with? Any idea what exactly it was he deleted that bonked his system?
muqali said:
lol How'd he get in that shape to begin with? Any idea what exactly it was he deleted that bonked his system?
Click to expand...
Click to collapse
No clue. I really should start reading up on HC app development and at least familiarize myself with that environment.
I haven't rooted yet cause I'm e'scarded to.
ahh i cant replace that files , somehow installed astro manager(through docsttogo) but i cant remove/replace/rename that files in system/lib/modules it says i dont have permission to do this.
tryed in connectbot type "mv /mnt/sdcard/filetobemoved /system/lib/modules"
got this "failed on '/system/lib/modules/filename' - cross-device link"
im rooted what if
Glebaka said:
ahh i cant replace that files , somehow installed astro manager(through docsttogo) but i cant remove/replace/rename that files in system/lib/modules i dont have permission to do this.
tried connectbot tryied "mv /mnt/sdcard/filetobemoved /system/lib/modules"
got this "failed on '/system/lib/modules/filename' - cross-device link"
im rooted
Click to expand...
Click to collapse
type mount and paste/retype the line that has /system in it. It might be mounted read only.
or try the cp command in place of mv
edit - also, the filetobemoved is just an example. I think one of the filenames is bcm4329.ko but I'm not sure. so /system/lib/modules/bcm4329.ko would be the full path
ah im total noob tried cp instead of mv it said permission denied .
t
ype mount and paste/retype the line that has /system in it. It might be mounted read only.
Click to expand...
Click to collapse
i didnt get that (
edit - also, the filetobemoved is just an example. I think one of the filenames is bcm4329.ko but I'm not sure. so /system/lib/modules/bcm4329.ko would be the full path
Click to expand...
Click to collapse
yeah thats i know)
Are you logged into the tablet using adb's shell? I've only used that once on a different tablet, but iirc the commands are standard Unix/Linux commands. Someone correct me if I'm wrong but aren't you already logged in as superuser like this? You don't need to 'sudo' or 'su' to switch over do you?
I'm not familiar enough with this specific environment to figure out what might be keeping you from placing those files in that location. The command to check the partitions mount options is
mount
It should return a bunch of text, one line of which is gonna be the /system partition. If it's ro(read only) then you can't write to it and would need to remount it.
yeah it looks like it is "ro"
ive got /system ext4 ro
how to remount)
My knowledge of adb is limited as well. All I know is that I can connect to it, type: adb devices (in the command prompt) to make sure it sees my tab then 'adb push filename.extension /directory/structure' to force files... Conversly, I think adb pull filename.extension /directory/structure will grab files on the tab if you know what they are called and where they are located.
Glebaka said:
yeah it looks like it is "ro"
ive got /system ext4 ro
how to remount)
Click to expand...
Click to collapse
what was the /dev/block/mtdblock for /system?
there is a number after it...for example /dev/block/mtdblock1
mount -o rw,remount -t ext4 /dev/block/mtdblock1 /system
would remount it read/write, provided that it is mtdblock1, change the number depending on what your device has.
yeah now /system have "rw", but it anyway refuses to copy using mv(failed on '/system/lib/modules/filename' - cross-device link"
) or astro manager
Glebaka said:
yeah now /system have "rw", but it anyway refuses to copy using mv(failed on '/system/lib/modules/filename' - cross-device link"
) or astro manager
Click to expand...
Click to collapse
If cp won't put it there either, I'm out of ideas. Maybe ask in the other thread how they were able to copy/move the file and set the permissions?
I know it may not be really classy, but how about downloading an .apk That will let you mount the drive, to an sd card in a computer then transfer that to the Acer. (If it's an extreme case and nothing else will work..not condoning piracy, but don't know what would work...)
or is it possible to copy the system data from a Titanium backup and send it over so he can restore the missing files?
This following step I can't be responsible for it's safety. It looks safe to my eyes, but proceed having been forewarned. I did some research and you might be able to use dd to get the file there.
dd if=/mnt/sdcard/filname of=/system/lib/modules/filename

[Q] can't preserve ownership... ADB Error

Hey folks,
just a quick question. I tried to backup my /efs folder with ADB since I am planning to mess around a little. I have my phone rooted, latest busybox installed and usb debugging enabled. I succesfully connected the device and granted SU permissions. Then I typed
busybox cp -a /efs /sdcard/
as stated in the guides. However it tells me the following error for all files in the efs directory and doesn't copy one file:
cp: can't preserve ownership of '/sdcard/efs/.android': Operation not permitted
Any ideas on what I am doing wrong?
That's true, you can't preserve that kind of ownership when moving stuff to sd. Just change the -a to -r and you'll be fine. You'll just have to redefine the ownerships if you ever copy the files back, to what they are now.
Sent from my GT-I9000 using Tapatalk
Well thanks, that did the trick! However, someone should then change that in the guides for us Newbies. Besides that I might need to get back to you for redefining the ownerships of the /efs folder once I need to restore it ;-)

[Q] any senior/pro devs:How to gain privilege to pull /data with Debug Bridge?

hi, developers!
it's so urgent if anyone knows how to do this please instruct me, infinitive thanks here in the first place!
i need to pull the directory of /data out to my PC,i'm rooted and able to use adb for this only,
first i use the command line
---------------------------------
adb pull /data(enter)
---------------------------------
The result is
---------------------------------
0 files pulled ,0 files skipped..
---------------------------------
then i tried the following command line
---------------------------------
adb shell(enter)
su(enter)
cd data(enter)
cd data(enter)
ll(enter)
---------------------------------
ok,it's not empty! everything I need is here,and ACCESSIBLE...for sure!
then i exited the adb shell mode and pulled again, but pulled nothing...
alright i went back to adb shell mode with su and tried
---------------------------------
chmod 777 /data(enter *no sign to show if this worked)
---------------------------------
then do the same pulling thing but again, didn't make any sense.
i also tried "cp" the files in /data i need, but only to find they're copied to local storage rather than my PC.
NOW COMES THE QUESTION:
is there any way i can directly gain privilege to pull files from /data,
or is there another way to backup /data to PC?
THE SITUATION IS
i've got a boot up problem, just can't pass through the bootanimation, before I reflash the pad, i'll need to retrieve crucial agenda notes and memo lest they're wiped.
but the recovery backup function failed to back up userdata...(/data)
Just a hunch, but can you (using adb shell and SU) cp /data to /mnt/external_sd, then pull it from there or use a card reader?
stuck
p_025 said:
Just a hunch, but can you (using adb shell and SU) cp /data to /mnt/external_sd, then pull it from there or use a card reader?
Click to expand...
Click to collapse
thank you pal! i've tried such thing as you remind me of but totally, /data is omitted! while i use "cp", for another thing, while i was trying to "cp" another folder to extern sd, it read read-only file system. so it goes all the way back to the PERMISSION thing, or i need to gain privilege to modify the property of /data so that i can pull what i need out of this nightmare...and should modify /external sd also if using "cp".
kept waiting, please help:crying:..any constructive instructions shall be greatly appreciated!!
yours truly cordially!!
can u actually use adb without access to the os??
what rom and BL were u on?
seems strange u need permissions for /data - have u tried mounting it?
from memory data resides at mmcblk0p8 u might be able to dd that 2 ur ext SD or Google to search dev forum
I'm know dev just throwing stuff o.to.tje
mix...
Sent from my GT-I9300 using Tapatalk 2

lost all permissions after messing with platform.xml

Hello,
I have SM-N9005 variant and recently I updated to the latest android 4.4.2 leaked version with Odin, and then rooted with CF-Auto-Root.
After that, I lost the permission to write to external sdcard.
I searched and found this: http://forum.xda-developers.com/showthread.php?p=49603814
I backed up /system/etc/permissions/platform.xml and then I followed the instructions there.
After restart, a lot of app stopping messages showed and I had no access to file system or network anymore.
I used adb shell to restore the original platform.xml but it didn't helped in any way.
It seems that all mounts and networks are working, but none of the applications has permission to use any of them.
How do I resolve this, without wiping all my data?
Thank you!
You need to set the correct permissions on the .xml after you overwrite it back into the /system Off the top of my head I can't think what they are (just out of bed and got to work so still sleepy!)
radicalisto said:
You need to set the correct permissions on the .xml after you overwrite it back into the /system Off the top of my head I can't think what they are (just out of bed and got to work so still sleepy!)
Click to expand...
Click to collapse
I tried 644 and 777 but the problem persists.
rw-r-r which is 644 - read wrong
or chmod 666 -- forgive my lack of memory, it has been a long time since I have used chmod commands, few years since my glFTPD / site modding days.
radicalisto said:
rw-r-r which is 644 - read wrong
or chmod 666 -- forgive my lack of memory, it has been a long time since I have used chmod commands, few years since my glFTPD / site modding days.
Click to expand...
Click to collapse
The problem still persist
DxCK said:
The problem still persist
Click to expand...
Click to collapse
i dont know if it helps in your situation but did you try the "fix permissions" from a custom recovery like twrp?
there are also scripts you can execute in a terminal, the knoxout script linked in my sig for example has a permission fixer included.
A.N.Droid said:
i dont know if it helps in your situation but did you try the "fix permissions" from a custom recovery like twrp?
there are also scripts you can execute in a terminal, the knoxout script linked in my sig for example has a permission fixer included.
Click to expand...
Click to collapse
Thank you.
When i run this, no matter what are the parameters, for example: sh kn0x0ut.sh kn0x0ut
it says:
ERROR: Unknown parameter ""
Removing all temp folder /data/media/kn0x0ut_temp...
DxCK said:
Thank you.
When i run this, no matter what are the parameters, for example: sh kn0x0ut.sh kn0x0ut
it says:
ERROR: Unknown parameter ""
Removing all temp folder /data/media/kn0x0ut_temp...
Click to expand...
Click to collapse
just type sh kn0x0ut.sh to get all commands.
if you dont get this working, you can do it from twrp (i think cwm too)if you have it.
tap on "advanced" and then on "fix permissions".

Categories

Resources