5

I'm using Android Studio. I was trying to set up a dev environment and it requires modifying the 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 launched the emulator
  3. Then I tried following instructions from Stack Overflow. 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 was supposed 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
0

1 Answer 1

4

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

2
  • 1
    ... like the answer Yevgen has linked in question already does
    – alecxs
    Commented Dec 25, 2020 at 13:37
  • 1
    @alecxs yes. And the question is off-topic here in my opinion. Commented Dec 25, 2020 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .