[Q] Can't copy files using ADB? (Linux) - Samsung Galaxy Nexus

Trying to copy over a file from my Linux machine onto my Galaxy Nexus using ADB. The file is in the platform-tools directory as well to make it easier. I am trying to execute "adb push gapps-ics-12172011.zip sdcard", but it keeps saying failed to copy 'gapps-ics-12172011.zip' to 'sdcard': Is a directory. Can someone help me out?

Code:
adb push gapps-ics-12172011.zip /sdcard
The way you had it did not specify a location, but a filename.

Thanks, I'll try this when I get home.
Sent from my Galaxy Nexus using XDA

Still did not work. Found the problem though, the sdcard was under /mnt, so I did /mnt/sdcard and it worked

glad it's working, but remember not to forget the / at the end if you are pushing files to a directory

/sdcard is just a symlink.
Stop directing people to a symlink, which may or not be available.
Folks, equivalent dir to /sdcard is /data/media.

bk201doesntexist said:
/sdcard is just a symlink.
Stop directing people to a symlink, which may or not be available.
Folks, equivalent dir to /sdcard is /data/media.
Click to expand...
Click to collapse
I am not about to start telling people to adb push to /data/media, when /sdcard works fine and is universal, symlink or not. If the symlink is missing, that is kind of their fault, not mine, and they have bigger fish to fry than adb push.

As mentioned above the issue was the lack of trailing /. This command should work:
adb push gapps-ics-12172011.zip /sdcard/

Related

Help, was in recovery then I pushed a file to /sdcard, what happens!?!?

So I rebooted to recovery and I push a file into /sdcard
after I shell, I check it's only file in there!! So then I reboot and then adb shell again when phone is regular mode and I don't see that file
Where did I push the file when in recovery? I can't find it next time I reboot to recovery then did LS, the file is gone! Can I delete that file or its lost/hidden or what's going on?
Im not even going to read the whole thing. If u pushed the file and u can't figure out how to reboot from recover just pull battery and restart
Sent from my SCH-I500 using XDA App
You need to mount your sd card to /sdcard.
The file was stored to / on the temporary ramdisk. Do "mount -a" in shell first.
pulser_g2 said:
You need to mount your sd card to /sdcard.
The file was stored to / on the temporary ramdisk. Do "mount -a" in shell first.
Click to expand...
Click to collapse
Thanks for the good info! SO basically the file I pushed over was removed upon rebooting correct? I just don't want that file to be on the ramdisk or sdcard anywhere since the /sdcard was not mounted.

Trying to change boot animation

