Why "adb remount" retruns "remount failed" on Android emulator?


Question

I'm using Android Studio. I was trying to set up dev environment and it requires to modify hosts file. So,



  1. I created new devices in ADM (Nexus 4, Android 10 x86_64 without Google API and without Google Play).

  2. I lunched the emulator

  3. Then I tried following instructions from stackoverflow. I'm using Linux Mint so:


$ ~/Android/Sdk/platform-tools/.adb root

output:
restarting adbd as root

Okay, I got root:


$ ~/Android/Sdk/platform-tools/.adb shell whoami

output:
root

Then I suppose to remount and this is where I stuck:


 ~/Android/Sdk/platform-tools/.adb remount

output:
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
avb_ops_user.cpp:217: ERROR: Error writing data.
avb_user_verity.c:205: ERROR: Error writing to partition 'vbmeta'
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
W DM_DEV_STATUS failed for scratch: No such device or address
E [liblp]No device named scratch
[liblp]Partition scratch will resize from 0 bytes to 814587904 bytes
E [liblp]bool android::fs_mgr::WritePrimaryMetadata(int, const android::fs_mgr::LpMetadata &, uint32_t, const std::string &, const std::function<bool (int, const std::string &)> &) write 540 bytes failed: Operation not permitted
E [libfs_mgr]add partition scratch
Skip mounting partition: /product
Skip mounting partition: /product_services
Skip mounting partition: /product
Skip mounting partition: /product_services
W DM_DEV_STATUS failed for scratch: No such device or address
E Can not mount overlayfs for partitions: No such file or directory
Skip mounting partition: /product
Skip mounting partition: /product_services
E failed to remount partition dev:/dev/block/dm-1 mnt:/vendor: Read-only file system
E Consider providing all the dependencies to enable overlayfs
/system/bin/remount exited with status 10
remount failed

I don't know if remount is the critical issue, but i guess so. At the moment I don't have permission to modify /etc/. For example:


$ ~/Android/Sdk/platform-tools./adb shell "cp /etc/hosts /etc/hosts.bak"

output:
cp: /etc/hosts.bak: Read-only file system

Answer

Run Android Emulator with --writable-system commandline option in order to temporarily disable dm-verity. Then you can run adb remount.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes