[Q] How do i transfer files to GNex when in recovery mode? - Samsung Galaxy Nexus

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.

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.

[q] Trying to push some files to phone

I'm using ADB and trying to move some files to system/etc (gps.conf to improve GPS signal) but everytime I try to mv in ADB shell it says it can't find the file I want to mv from /sdcard/ to /system/etc/
I've mounted the SD Card by typing mount sdcard and can see the file in ADB shell when typing ls.
What am I doing wrong?
I've got it to work using Root Explorer. Just wondering why I couldn't get it to work using adb
Are you S-off, if not that is why it failed. Also if you are not S-off root manager didn't move anything to system (at least until you reboot) because you don't have write access to the system partition while booted.
So if you are S-on do it again but then with the phone in recovery and don't forget to mount the system partition as read/write.
Cheers!

ADB in recovery question

Earlier today when I was having some trouble trying to get my GN booting, I went into CWM and plugged in the USB cord, and was able to ADB into the phone in recovery mode. All my files were there and I was able to push/pull what I needed.
After a full reinstall and re-root, now something has changed. When I go in by ADB in CWM recovery, all the directories appear to be empty and I can't adb pull any files out.
Any idea what changed and how to make it so I can access files again by ADB in recovery?
Just to show you what I mean, here is me doing the same ls command from the OS and from recovery:
D:\root>adb-windows shell
[email protected]:/ # cd data
cd data
[email protected]:/data # ls
ls
NVM0
NVM1
NVM13
NVM2
NVM3
NVM5
NVM6
anr
app
app-private
backup
cal.bin
dalvik-cache
data
dontpanic
drm
local
lost+found
media
misc
property
radio
resource-cache
smc
system
user
[email protected]:/data # reboot recovery
reboot recovery
D:\root>adb-windows shell
~ # cd data
cd data
/data # ls
ls
media
/data # exit
exit
D:\root>
Click to expand...
Click to collapse
Have you tried su then ls?
No difference - with ADB in recovery, su gives me:
/sbin/sh: su: not found
The sdcard directory is empty too in recovery.
And now that my phone is unbootably crashed again... I have a nandroid backup sitting on internal storage and I'm trying to find a way to yank it out with access only to bootloader and recovery.
Ok I feel silly. Had to mount everything under mounts and storage. Now I can see it all.
It turns out that because /data and /sdcard actually reside in the same place... if /data is not mounted on GN, then you can't see /sdcard either.
cmstlist said:
Ok I feel silly. Had to mount everything under mounts and storage. Now I can see it all.
It turns out that because /data and /sdcard actually reside in the same place... if /data is not mounted on GN, then you can't see /sdcard either.
Click to expand...
Click to collapse
no, /sdcard/ is just a symlink to /data/media, put there for backwards compatibility. if you 'ls /data/media/' you should be able to see all "sdcard" contents.

[Q] How do I allow apps to write to internal SD? (Jelly Bean JRN84D)