I am using ADB to push the bootanimation.zip to /data/local but nothing is changed in the phone.
I am using Telus Raidroid fully rooted and s-off.
Any ideas?
Try /system/customise/resource/
Sent from my Desire HD using Tapatalk
AndroHero said:
Try /system/customise/resource/
Sent from my Desire HD using Tapatalk
Click to expand...
Click to collapse
Make sure you mount the location as well (from command prompt in windows, or equivalent) - type what's in bold-type:
C:\SDK\Tools> adb shell
# mount /data/local
(screen will then print: )
mount /data/local
# ls /data/local <~this will list what is stored in this location.
(or, if it's supposed to be system/cust... as above poster said)
# mount /system/customise/resource
mount /system/customise/resource
If neither works, try using ES File Explorer. Change it's settings to "view system files", then look around in the folders until you find the bootrecovery.zip & where it's been placed. Not 100% sure but I was under impression you need to mount /filelocation to copy the bootanimation.zip to that location.
Rubixious said:
Make sure you mount the location as well (from command prompt in windows, or equivalent) - type what's in bold-type:
C:\SDK\Tools> adb shell
# mount /data/local
(screen will then print: )
mount /data/local
# ls /data/local <~this will list what is stored in this location.
(or, if it's supposed to be system/cust... as above poster said)
# mount /system/customise/resource
mount /system/customise/resource
If neither works, try using ES File Explorer. Change it's settings to "view system files", then look around in the folders until you find the bootrecovery.zip & where it's been placed. Not 100% sure but I was under impression you need to mount /filelocation to copy the bootanimation.zip to that location.
Click to expand...
Click to collapse
Thanks I'll try that later when I get home! Nothing I read mentioned having to mount anything...but I also never got any errors in ADB when pushing the file.
The file was successully pushed as per EF File Manager to /data/local/
You don't always have to use "push" to get the file into /data/local
Free apps like "Android Mate" can also let you copy files into the root of your phone. The terminal apps also allow you to copy the bootanimation.zip
cp /sdcard/bootanimation.zip /data/local

[Q] How do i transfer files to GNex when in recovery mode?

So i've made a mistake. I forgot to download GAPPS but i've already done a factory reset and installed a new rom. I cant seem to mount the usb storage trough clockwork recovery. Is there a way to push the zip file to the device?? Or what should i do?
Thanx
xclusiv8 said:
So i've made a mistake. I forgot to download GAPPS but i've already done a factory reset and installed a new rom. I cant seem to mount the usb storage trough clockwork recovery. Is there a way to push the zip file to the device?? Or what should i do?
Thanx
Click to expand...
Click to collapse
If you only forgot gapps you can restart, the ROM and the phone will work fine you just won't have Google apps. Once it's on you can just copy the file like usual and return to recovery and flash it
Sent from my Galaxy Nexus using xda premium
Good question though. What IF he didnt flash the ROM, how do you get a file on the SDcard if you cant mount it in recovery?
adb push ./"filename.zip" /sdcard
Phone will boot just fine w/o GAPPS.
But you can just use adb push <FILE> <DIRECTORY>
for example:
Code:
adb push gapps.zip /sdcard/
Thanx for the help guys =)
This happens to me all the time. The Mounts section of CWM select "mount as USB" drive. Windows should see this drive and transfer away.
merge5 said:
This happens to me all the time. The Mounts section of CWM select "mount as USB" drive. Windows should see this drive and transfer away.
Click to expand...
Click to collapse
GN internal storage can't be mounted as USB - not even in recovery.
The only way I've found to push/pull files in CWM on the GN is over ADB. If the files in /sdcard/ don't appear, go into mounts and storage, and mount /data. Then try again.
/sdcard/ is nothing more than a symlink to /data/media.
I transfer files over ADB with
'adb push update.zip /data/media/'
no need to mount /data before.
just reboot open up your computer and youll see the gnex just transfer the gapps to your sd card and then reboot in recovery to flash
cmstlist said:
GN internal storage can't be mounted as USB - not even in recovery.
The only way I've found to push/pull files in CWM on the GN is over ADB. If the files in /sdcard/ don't appear, go into mounts and storage, and mount /data. Then try again.
Click to expand...
Click to collapse
Good point. I stand corrected. That was how I did it on my OG Droid. Sorry for the confusion.
bk201doesntexist said:
/sdcard/ is nothing more than a symlink to /data/media.
I transfer files over ADB with
'adb push update.zip /data/media/'
no need to mount /data before.
Click to expand...
Click to collapse
I'm not sure why but CWM on my phone used to auto mount /data and now it doesn't anymore. So to see anything from adb in recovery, I now have to go to mounts first.
Sent from my Galaxy Nexus using Tapatalk
cmstlist said:
I'm not sure why but CWM on my phone used to auto mount /data and now it doesn't anymore. So to see anything from adb in recovery, I now have to go to mounts first.
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
What cwm version are you on, for instance?
Latest CWM touch as of today, and also tried it with latest CWM non-touch.
Incidentally I just bumped into a caveat of transferring files to the GN in recovery mode. The permissions are set strangely when you push files over ADB in recovery, and as a result when booted into the OS I was unable to rename any of the pushed files/folders or put new files in. Since the DCIM directory was one that I'd pushed over, new photos weren't saving. And I did not have permission to change permissions.
This is pretty much a brute force method - so I rebooted into recovery again, mounted /data, did adb shell, cd sdcard, and then:
chmod -R 777 *
And upon booting back into the OS, everything works properly again.
I know that messing with permissions is usually a dangerous thing. My logic was that anything stored in /sdcard is supposed to be a file that any app would be allowed to access as long as it has SD permissions - it's been that way in every version of the OS through to 4.0.
But anyway, if there's something I should do to decrease the "unsafeness" of this situation, please advise me. I guess in theory this would give a malicious app permission to execute code from /sdcard, which would make me more vulnerable?
EDIT: Okay more to report. To see the permissions properly when booted into the OS, you have to go into /data/media rather than /sdcard (same directory but permissions appear differently).
When I went in there and typed ls -n, I found that all the files I had pushed in recovery have UID & GID of 0. All files I had created afterwards had UID & GID of 1023. That explains everything. The owner is root for files that came from ADB in recovery, and media_rw for files created in the OS.
I can use chown, but it looks like the version of chown that comes with busybox does not have -R recursion implemented. Hrm. Aha! In CWM, chown does support -R. And we're off to the races. So from recovery I did:
cd /data/media
chown -R media_rw.media_rw *
cmstlist said:
Latest CWM touch as of today, and also tried it with latest CWM non-touch.
Incidentally I just bumped into a caveat of transferring files to the GN in recovery mode. The permissions are set strangely when you push files over ADB in recovery, and as a result when booted into the OS I was unable to rename any of the pushed files/folders or put new files in. Since the DCIM directory was one that I'd pushed over, new photos weren't saving. And I did not have permission to change permissions.
This is pretty much a brute force method - so I rebooted into recovery again, mounted /data, did adb shell, cd sdcard, and then:
chmod -R 777 *
And upon booting back into the OS, everything works properly again.
I know that messing with permissions is usually a dangerous thing. My logic was that anything stored in /sdcard is supposed to be a file that any app would be allowed to access as long as it has SD permissions - it's been that way in every version of the OS through to 4.0.
But anyway, if there's something I should do to decrease the "unsafeness" of this situation, please advise me. I guess in theory this would give a malicious app permission to execute code from /sdcard, which would make me more vulnerable?
EDIT: Okay more to report. To see the permissions properly when booted into the OS, you have to go into /data/media rather than /sdcard (same directory but permissions appear differently).
When I went in there and typed ls -n, I found that all the files I had pushed in recovery have UID & GID of 0. All files I had created afterwards had UID & GID of 1023. That explains everything. The owner is root for files that came from ADB in recovery, and media_rw for files created in the OS.
I can use chown, but it looks like the version of chown that comes with busybox does not have -R recursion implemented. Hrm. Aha! In CWM, chown does support -R. And we're off to the races. So from recovery I did:
cd /data/media
chown -R media_rw.media_rw *
Click to expand...
Click to collapse
that would explain it: i always use /data/media, didn't find any permission issues yet. thanks.

[Q] Cant mount "mount /sdcard in CWM

hi guys,
i was coming back from CM10 to stock 4.1.1 on my nexus and when in CWM, i deleted all the content on sdcard by accident.
now there is no zip file on the sd card to install the rom,
I tried mounting sdcard and copy but it doesnt mount.when i press mount /sdcard, nothing happens>(doesnt show the partition on computer and doesnt go ot :unmount /sdcard.)
Im stuck in here and dont know what to do.
please help!
use search, or read a few pages back, you'll find your answer.
sent from my i9250
A quick search yielded this useful thread.
http://forum.xda-developers.com/showthread.php?t=1916108&highlight=recovery+mount+sdcard
i tried ODIN to stock but the ODIN software does not find the phone on any port when it is connected. i installed all drivers but still nothing.
cant i use ODIN for this ? thanks
adb push whateverromyouwant.zip /storage/sdcard0
Since nobody did explain why it can't mount, I will.
GALAXY NEXUS HAS NO SDCARD. It only has folder that is used as sdcard. CWM doesn't know that, thus making that mount feature useless on Galaxy Nexus
Like El Daddy said, connect your computer while your phone is in recovery mode, open cmd on the directory where you have fastboot.exe, then type "adb push ROMNAME.zip /sdcard/". You will also need to place your ROM file into the directory where you have fastboot.exe
Since that's done, please use search next time. There are too many threads talking about this exact problem.
Besides, using adb is more badass
Sent from my Galaxy Nexus using xda app-developers app
kyokeun1234 said:
You will also need to place your ROM file into the directory where you have fastboot.exe
Click to expand...
Click to collapse
or adb.exe, depending on what are you trying to do. one could also add said folder to $PATH and have the commands system-wide to avoid the need of placing files to flash/push on the same folder that the binaries are.
note: if pushing to /sdcard/ doesnt work in recovery, push to /data/media.
sent from my i9250
bk201doesntexist said:
or adb.exe, depending on what are you trying to do. one could also add said folder to $PATH and have the commands system-wide to avoid the need of placing files to flash/push on the same folder that the binaries are.
note: if pushing to /sdcard/ doesnt work in recovery, push to /data/media.
sent from my i9250
Click to expand...
Click to collapse
Thanks for extra info
Just to add (and clarify) a bit to what was said:
1) if we are talking about mounting as in getting read/write access to /sdcard via ADB, it is already mounted by default in CWM. The /sdcard is just a symlink to /data/media, and /data is mounted by default when you boot CWM.
2) if we are talking about mounting as in USB Mass Storage, mounting /sdcard is not possible for the same reason in point #1: /sdcard is just a symlink to /data/media.
kyokeun1234 said:
Since nobody did explain why it can't mount, I will.
GALAXY NEXUS HAS NO SDCARD. It only has folder that is used as sdcard. CWM doesn't know that, thus making that mount feature useless on Galaxy Nexus
Like El Daddy said, connect your computer while your phone is in recovery mode, open cmd on the directory where you have fastboot.exe, then type "adb push ROMNAME.zip /sdcard/". You will also need to place your ROM file into the directory where you have fastboot.exe
Since that's done, please use search next time. There are too many threads talking about this exact problem.
Click to expand...
Click to collapse
Thank you so much, really solve my big problem
so much easier
for those who will come to this thread with the same problem, there is the very simple solution. use any of the Toolkits from this forum ( N-Cry or Nexus 4 Toolkit 2.0 ) and from the recovery menu select install from Sideload, after that launching ( pushing ) the ROM via sideload from the Tookit. Works like a charm.
Mango Polo said:
for those who will come to this thread with the same problem, there is the very simple solution. use any of the Toolkits from this forum ( N-Cry or Nexus 4 Toolkit 2.0 ) and from the recovery menu select install from Sideload, after that launching ( pushing ) the ROM via sideload from the Tookit. Works like a charm.
Click to expand...
Click to collapse
1) this is the galaxy nexus, not the nexus 4
2) just say no to toolkits
3) adb is not hard
4) fastboot is also, not hard.

