ADB help - how to push an entire directory? - Samsung Galaxy Nexus

Alright. I need help with this and Google can't help me. I need to recursively (i.e. all of the content in the directory) move an entire folder from Windows to my internal sd-card but no matter what I do, I just can't get it to work.
I now there's a way, somehow.
EDIT: Pitch-in: The sd-card is mounted as /mnt/sdcard/ right?

what about just zipping it? i dont think adb can do that easily

Lets say you have a folder called Wallpapers on your PC use the code below (assumes you copied Wallpapers folder to android-sdk\platform-tools):
Code:
adb push Wallpapers /sdcard/Wallpapers/
If you don't specify the destination folder (Wallpapers) on the sdcard then it will place the contents of the folder on your sdcard. No need for mnt in the destination.
Edit: unsure of how this will behave with subdirectories within the folder you're trying to push. You might have to push each subdirectory separately.

CMNein said:
Lets say you have a folder called Wallpapers on your PC use the code below (assumes you copied Wallpapers folder to android-sdk\platform-tools):
Code:
adb push Wallpapers /sdcard/Wallpapers/
If you don't specify the destination folder (Wallpapers) on the sdcard then it will place the contents of the folder on your sdcard. No need for mnt in the destination.
Edit: unsure of how this will behave with subdirectories within the folder you're trying to push. You might have to push each subdirectory separately.
Click to expand...
Click to collapse
Working for me as I type. I don't know about the sub-directories as I just put everything into one folder and will move them to their new home once they finish transferring. Up until now, I've been moving everything individually. I didn't know you could move folders so this is awesome. Save me a lot of typing lol.

gurusportscanada said:
Working for me as I type. I don't know about the sub-directories as I just put everything into one folder and will move them to their new home once they finish transferring. Up until now, I've been moving everything individually. I didn't know you could move folders so this is awesome. Save me a lot of typing lol.
Click to expand...
Click to collapse
a thanks is enough, no need to necrobump a thread over a YEAR old, just to say it works.

I honestly just zip the file with all directories on my computer than adb it over. Extract with root explorer and move then delete zip file. Easy and simple
Sent from my Nexus 7 using Tapatalk 2

/me bashes his head against the wall.

beekay201 said:
/me bashes his head against the wall.
Click to expand...
Click to collapse
when you do a folder you also do all it's sub folders

patalo said:
I honestly just zip the file with all directories on my computer than adb it over. Extract with root explorer and move then delete zip file. Easy and simple
Sent from my Nexus 7 using Tapatalk 2
Click to expand...
Click to collapse
Im stupid.... This is best idea lol, and so obvious...

Related

Where to Put Files after Root

So I have successfully rooted my EVO with the Simple OTA Root and I know how to install APK's now but where would I put my music? Or where would I put these .ogg files I have from a Droid X. Last Where do I put Ringtones?
Do I just make a folder called music? etc..any help would be greatly appreciated
Globetrahter said:
So I have successfully rooted my EVO with the Simple OTA Root and I know how to install APK's now but where would I put my music? Or where would I put these .ogg files I have from a Droid X. Last Where do I put Ringtones?
Do I just make a folder called music? etc..any help would be greatly appreciated
Click to expand...
Click to collapse
If you mount your card, you'll see that there is a folder called: /Music -- this where you music will go.
For your ringtones; you'll place them inside: /system/media/audio/ringtones
In regards to the Droid X .ogg file -- if that's for the bootanimation; then that file needs to be placed in /system/customize/resource and it will have to be ranamed to: SPC_animation_final.mp3, before you copy it over to that directory.
Thanks very Much
Ok, so may sound ehh.. but How do you mount the microsd, I have it in disk drive mode right now
Thanks again
Globetrahter said:
Ok, so may sound ehh.. but How do you mount the microsd, I have it in disk drive mode right now
Thanks again
Click to expand...
Click to collapse
Disk drive mode = mounting. When you connect your phone to your computer -- your phone to should you with options, choose Disk Drive.
Ok cool, I had to add the Music Folder since I did the root and didnt have any music on there, but Im looking at my folder and I dont see a systems folder and I have my computer set to show hidden files and folders
so I dont see /System
I do have a folder called /media/audio
and there is a notifications folder in there and in there is a facebook_ringtone_pop.m4a
Globetrahter said:
Ok cool, I had to add the Music Folder since I did the root and didnt have any music on there, but Im looking at my folder and I dont see a systems folder and I have my computer set to show hidden files and folders
so I dont see /System
I do have a folder called /media/audio
and there is a notifications folder in there and in there is a facebook_ringtone_pop.m4a
Click to expand...
Click to collapse
The /systems folder won't be on your sdcard, but rather on the phone itself.
You need to open shell/cmd and run:
Code:
adb remount
adb shell
cd /system/media/audio
ls -- You'll see the ringtones folder once you issue this command
Now that you know where the ringtones folder is, can you just adb push the ringtones you want to that folder.
To do this:
1. Put whatever ringtone you want into your AndroidSDK\tools folder first!
2. Open shell/cmd
3. Run following command(s):
Code:
adb push name-of-ringtone.mp3 /system/media/audio/ringtones
Repeat that command if you have more than one ringtone. After you've done that -- you'll need to reboot your phone and when you go to select a ringtone, your's should up.

Can't delete folder?

How the hell can i delete a folder that can't be seen via PC connection but i can see it using es file explorer?
I can't delete it using ES even with root enabled....
zerozoneice said:
How the hell can i delete a folder that can't be seen via PC connection but i can see it using es file explorer?
I can't delete it using ES even with root enabled....
Click to expand...
Click to collapse
Depending on where it is you need to mount it first. Which folder are you trying to delete?
Sent from my Galaxy Nexus
I had a folder that became corrupted (repeatedly interrupted game data downloads, I think). I was unable to delete it (even as root) and received an Access Denied error. I was able to rename the folder (so it wouldn't conflict anymore) and delete the majority of its contents (still received the Access Denied error on a file or two). I eventually had to do a full wipe via fastboot -w to get rid of the corrupted files.
had the same problem. had to reflash su.zip and it worked. can't explain it though. just reaching at straws
matt30 said:
Depending on where it is you need to mount it first. Which folder are you trying to delete?
Sent from my Galaxy Nexus
Click to expand...
Click to collapse
it's the folder created by the Photaf application.
i uninstalled the app and the folder is still there...permissions are writable, not hidden...
i can rename it, but can't delete it....and the subfolder within it as well...
i remember it happened once before and the only way to get rid of it was to reinstall the ROM (AOKP). Once installed, i could delete the folder.....
Try reinstalling the game and using settings/application/name of game clear data
Sent from my Galaxy Nexus
bwcorvus said:
Try reinstalling the game and using settings/application/name of game clear data
Sent from my Galaxy Nexus
Click to expand...
Click to collapse
no effect, still can't be removed
LE: WTF, i just plugged in the phone into USB for charging and i saw the folder?! It deleted just fine?
Damn weird didn't do anything different than yesterday when i couldn't even see the folder via PC...
Thank you!
My Asus Transformer (TF101) hasn't been able to download anything to the Download folder for months now. Even Opera (which I installed just to try and fix this) could only download to a different folder. I did what you said, plugged it into the computer and first renamed the folder with ADB but couldn't create a new Download folder. "File already exists." Lies. Windows Explorer said it was still there as Download so I deleted it in Explorer and created a new folder named Download. The create failed but Android said it was there and Voila! I can download again. Very weird, but not ready yet to reformat in fastboot. Thanks guys!
If you're rooted you may be able to delete the files from /data/media, which is the true location, instead of the visual SD that you are seeing.
Could also be a file ownership issue.
Using a terminal emulator, use the following command to list ownership and permissions:
ls -l
(Lower case letter L, not i or 1)
Most of the files and folders should show up as media_rw, but the problematic ones may show up as numbers. To fix them, boot into CWM recovery, plug in the USB cable, go into adb shell. Also make sure that /data is mounted in the CWM mounts menu. Then:
cd /data/media
chown -R media_rw.media_rw *

[Q] Copy large backup directory to PC

Hi guys,
I am trying to figure out a way to copy clockworkmod directory to my PC, as the backups are taking up too much unncessary space on the phone. The problem is that via MTP Windows Explorer simply hangs and doesn't copy a thing. My guess is that the underlying issue is the huge number of very small files in the /blob sub-directory.
Could anyone guide me how to accomplish this task, please? Or, alternatively, what other methods of backing straight to the PC are there?
Much obliged!
zkvvoob said:
Hi guys,
I am trying to figure out a way to copy clockworkmod directory to my PC, as the backups are taking up too much unncessary space on the phone. The problem is that via MTP Windows Explorer simply hangs and doesn't copy a thing. My guess is that the underlying issue is the huge number of very small files in the /blob sub-directory.
Could anyone guide me how to accomplish this task, please?
Much obliged!
Click to expand...
Click to collapse
MTP sucks. I prefer to use adb for this: adb pull /sdcard/clockworkmod D:\your\path\here
If you don't want to use the commandline, you can alternatively use an app like ES File Explorer to access a LAN share (shared folder/drive on your computer) and copy files this way.
adb pull?
Any time I transfer anything large it's what I use.
Code:
adb pull /sdcard/clockworkmod/ /Backup/
I believe that's the directory.
Just rename the "clockworkmod" folder to whatever it truly is if not.
This will put a "Backup" folder on your C:\ drive.
Edit:
Ninja'd.
Thank you very much, guys! I hadn't realised that adb pull could be used for copying a whole directory.
Reverse of this
Can anyone tell me how to reverse this using adb (i.e. move the directory back onto the phone)? Thanks.
grouseuk said:
Can anyone tell me how to reverse this using adb (i.e. move the directory back onto the phone)? Thanks.
Click to expand...
Click to collapse
[GUIDE] How-to copy files from/to your device
from Petrovski's sig
Thanks for the help with ADB pull. I knew about the push command, but being the noob I am I would never have thought that the opposite was that simple.
Now I have a GNex and I'm almost out of internal memory. I've copied my entire clockworkmod folder to my PC. I was wondering if I could delete the contents of the clockworkmod folder off of my phone (since it's all on the PC) to regain some storage space, and then only return the deleted contents to the phone when I need to do a nandroid restore without any problems occurring. I wouldn't want to go do all that only to arrive upon a large problem when I try to go back to stock JB JRO03C or anything like that.
kbolt said:
Thanks for the help with ADB pull. I knew about the push command, but being the noob I am I would never have thought that the opposite was that simple.
Now I have a GNex and I'm almost out of internal memory. I've copied my entire clockworkmod folder to my PC. I was wondering if I could delete the contents of the clockworkmod folder off of my phone (since it's all on the PC) to regain some storage space, and then only return the deleted contents to the phone when I need to do a nandroid restore without any problems occurring. I wouldn't want to go do all that only to arrive upon a large problem when I try to go back to stock JB JRO03C or anything like that.
Click to expand...
Click to collapse
I want to know this exact answer as well.
if you dont rename the folders, you wont have a problem.
I've found that the GNex toolkit makes it pretty easy to make backups, move them to your PC and restore plus a whole lot more. It's pretty good.
http://forum.xda-developers.com/showthread.php?t=1392310
+1 for adb
Large File Tip
THANK YOU!!
Jubakuba said:
adb pull?
Any time I transfer anything large it's what I use.
Code:
adb pull /sdcard/clockworkmod/ /Backup/
I believe that's the directory.
Just rename the "clockworkmod" folder to whatever it truly is if not.
This will put a "Backup" folder on your C:\ drive.
Edit:
Ninja'd.
Click to expand...
Click to collapse
Unable to see clockworkmod folder through file explorer
HI All,
Am not able to see the clockworkmod folder through File Explorer. Whereas after i take a backup through recovery, i can see the backup exists in /sdcard/clockworkmod/backup.
Please help.
Hi All,
Can anyone help with the above issue?
Use adb pull or an ftp server running on your device.
Sent from my Galaxy Nexus using Tapatalk 2

[Q] How do I fix file permissions on SD card?

OK, I finally installed PA 2.99 beta6 which I've wanted to do for a while. First to preserve the file structure and not have /0 folders, I copied all my old SD card files to /data/media as told in the guide linked below. I'm thinking my issue started when I didn't delete the /0 folder after installing the stock 4.2.1, but now all my old SD card files have incorrect permissions for me to access them. Is there a quick and easy way to fix it, preferably from the phone? I'm gonna wipe and reinstall everything tomorrow if necessary, but I can't do it until tomorrow morning. I'm not even sure what permissions I should set to make the files accessible again. I think I may have screwed up by not setting permissions when copying files using the toolkit also. I'm still pretty noobish and I thought that was only necessary for system files. I thought the correct permissions would follow everything else. I did find that I can take a song that's in the /data/media/music file, which won't play, move it to /sdcard/music, and it plays. I tried changing permissions and owners on the non-working files to match the working files, but no luck.
I really appreciate any advice or help anybody has.
http://forum.xda-developers.com/showthread.php?t=1999214
Ok, so you have moved all your content, in the new media folder, but I read you can't read any media from that folder. I guess that it s completely normal, as I would have only put backups to be used in this precise folder. Correct me anybody if I'm wrong, but music should be pasted in the new music folder, and so on and so on, for each media. In the first place, those files were not all put in the data/media folder right ?
So, why not try and use a file explorer, and move the content in their respective appropriate new folder, and see how it works. And that done delete the initial folders. Hope it will work.
Aur3L said:
Ok, so you have moved all your content, in the new media folder, but I read you can't read any media from that folder. I guess that it s completely normal, as I would have only put backups to be used in this precise folder. Correct me anybody if I'm wrong, but music should be pasted in the new music folder, and so on and so on, for each media. In the first place, those files were not all put in the data/media folder right ?
So, why not try and use a file explorer, and move the content in their respective appropriate new folder, and see how it works. And that done delete the initial folders. Hope it will work.
Click to expand...
Click to collapse
According to the guide to keep the pre-4.2 file structure, with no /0 folders, you're supposed to ADB push all sd card files to the /data/media folder. Now I think what I screwed up on is I was supposed to delete any /0 folders but I misread the guide and didn't delete the folder. Now all of the data I pushed to the phone is in it's respective folders under data/media, such as Music and Downloads, but there is also a /data/media/0 folder with standard android folders. There is also /sdcard, with standard android folders. From my understanding, either data/media and /sdcard or /data/media/0 and /sdcard should show the same files, but neither does. If I make a change in one directory it doesn't show in the other directory. The weird part to me is that when I copy and paste a file from /data/media/Music (or any other directory there) to /sdcard, the file permissions and owners and groups of the file will change, and then I can access the file in the /sdcard directory. But if I try to apply the exact same permissions and owner and group to the file under /data/media it will still not give me access. On Root Explorer, looking at properties of a file in /data/media, the md5sum shows Access Denied, but works on /sdcard. I'm thinking it has something to do with the /data/media folder's permissions instead of the files/folders under it, but I'm kinda afraid to mess with it. When I get home in the morning I'm gonna try dumping EVERYTHING and start again, but I would love to be able to fix it first.
Will I see any problems if I just copy all the files from /data/media to /sdcard, where I'm sure I can use them? Also, why doesn't /data/media or /data/media/0 show the same files as /sdcard?
Thanks for any help!
02ranger said:
According to the guide to keep the pre-4.2 file structure, with no /0 folders, you're supposed to ADB push all sd card files to the /data/media folder. Now I think what I screwed up on is I was supposed to delete any /0 folders but I misread the guide and didn't delete the folder. Now all of the data I pushed to the phone is in it's respective folders under data/media, such as Music and Downloads, but there is also a /data/media/0 folder with standard android folders. There is also /sdcard, with standard android folders. From my understanding, either data/media and /sdcard or /data/media/0 and /sdcard should show the same files, but neither does. If I make a change in one directory it doesn't show in the other directory. The weird part to me is that when I copy and paste a file from /data/media/Music (or any other directory there) to /sdcard, the file permissions and owners and groups of the file will change, and then I can access the file in the /sdcard directory. But if I try to apply the exact same permissions and owner and group to the file under /data/media it will still not give me access. On Root Explorer, looking at properties of a file in /data/media, the md5sum shows Access Denied, but works on /sdcard. I'm thinking it has something to do with the /data/media folder's permissions instead of the files/folders under it, but I'm kinda afraid to mess with it. When I get home in the morning I'm gonna try dumping EVERYTHING and start again, but I would love to be able to fix it first.
Will I see any problems if I just copy all the files from /data/media to /sdcard, where I'm sure I can use them? Also, why doesn't /data/media or /data/media/0 show the same files as /sdcard?
Thanks for any help!
Click to expand...
Click to collapse
Again, as I said previously move your music photos apks downloads in the sdcard structure, then erase the /0 folder, you would have found your stuff, where it's ought to be, legible by their respective programs. So move your photos /data/media to your actual /sdcard/Dcim/ folder, and so on and so forth for each content, problem should be solved. It's really simple.
Aur3L said:
Again, as I said previously move your music photos apks downloads in the sdcard structure, then erase the /0 folder, you would have found your stuff, where it's ought to be, legible by their respective programs. So move your photos /data/media to your actual /sdcard/Dcim/ folder, and so on and so forth for each content, problem should be solved. It's really simple.
Click to expand...
Click to collapse
I understand that and that is what I plan to do to get through tonight. My question is, why is this even a problem? Is there something that I could do to not have to move the files? Not out of laziness, more out of curiosity. I still plan to dump everything because with all the crap I've tried to fix the permission issues there's no telling what I may have screwed up, but until I get to start over I'm planning to just copy everything to /sdcard. Now I just would like to know why it was an issue. Why can't I access files in the /data/media folder, or any other folder on my phone for that matter, when I'm rooted and using a root explorer? I have never seen this issue before, regardless of phone or ROM. Is this due to the new 4.2 multiuser file structure, or something I did? I appreciate your help and I apologize if my intention wasn't clear from my last post, I am at work and typing in a hurry. I started the thread looking for an easy fix and you've given me that, now I'm mostly just curious as to why it happened to begin with.
Thanks again!
Edit: I just tried copying some alarms into the /sdcard/Alarms/ and they won't play either, but Music still does. I actually got a "Not Enough Free Space" message when trying to copy them, with 5+ GBs free on the sdcard and the files were only about 130kb. I'm just going to have to dump everything and just copy what I really have to have to the phone. If you have any other ideas I'm open to hear them, but I think its FUBARed at this point. Thanks though.
Well, if you use a root explorer, such as ES file, you have to move your alarms/rigtones notifications in telephone/system/media. Once put in here, you will have to correct the permissions to rw rr , and reboot your phone. As to why it happens like this, I guess it is related to the new structure, and also because you cannot play everything from everywhere in your device, some folders are system folders, and not every file is legible from that location. My guess in your situation is that you have twice the same content on your phone (hence the Not enough free space message), so just paste everything you need in the appropriate volume, and erase the one you have messed up with.
Might be a suggestion, but if you have a nandroid backup, just look at how and where your files are organised.
Now, however, if you have a hard time fixing this up, well you might as well save your stuff on your computer, flash a stock image, root it, install TWRP, your favorite Rom, transfer your files back from your computer, and you will have a fresh and probably better running phone.
Hope it will help you, and if you have an insomnia, just take that opportunity to browse your phone structure, so that you know where each file is located. Good luck with it .
That last part is what I did. I just wiped everything, reinstalled PA 2.99B6 and ADB pushed to /sdcard instead of /data/media. It all works perfectly now. I'm not 100% sure what the issue was before, but I still think it was the new file structure. If I go at a music file through /data/media it still won't play but will from /sdcard, which is the only place I put the files. I guess its just the way the new file structure for multi-user works. I appreciate your help. I think I'll keep the /0 folder too. Trying to get rid of it is part if why I did things that caused problems, and its gonna be part of the future of android so we might as well get used to it.
Thanks again!

GS3 Broken Screen... NEED a folder from internal storage

Hey everybody,
I recently broke the screen on my gs3 and am trying to retrieve a folder from the internal SD.. I am not rooted and the folder is a hidden folder that I placed there.. . I adb pulled my entire internal SD and everything showed up but this folder...n any help would be appreciated
touchpro55 said:
Hey everybody,
I recently broke the screen on my gs3 and am trying to retrieve a folder from the internal SD.. I am not rooted and the folder is a hidden folder that I placed there.. . I adb pulled my entire internal SD and everything showed up but this folder...n any help would be appreciated
Click to expand...
Click to collapse
Hey, do you know the background to Linux terminal? make sure you're in the right directory "pwd", and do "ls" to see if your folder you're needing is in there.
Questions and Help issues go in Q&A and Help section
Thread moved
Thanks
FNSM
lemonboi5 said:
Hey, do you know the background to Linux terminal? make sure you're in the right directory "pwd", and do "ls" to see if your folder you're needing is in there.
Click to expand...
Click to collapse
Hey thanks for the reply... can u be more detailed in your commands? the commands I used were suppose to pull EVERYTHING for my internal storage. these look like adb shell commands... I used the windows command prompt to pull my files before... after I CD\ to the adb tools folder
anybody have a command line that could tell me what is on my internal storage? everything including hidden folders? like drowsing by directory
PWD will show the directory you're in, and LS will show files and directories within that directory, use CD (change directory) to navigate and make sure you find it. You can use a push command to move the file to your SD Card, and then get them that way onto your PC to back up or just keep them on the SD Card..

Categories

Resources