adb remount permission denied, but able to access super user in shell -- android

173,220

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 pushing, 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.

Share:
173,220
IanO.S.
Author by

IanO.S.

www.threeblokesfromchina.com

Updated on July 05, 2022

Comments

  • IanO.S.
    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
    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
    Michael about 11 years
    Step 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
    MartinodF about 11 years
    Not 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
    Michael about 11 years
    Thanks, 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
    Matt Huggins about 11 years
    I'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
    MartinodF over 10 years
    @Jayesh No, you need to be rooted to run su. That's pretty much the point of rooting ;)
  • Jayesh
    Jayesh over 10 years
    ok, 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
    davejal over 8 years
    a little bit of explanation along with your code might go a long way
  • amitavk
    amitavk about 8 years
    Getting a "remount failed: no such file or directory"
  • Ciro Santilli OurBigBook.com
    Ciro Santilli OurBigBook.com over 5 years
    Yes, 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
    noname about 5 years
    I get mount: '/system' not in /proc/mounts on an emulator.
  • user924
    user924 almost 5 years
    adb root: device not found
  • Kemal Tezer Dilsiz
    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
    tigertang over 4 years
    @Kemal Tezer Dilsiz In API 28, I also got this
  • Kemal Tezer Dilsiz
    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
    tigertang over 4 years
    You can delete the answer if you don't want to carry with so many downvotes
  • tigertang
    tigertang over 4 years
    @Kemal Tezer Dilsiz, that only works for your emulator, rather than the real device.
  • Ash
    Ash over 4 years
    @KemalTezerDilsiz When I try to start my API 28 emulator using --writable-system, I get PANIC: Missing emulator engine program for 'x86' CPU. And I'm not even at the disco.
  • user3738870
    user3738870 about 4 years
    @PrzemysławSienkiewicz Same here. Nothing works with the newest emulator.
  • Michael Tolsma
    Michael Tolsma over 3 years
    adb disable-verity gives me an error of error:closed. Any fix for this?
  • Sebastian Diaz
    Sebastian Diaz over 3 years
    I doesn't work for me. After adb remount I get some writing data errors and finally a "remount failed".
  • Mario Codes
    Mario Codes about 3 years
    I also get mount: '/system' not in /proc/mounts with API 30, but it still works somehow when I connect to my database.
  • HackRx
    HackRx over 2 years
    Thanks man, it worked on android 11, IDK why they forgot to place the remount file under bin dir. :)
  • JiTHiN
    JiTHiN over 2 years
    Use the emulator from <path>/android-sdk/emulator/ instead of the one in <path>/android-sdk/tools/emulator
  • Andron
    Andron about 2 years
    These 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.