[Q] Need help deleting a directory

So here's the thing i've been exploring the possibilities of USBHost and decided to try an usb stick so i installed Paragon https://play.google.com/store/apps/details?id=com.paragon.mounter
It took me a while to get the hang of things. At first my usbstick was formatted in fat32. I specified in paragon i would like the default mount point to be USBStorage instead of /paragonNTFS. I made a small typo at first and named the folder usbStorage
now here comes the problem.
for some reason the app created 2 subfolders called sdb1 and sdb2 and i cannot remove them
Things i've tried:
cyanogenmod file manager in root access mode
-- delete directory > "This operation needs elevated permissions. Try switching to root access mode" (translated from dutch so wording may be a bit off
-- modifying permissions of folders > denied > changing permissions failed. for security reasons some filesystems, such as on sdcards do not allow changing permissions
Same problem for Astro file manager
Same problem when attaching the tablet to computer. parent directory (and sub dirs) get "removed" in windows but when checking the file system on the tablet, the opposite is true and the directories is still present
and now it's starting to piss me off. I want that folder "usbStorage" and it's subfolders "sdb1" and "sdb2" removed. so my guess is it'll have to be done by terminal commands but my terminal experience is ZERO.
in preperation of you guys helping me installed https://play.google.com/store/apps/details?id=jackpal.androidterm the same one used in cyanogenmod roms. I tried a bit of tinkering myself but prob doing something wrong
what i've tried (in sequence, --ok behind the command means it was succesfully executed)
su --ok
cd sdcard --ok
*rm -rf /usbStorage >> *rm: not found
rm -rf /usbstorage --ok, but folder was still present
rm -rf usbstorage --rm failed for usbStorage, Directory not empty
cd usbStorage --ok
rm -rf sdb1 --ok, rm failed for sdb1, Permission denied
at that point i gave up. I hope you guys can help me out
I do have paragon configured properly now and my USBstick in NTFS is getting recognised. Upon mounting of the usbstick, it now creates a folder called "USBStorage" where the contents of the usb stick is properly displayed.
so where are those android terminal / linux masters to help me out
only thing i can add is that when opening paragon with the stick attached but unmounted i do see a line above it /dev/block/sda1 but that doesn't seem to affect mounting in the specified directory
Bump, anyone? I want and need this folder removed
Verstuurd vanaf mijn Nexus 7 met Tapatalk
From my understanding of your post.
You are rooted and using cyanogenmod?
Did you try going into the app information and clear data?
In the app drawer hold the app and then drag it to App Info
Clear data.
Did that solve it? If not continue below.
Make sure you don't have the USB stick mounted and or plugged in.
Then go into terminal and type
su
Then type.
mount
The mount command shows all listed mount points. If you don't see the usbStorage or whatever mounted.
Then type.
busybox rm -rf usbStorage
Or whatever the main directory is...
For example directory is at.
/sdcard/usbStorage
cd /sdcard
rm -rf usbStorage
Let me know how you make out.
Sent from my Galaxy Nexus using xda app-developers app
nope, my phone is running CM 10.2 (not relevant to the question) this is the nexus section and its my nexus 7 2013 running stock rom but rooted yes that needs the folders removed.
The folders i need to delete according to the Nexus 7 mount main mount path SD content
main path: /storage/emulated/0 or /storage/emulated/legacy (both are the same according according to ParagonNTFS as a folder the mount path /sdcard/USBStorage = /storage/emulated/0/USBStorage or /storage/emulated/legacy/USBStorage
important lines?
/dev/fuse /storage/emulated/0/ fuse rw,nosuid,nodev,realtime, user_id=1023, default_permissions,allow_other 0 0
/def/fuse /storage/emulated/legacy fuse rw,nosuid,nodev,relatimeuser,user_id=1023, group_id=1023,default_permissions,allow_other 0 0
folders to delete are
/storage/emulated/0/usbStorage
/storage/emulated/0/usbStorage/sdb1 <= can select these just fine
/storage/emulated/0/usbStorage/sdb2
/storage/emulated/0/ParagonNTFS <= simply selecting this folder prompts CM manager "this operation needs elevated priviledges. Try switching to rootmodus, even when the CM filemanager already is in root mode
so i went
Opening terminal
su
cd sdcard (command ok)
cd usbStorage (commando ok)
busybox rm -rf sdb1
rm: can't remove 'sdb1': permission denied
Then i tried
cd /sdcard
rm -rf usbStorage
rm failed for usbStorage, Directory not empty
cd usbStorage
rm -rf sdb1
rm failed for sdb1, Permisison denied
busybox rm -rf sdb1
rm: can't remove 'sdb1': Permision denied
According to Cyanogen mod file manager:
Filesysteminfo:
Status: rw
linkpath?: /storage/emulated/0
Device: /dev/fuse
Type: fuse
Options: rw,nosuid,nodev,relatime,user_id=1023,default_permissions,allow_other
Dump / Pass: 0 / 0
even with the app ParagonNTFS uninstalled it doesnt work
hmm
try
close the app ParoganNTFS and uninstall it.
then try to delete those directories.
Also when you type
mount
does it show any of the directories you are trying to delete as mounted?
if it is try
umount /sdcard/usbStorage/sdb1
rm -rf /sdcard/usbStorage/sda1
were you able to delete the dir?
I had the same problems under very similar circumstances. Stickmount rather than paragon. The only way I could delete the dir was to boot into recovery (team win recovery project v2.7.1.1) and delete it with TWRP's terminal command. Something in the OS apparently locks on to the mount and simply will not let it go ever. It has to be done before android starts. It's very annoying. I am beginning to really be disgusted with many of the decisions google is making with regard to android. Why do they hate sdcard expansion so much? its absurd.
---------- Post added at 04:22 AM ---------- Previous post was at 04:17 AM ----------
Oh and by the way, even though the OS latched on to that folder as if its very existence depended on it, I was never able to even see the files on the USB memory stick with any file explorer. Worked just fine in kit kat and before. In some ways lollipop really sucks.

Categories

Resources