47

I tried all the commands and suggestions available in stackoverflow and online but none worked

and many more but nothing works for me

I am getting below error - None of below commands are working.

$adb root
$adb disable-verity

For

$adb remount
remount of / failed: Permission denied
remount failed

So then I tried with different commands like

$ adb shell mount -o rw,remount /system
mount: '/system' not in /proc/mounts

$ adb shell mount -o rw,remount /
'/dev/root' is read-only


$ adb shell  mount -o rw,remount -t /dev/block/stl12 system
mount: 'system' not in /proc/mounts

$ adb shell "su 0 mount -o rw,remount /system"
mount: '/system' not in /proc/mounts

$ adb shell
$ su
# mount -o rw,remount /system

 mount: '/system' not in /proc/mounts
daveloyall
  • 2,140
  • 21
  • 23
Nirali
  • 13,571
  • 6
  • 40
  • 53
  • 1
    this might help you, as working for me with the same issue `https://github.com/d4rken/sdmaid-public/issues/2110#issuecomment-440325101` – Mohammed Sufian Sep 16 '19 at 13:26

7 Answers7

41

I had the same issue.The solution is to mount the root (/). After this you can write to /system.

mount -o rw,remount /

Don't forget to reset the state to 'ro'.

mount -o ro,remount /
26
> adb root
> adb shell avbctl disable-verification
Successfully disabled verification. Reboot the device for changes to take effect.
> adb disable-verity
using overlayfs
Successfully disabled verity
Now reboot your device for settings to take effect
> adb reboot
> adb root && adb remount
remount succeeded
> adb push ScreenCap.apk /system/app/
ScreenCap.apk: 1 file pushed. 33.1 MB/s (1640812 bytes in 0.047s)
> adb reboot
Gigazelle
  • 1,424
  • 1
  • 24
  • 34
Libin Jose
  • 277
  • 3
  • 2
  • 8
    On the second command, I get "/system/bin/sh: avbctl: not found" – David Gomes Oct 07 '20 at 22:39
  • 3
    `/system/bin/sh: avbctl: inaccessible or not found` – Vlad Apr 10 '21 at 12:46
  • 1
    The command `adb shell avbctl disable-verification` working for me during 2020, but now I get the same error of here above: "/system/bin/sh: avbctl: inaccessible or not found". I don't know why. – Sebastian Diaz Apr 14 '21 at 05:00
  • Probably the solution is pick up an emulator image that don't belong to Play Store (without that icon on AVD Manager into Android Studio). And with a "Q" Android version. Check here: https://stackoverflow.com/a/45668555/7191548 – Sebastian Diaz Apr 14 '21 at 05:11
  • Finally I found this worked answer. thank you a lot! – Huy Nguyen May 26 '21 at 02:37
  • Getting "avb_ops_user.cpp:217: ERROR: Error writing data" for the 2nd command – remondo Dec 13 '22 at 04:35
19

(Android Q Emulator solution)

> emulator -avd Pixel_3a_XL_API_30 -writable-system
> adb shell avbctl disable-verification
> adb disable-verity
> adb root
> adb remount
> adb shell "su 0 mount -o rw,remount /system"
niek tuytel
  • 899
  • 7
  • 18
8

If you are getting /system not in /proc/mounts error, your device system partition is not mounted with any directory. Writing to the system partition is restricted.

If you are using emulator please download previous version system image.

As of now, Android Q is not supported for writing the system partition so use android pie instead.

Magudesh
  • 419
  • 5
  • 13
  • 4
    This answer basically repeats the first one. The main problem with both is that lowering the API level is not a future-proof solution. Also, please include some source stating doing this is "not supported" on Android Q. – user3738870 May 01 '20 at 22:43
  • @Magudesh, where has it been stated that Android Q does not support writing to the system partition on a rooted device? – avelyne Aug 28 '20 at 09:55
  • @avelyne Rooting the android Q was supported in devices but not in emulator. If Android R released, rooting for android Q will be enabled. – Magudesh Sep 30 '20 at 13:19
1

You might want to check out the first answer of this thread.

To make it so that the error adbd cannot run as root in production builds does not pop up you have to choose an emulator system image that is not labelled "Google Play".

After that you have to run:

./adb root

Cold Boot your device once, then run:

% ./adb shell
$ su
# mount -o rw,remount /system

and you should be good to run any of the commands you had on your question.

For me I had to choose a Hardware without the "Play Store" logo under the Play Store column like in this photo:
(keep in mind that the UI of Android Studio might change) enter image description here

The Blind Hawk
  • 1,199
  • 8
  • 24
-1

I met this issue when working on rockchip tablet device running on Android OS 8.1. And I found a way to remount the /system to rw as the steps below:

  1. adb shell
  2. su
  3. mount | grep system
  4. After step 3 you will see the cmd print out this :

    /dev/block/mmcblk1p11 on /system type ext4 (ro,dirsync,seclabel,relatime,data=ordered,inod e_readahead_blks=8)

    (the type and path maybe different depend on your device)

  5. Now use the command:

    busybox mount -o remount,rw –t <-type> <-path> /system

In my case, <-type> is ext4 and <-path> is /dev/block/mmcblk1p11

Hope this can help someone!

Tung Ha
  • 32
  • 4
-3

I encountered this issue with Android API 28.

The walk-around was to use a lower version Android API level 24. After that everything works.

ADV

$ adb shell
generic_x86:/ # mount -o rw,remount /system
generic_x86:/ # exit
[~]
$ adb push /etc/hosts /system/etc/hosts
/etc/hosts: 1 file pushed. 2.2 MB/s (7458 bytes in 0.003s)
paradite
  • 6,238
  • 3
  • 40
  • 58