64

adb remount does not work correctly on api 29 when running from the emulator. The command works fine on all other emulators that have been tried (18, 23, 25, 26, 27 and 28).

Any ideas why this might be?

Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
W Disabling verity for /system
E Skipping /system
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
/system/bin/remount exited with status 7
remount failed
user12090237
  • 643
  • 1
  • 5
  • 6
  • 8
    Thank god someone else is seeing this. Been trying to edit hosts file for an hour now and this is what I see every time I try to remount - and hosts file push doesn't work – mindfullsilence Feb 06 '20 at 06:40
  • 6
    FYI after seeing this comment I switched over to 28 (Pie) and it worked a treat. – mindfullsilence Feb 06 '20 at 06:45
  • @user12090237. Hi! See "Kidd Tang" answer with a solution which actually works. should be marked as the accepted answer rather than mine. – SDP190 Nov 26 '20 at 20:59

2 Answers2

63

I started the emulator with emulator -avd Pixel_3a_XL_API_29 -writable-system -no-snapshot-load

I found many ppl encounter emulator freeze and unable to start the android if you try

$ adb root
$ adb disable-verity
$ adb reboot   <--- By now emulator is freezed

Then you can try this

$ adb root
$ adb shell avbctl disable-verification  <--- this will not freeze the emulator
$ adb reboot

When the emulator restarted Try to remount will be no issue

adb root
adb remount 

adb push will be able to write on system directory

Kidd Tang
  • 1,821
  • 1
  • 14
  • 17
  • 1
    KiddTang: WOW! So great! Seems to work! So many people have bothered with that issue. This should be marked as the accepted answer. If I may ask however, how did you get there to find out that "adb shell avbctl disable-verification" indeed works? Is it documented somewhere? And why really is the above command different from: "adb disable-verity" which does cause emulator to freeze – SDP190 Nov 26 '20 at 20:39
  • 3
    forgot where did i get this while i was frustrated that many solutions on `adb disable-verity` and causing the emulator freeze and unable to start. Then randomly pick up this command somewhere and it works perfectly! there is very little resources talk about this which affect Android Q and above. Glad that it helps others :-) – Kidd Tang Nov 28 '20 at 02:28
  • 1
    Great! Finally working after 2 days :). One note - I have to "Wipe Data" in the AVD manager before running this for it to work. Otherwise, when I try to run with "-writable-system" it loads the emulator with a black screen. – penguinflip Dec 08 '20 at 10:44
  • 1
    This is the best answer that I have ever found! Thanks @KiddTang – J.J. Kim Dec 10 '20 at 14:52
  • After going through different answers on SO, this answer worked for me. Thanks. – HackRx Sep 18 '21 at 21:34
  • After trying to get /system writable for multiple sessions, this got it sorted. Thank you!! – David O Jul 18 '22 at 17:52
  • Worked perfectly! So the full procedure for changing host file if anyone is here for that is: start emulator from command line; root, disable verification & reboot; root & remount; pull /system/etc/hosts; make required changes; push – aksh1618 Jan 04 '23 at 08:36
17

Update:

See @KiddTang answer which seems to be an actual solution


  • This issue is still occurring now even with API 30 (API R)! And even when starting emulator with writable-system option: (emulator -writable-system -avd NAME_OF_DEVICE)!

    • I found there is an existing issue for it in Google's issue tracker.
  • I tried following these instructions to disable-verity and reboot before remounting

    • However this solution caused my emulator to freeze/hang, and never booting.

Note: I am experiencing the current issue when using the emulator with the "AVD" provided "Android Sdk Images". Its possible however that this kind of images are limited somewhat. So it might not occur for other types of Android Images


Summary of Code from Link:

  • This code did not work for my situation, as it causes the emulator to freeze and wont start after rebooting, however, they may work others.
    • See the link for additional details and caveats.
  • Use the following sequence to perform the remount.
$ adb root
$ adb disable-verity
$ adb reboot
$ adb wait-for-device
$ adb root
$ adb remount
  • Then enter one of the following sequences:
$ adb shell stop
$ adb sync
$ adb shell start
$ adb reboot
  • or
$ adb push <source> <destination>
$ adb reboot
  • Note that you can replace these two lines in the above sequence:
$ adb disable-verity
$ adb reboot
  • with this line:
$ adb remount -R

Note: adb remount -R won’t reboot if the device is already in the adb remount state.

SDP190
  • 336
  • 3
  • 10