10

I try to mount /system in Android O to RW using the command mount -o rw,remount /system, and i got this feedback on terminal dev/block/dm-0 is read-only *Already in adb root

Any idea? Thanks

hellojoshhhy
  • 361
  • 1
  • 3
  • 9
  • Looks like dm-verity is in effect, which by the way can only be disabled by modifying the kernel if the OS is not a debug build. – Andy Yan Nov 20 '17 at 08:59
  • @AndyYan Hmmm, i tried disable-verity and it mounted successfully – hellojoshhhy Nov 20 '17 at 09:04
  • 1
    You should then put it as an answer. I do doubt that your build is a debug one though, you should probably look inside /system/build.prop. – Andy Yan Nov 20 '17 at 10:12
  • @JeffPang I agree with Andy. When setting up your answer, please include a short step-by-step guide – not everybody is familiar with that verity stuff :) – Izzy Nov 20 '17 at 10:17
  • Don't forget to accept your own answer :) – Andy Yan Nov 22 '17 at 01:18

1 Answers1

16

For debug build, user have to disable-verity at first.

adb root
adb disable-verity
adb reboot
adb remount
adb shell
mount -o rw,remount /system

In order to know build type of your android, in adb shell enter the following command

cat /system/build.prop | grep build.type
hellojoshhhy
  • 361
  • 1
  • 3
  • 9
  • after the adb reboot you will have to adb root again. Apart from that, works fine – Krystian Sep 10 '19 at 05:34
  • 3
    It should be: “only on debug build, user can disable-verity. – Irfan Latif Sep 10 '19 at 06:11
  • 2
    When I run adb reboot, the emulator goes offline permanently :( I can only restart it manually. – user3738870 Apr 12 '20 at 23:06
  • same issue as user3738870 ... – Gizmo Aug 16 '20 at 17:48
  • I noticed (using -shell option) that the VM is stuck in a reboot loop. [ 4.404721] EXT4-fs (vdd1): recovery complete [ 4.407789] EXT4-fs (vdd1): mounted filesystem with ordered data mode. Opts: [ 6.472377] cfg80211: failed to load regulatory.db [ 6.567761] reboot: Restarting system with command 'bootloader' [ 6.572103] reboot: machine restart [ 0.000000] Linux version 5.4.47-01061-g22e35a1de440 – Gizmo Aug 16 '20 at 17:58
  • 2
    since android 10/11 it's not possible, you have to create a tmpfs: https://medium.com/@anthony.f.tannous/android-10-emulation-of-magisk-supersu-on-an-aosp-avd-de93ed080fad – Gizmo Aug 16 '20 at 18:24
  • adb disable-verify did not work for me. I received an error: avb_ops_user.cpp:217: ERROR: Error writing data. avb_user_verity.c:205: ERROR: Error writing to partition 'vbmeta' Error setting verity – Eric Dec 20 '22 at 23:59