Just put on this jelly bean ROM, and when trying to save files from dropbox onto the internal sd it says "error". Audiogalaxy, another app I use, won't allow me to save copies of my songs to the internal SD either. I feel like there's a setting somewhere that's preventing me from save files onto the internal sd, but can't find it. In ICS I was able to find it, pretty sure in Settings -> Storage, but no dice in Jelly Bean.
Any help?
I have you made sure settings>developer options>protect USB storage is not checked. That's where I'd start.
Just fired up Wugs toolkit 1.4 and set full file read/write/execute permissions to all those directories (or at least tried to). Still nothing.
Wanted to update that I was able to rename the DCIM folder to DCIM1 and now it can save camera pics to the phone. I still can't open up a dropbox file due to "storage full or unavailable".
I think you have an issue. You shouldn't have to grant any extra permissions for the apps to write to the SDcard, as there isn't actually an SDcard or partition for it. It's just a symlink to /data/local, a virtual "SDcard".
All my apps work fine writing/reading the "SDcard".
Have you made sure settings>developer options>protect USB storage is not checked. That's where I'd start.
o_z0ne said:
Have you made sure settings>developer options>protect USB storage is not checked. That's where I'd start.
Click to expand...
Click to collapse
Yessir this is not checked.
EDIT: also noticed that when I take a picture, it doesn't save it to the phone. The pic just disappears after it's taken.
Try fixing permissions and checking the permissions/owner on /sdcard/ and /data/media (where the /sdcard folder is symlinked from). There have been lots of threads about sdcard permissions and Jelly Bean,.
ex:
http://forum.xda-developers.com/showthread.php?t=174832
http://forum.xda-developers.com/showthread.php?p=2696762
Similar:
http://forum.xda-developers.com/showthread.php?p=21746289
Other possible solutions are suggested in links.
Just fired up Wugs toolkit 1.4 and set full file read/write/execute permissions to all those directories (or at least tried to). Still nothing. There's gotta be something I'm doing wrong here, I can't be the only guy who has this jelly bean rom installed and isn't using a microSD card.
papabri said:
There's gotta be something I'm doing wrong here, I can't be the only guy who has this jelly bean rom installed and isn't using a microSD card.
Click to expand...
Click to collapse
That's probably true, considering the GNex doesn't have a MicroSD slot .
haha yes true.
Wanted to update that I was able to rename the DCIM folder to DCIM1 and now it can save camera pics to the phone. I still can't open up a dropbox file due to "storage full or unavailable".
Solved this issue by doing this:
Reflash stock. Hold off on restoring data/media. There seems to be a problem with it in v1.4.
{{ WugFresh }}
I since put back on the JB rom and have full access with no issues. My issue was when I restored my backup to the phone, the permissions were messed up.
What you probably had was an ownership issue, not permissions.
http://forum.xda-developers.com/showpost.php?p=22970837&postcount=14
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.
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
So if you bump into this again, try chown in ClockworkMod in ADB shell over USB.

Question Internal storage '/sdcard' unmounted [SOLVED!]

I am running the latest stock Oxygen OS version (11.2.10.10.LE15AA), rooted with Magisk. Somehow the internal /sdcard directory got unmounted and now I cannot save anything to the user storage because it doesn't exist. I could not even take screenshots because it saves by default to /sdcard/DCIM/Screenshots which doesn't exist now, so I apologize for having to take photos of a screen (the first is from terminal, the other 2 are from ES File Explorer). However, when I run "ls -la /" as superuser in a terminal window it lists sdcard. Does anyone know how to fix this? How do I re-mount /sdcard and get it recognized again?
eudemonics said:
I am running the latest stock Oxygen OS version (11.2.10.10.LE15AA), rooted with Magisk. Somehow the internal /sdcard directory got unmounted and now I cannot save anything to the user storage because it doesn't exist. I could not even take screenshots because it saves by default to /sdcard/DCIM/Screenshots which doesn't exist now, so I apologize for having to take photos of a screen (the first is from terminal, the other 2 are from ES File Explorer). However, when I run "ls -la /" as superuser in a terminal window it lists sdcard. Does anyone know how to fix this? How do I re-mount /sdcard and get it recognized again?
Click to expand...
Click to collapse
Try to reboot to recovery and factory reset
Fixed the /sdcard unmounted error!
What finally ended up working was flashing the Oxygen OS zip in TWRP and rebooting without root. I noticed my internal storage was restored along with all the files in it — but then when I rebooted to bootloader to re-root the device with a Magisk-patched boot.img (booting into Android once as temp root with "fastboot boot magisk_patched.img", then running the Magisk app and selecting "direct install" to patch boot.img for permanent root) the /sdcard unmounted error came back! So I disabled all the newer Magisk mods I had installed, rebooted, and I have /sdcard again along with root. Yay! Factory reset was going to be my next attempt if that didn't work though.

Categories

Resources