Can't do adb push or remount system - Android Q&A, Help & Troubleshooting

when i try to do the following commands "adb push <> <> " and "adb remount" ...i get error.... Like "operation not permitted access denied" ....please help

Related

[Q] All adb commands saying permission denied

Trying to install Clockwork recovery mod on my LG Optimus V and I am running into a few problems. The version of ROM Manager that I got from the market does not list my phone as a model to choose from when the Confirm your phone window appears. So, to get around this, I decided to try and install another recovery (such as Amon's) using an adb shell. Anytime I try to type a command while in the adb shell it returns the command and says "permission denied" next to it. The $ is there, my phone is rooted, the SD card is unmounted and USB Debugging ot turned on.
I can view my phone from adb devices and even look at the log of its activity with adb logcat.
The first command I type in is "adb shell mount -o rw,remount /dev/block/mtdblock3 /system". After I hit enter, it says mountperation not permitted.
I also can't boot into recovery mode at the moment because I had to choose a phone that is different from mine when I tried to flash Clockwork Recovery mod.
I'd greatly appreciate any help, I'll get some sleep and check back in a few hours.
ironpirat3 said:
The $ is there, my phone is rooted
Click to expand...
Click to collapse
The $ is normal user and not root (#).
Code:
> adb shell
$ su
# mount -o rw,remount /dev/block/mtdblock3 /system
Turns out I wasn't looking at my phone and allowing the su command through Superuser (feel really dumb now). Still, whenever I try to run a command starting with adb shell from the command prompt it says Operation not permitted.
Code:
>adb shell mount -o rw,remount /dev/block/mtdblock3 /system
mount: Operation not permitted
On a side note, how do I get out of my phone and back into command prompt after using the adb shell command?
ironpirat3 said:
Turns out I wasn't looking at my phone and allowing the su command through Superuser (feel really dumb now). Still, whenever I try to run a command starting with adb shell from the command prompt it says Operation not permitted.
Click to expand...
Click to collapse
Code:
>adb shell mount -o rw,remount /dev/block/mtdblock3 /system
mount: Operation not permitted
No. You run adb shell only, and then su, and then remount from the phone shell, NOT via adb. Clearly written in the example above.
To exit a shell, type exit.

[Q] ls does not sort

When I start the ADB shell from the Windows command line, and type the command "ls", the list of files I get is not sorted by name. Also, if I enter "ls -r" which should reverse sort, I get the error message "no such file". If I type "busybox ls -l", I get the expected sorted list. Also, other commands like "busybox ls -la" work.
My Phone is a Samsung Captivate i897, rooted from Gingerbread with Corn Kernel v7.06 with Superuser and BusyBox installed.
How can I get the Busybox version of the shell commands to run without having to type "busybox" all the time?
The same problem
How to force sort in ls result ?

Read Only File System

I'm trying to adb push a zip file onto my Prime so I can install the ROM, but adb push always fails, saying that the file system is read only.
What can I do to change this?
Please post full adb command which you are using.
Johnotronz said:
I'm trying to adb push a zip file onto my Prime so I can install the ROM, but adb push always fails, saying that the file system is read only.
What can I do to change this?
Click to expand...
Click to collapse
Send the file to a writable location?
adb push file.ext /sdcard/
or
adb push file.ext /data/local/
I had been using the "adb push file.ext /sdcard/" command, and it returned "Failed to copy....blah: Read-only file system."
This also happens when using "adb push file.ext /data/local"
Try adb push file.ext /mnt/sdcard/
Johnotronz said:
I had been using the "adb push file.ext /sdcard/" command, and it returned "Failed to copy....blah: Read-only file system."
This also happens when using "adb push file.ext /data/local"
Click to expand...
Click to collapse
?
what happens if you type:
Code:
adb remount
First?

[Q] AOSP ADB push /sdcard/ permission denied

I noticed on some of the recent AOSP ROMs (AICP and Vanir that I remember for sure) that trying to "adb push <file> /sdcard/" results in a basic permission denied error. I tried "adb push <file> /storage/emulated/0/" and got a slightly more specific error saying that the filesystem was mounted as read only. When I tried "adb push <file> /data/media/0/" it went through as expected. I'm rooted with SuperSU 2.14, enabled USB debugging, and granted root to both apps and adb. I tried doing "adb root" and "adb remount" which should've given root and remounted /system as read-write, but I got the same results (using adb and fastboot from the most recent SDK).
It works fine in recovery (TWRP 2.8.0.2), but is there a way to fix it so that the /sdcard/ path works again?

Editing Hosts File on Rooted Android 11 Google Pixel 3

I'm trying to edit the hosts file in /system/etc/hosts on Android and I rooted the device via Magisk. When I utilize adb push through my Linux machine it can't do it because the system is read only. After seeing this I looked up how to mount it as rw and back but disabling dm-verity didn't work, neither did adb remount (It claimed there was no remount command) and after dropping into a shell on both a terminal emulator on the app and through adb itself it can't remount the filesystem as rw no matter what I do. Ultimately it comes down to three errors on my machine: "adb root" returns: "adbd cannot run as root in production builds", under "su" in the shell a simple "mount -o rw,remount /" returns: "'/dev/block/dm-0' is read-only", "disable-verity" returns: "verity cannot be disabled/enabled - USER build", and "adb root" returns: "adbd cannot run as root in production builds" to which I can find no solutions online. I have also tried going into a file explorer and manually editing the files that way but I still get an error that it's read only. Is there anything at all I can do?
T3ntr0 said:
I'm trying to edit the hosts file in /system/etc/hosts on Android and I rooted the device via Magisk. When I utilize adb push through my Linux machine it can't do it because the system is read only. After seeing this I looked up how to mount it as rw and back but disabling dm-verity didn't work, neither did adb remount (It claimed there was no remount command) and after dropping into a shell on both a terminal emulator on the app and through adb itself it can't remount the filesystem as rw no matter what I do. Ultimately it comes down to three errors on my machine: "adb root" returns: "adbd cannot run as root in production builds", under "su" in the shell a simple "mount -o rw,remount /" returns: "'/dev/block/dm-0' is read-only", "disable-verity" returns: "verity cannot be disabled/enabled - USER build", and "adb root" returns: "adbd cannot run as root in production builds" to which I can find no solutions online. I have also tried going into a file explorer and manually editing the files that way but I still get an error that it's read only. Is there anything at all I can do?
Click to expand...
Click to collapse
Search forum for superrepack tool or SystemRW script. Good luck!
Worked on Android 11 with lineageos: https://www.howtogeek.com/140576/how-to-edit-the-hosts-file-on-android-and-block-web-sites/

Categories

Resources