adb remount permission denied, but able to access super user in shell -- android
Solution 1
In case anyone has the same problem in the future:
$ adb shell
$ su
# mount -o rw,remount /system
Both adb remount
and adb root
don't work on a production build without altering ro.secure, but you can still remount /system by opening a shell, asking for root permissions and typing the mount command.
Solution 2
emulator -writable-system
For people using an Emulator: Another possibility is that you need to start the emulator with -writable-system. That was the only thing that worked for me when using the standard emulator packaged with android studio with a 4.1 image. Check here: https://stackoverflow.com/a/41332316/4962858
Solution 3
Try
adb root
adb remount
to start the adb demon as root and ensure partitions are mounted in read-write mode (the essential part is adb root
). After push
ing, revoke root permissions again using:
adb unroot
Solution 4
Some newer builds require the following additional adb commands to be run first
adb root
adb disable-verity
adb reboot
Then
adb root
adb remount
Solution 5
you can use:
adb shell su -c "your command here"
only rooted devices with su works.
Comments
-
IanO.S. almost 2 years
so, i'm trying to push some files to /system on android device (zte) I've rooted, connected with ADB,
adb remount -> I get permission denied adb shell su -> I'm able to access shell and create folders etc and edit filesystem
(but in shell I can't copy a file from my computer to device)
Any help please
-
MartinodF about 11 years@Michael at which step are you getting the error? Is your phone rooted? What root app are you using (SuperSU, Superuser, ...)?
-
Michael about 11 yearsStep two, when I try to run "su" from the adb shell. Phone is rooted. I am using the Superuser app. Is there something I need to do to tell Superuser to allow adb root access?
-
MartinodF about 11 yearsNot that I know of! When you run "su" you should get a Superuser popup on the phone asking if you want to authorize it. Are you sure that Superuser is working fine and that it's not configured to block adb root?
-
Michael about 11 yearsThanks, that was it! It was popping up a dialog, but I didn't see it before (screen brightness auto-dimmed so I didn't notice anything there). Apparently after a bit it would time out and fail.
-
Matt Huggins about 11 yearsI'm not able to run
su
on my Android device, I get:/system/bin/sh: su: not found
. I guess it's cause my device is not rooted. -
MartinodF over 10 years@Jayesh No, you need to be rooted to run
su
. That's pretty much the point of rooting ;) -
Jayesh over 10 yearsok, I have rooted device but I have some issue, My device is not being switched on and in offline mode id display in Eclipse device list (by connecting with usb cable in PC), but I cant push one font file(DroidSans.ttf) please read this android.stackexchange.com/questions/53699/…
-
davejal over 8 yearsa little bit of explanation along with your code might go a long way
-
amitavk about 8 yearsGetting a "remount failed: no such file or directory"
-
Ciro Santilli OurBigBook.com over 5 yearsYes, this removes the
read-only
option from QEMU's-drive
option: android.stackexchange.com/questions/110927/… But note that it also points to a qcow2 overlay instead of the image itself, so you must then pass this option of future runs. -
noname about 5 yearsI get
mount: '/system' not in /proc/mounts
on an emulator. -
user924 almost 5 years
adb root
: device not found -
Kemal Tezer Dilsiz over 4 years@BeanstheWizard they changed in API 29 I believe, it helped me to create a different emulator with older API (I used 25, android 7.0.0), that might help you.
-
tigertang over 4 years@Kemal Tezer Dilsiz In API 28, I also got this
-
Kemal Tezer Dilsiz over 4 years@tigertang I was able to do API 28 by launching emulator through cmd with --writable-system tag and then just using adb shell to go in and edit manually. I don't know if that'd work for your case. Good luck. I'm my case I only had to edit the hosts file
-
tigertang over 4 yearsYou can delete the answer if you don't want to carry with so many downvotes
-
tigertang over 4 years@Kemal Tezer Dilsiz, that only works for your emulator, rather than the real device.
-
Ash over 4 years@KemalTezerDilsiz When I try to start my API 28 emulator using
--writable-system
, I getPANIC: Missing emulator engine program for 'x86' CPU.
And I'm not even at the disco. -
user3738870 about 4 years@PrzemysławSienkiewicz Same here. Nothing works with the newest emulator.
-
Michael Tolsma over 3 years
adb disable-verity
gives me an error oferror:closed
. Any fix for this? -
Sebastian Diaz over 3 yearsI doesn't work for me. After
adb remount
I get some writing data errors and finally a "remount failed". -
Mario Codes about 3 yearsI also get
mount: '/system' not in /proc/mounts
withAPI 30
, but it still works somehow when I connect to my database. -
HackRx over 2 yearsThanks man, it worked on android 11, IDK why they forgot to place the remount file under bin dir. :)
-
JiTHiN over 2 yearsUse the emulator from <path>/android-sdk/emulator/ instead of the one in <path>/android-sdk/tools/emulator
-
Andron about 2 yearsThese are the only instructions I've found that work. Set up a new emulated Pixel 4a device w/ Android 12.0, and I was able to update the hosts to access a local development server running on Vagrant. Thank you! (If anyone's curious, because of how Vagrant works I used the same IP I have in my host machine's
/etc/hosts
file: 192.168.56.5.