2

Help, I don't know what I did but after installing a custom ROM, I noticed that my system partition cannot be mounted as read/write.

I tried


"mount -o rw,remount /system" command on a terminal emulator, ADB shell, and TWRP terminal

The command shows no feedback showing failure (maybe I succeeded?)


Mount it using the built-in TWRP mount function.

The system check box can be checked out (it doesn't retain its check mark on reboot)


Some apps that actually works according to sources and reviews.

Some say (Failure to mount..) Some say (System mounted as rw) some doesn't have feedback.


I don't know what to do.

I noticed this when I installed a custom ROM. I tried using another custom ROM but same thing. Also reformatting doesn't help. I don't know if this occur on the stock ROM.


For reference

Device: Xiaomi Mi A2

Android version: Android 10

Custom ROM: AICP nightly build 15.0

1

Android 10 prevents apps or pretty much anything from mounting system as R/W. Yes, even if you are rooted.

Top John Wu, the creator of Magisk has covered this in a series of tweets. I will link them below for your reference. Your only way of tampering your system now would be using a systemless Magisk module. You can make your own or use some other module and inject files inside its folder before rebooting to apply that module.

  1. Just confirmed that the inability to remount system (the directory "/" in system-as-root) to rw is something new in Android Q, NOT an issue with the new system-as-root approach Magisk is using in the canary builds. Will have to investigate further to find out how to deal with it. Source: https://twitter.com/topjohnwu/status/1169720663201988611
  2. I found out that Android 10's system images are formatted with EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS. It will deduplicate blocks in the filesystem to reduce the image size. On my Pixel XL, the partition is physically not large enough to successfully run 'e2fsck -E unshare_blocks'. Source: https://twitter.com/topjohnwu/status/1170404631865778177?lang=en
  3. As clearly stated in the name of the feature, that EXT4 shared blocks feature is RO (read-only). The inability to disable this feature due to lack of free space in the partition (at least on my Pixel XL) makes it literally impossible to ever mount the system partition as rw. Source: https://twitter.com/topjohnwu/status/1170404633371525120
  4. I guess Google's justification to format partitions with this feature enabled is the introduction of overlayfs to "simulate" a writable partition. RIP to any mods or root apps that modify system. On Android 10 it seems system is either formatted as RO or using logical partitions. Source: https://twitter.com/topjohnwu/status/1170404634604658688
  5. BTW, just found this tidbit in Android's source code. They call these kind of filesystems "ext4 dedup". Other read-only filesystems they are aware of is squashfs (widely used in extremely constrained devices) and Huawei's EROFS. Source: https://twitter.com/topjohnwu/status/1170443615077666816

So, in short, you cannot R/W the system partition anymore with Android 10. The argument is just rejected.

| improve this answer | |
  • EXT4_FEATURE_RO_COMPAT_SHARED_BLOCKS would be a problem on devices originally shipped with Android 10 (due to Dynamic Partitions and hence small system.img). On devices upgrading to Android 10, custom ROM developers can (re-)build system.img without SHARED_BLOCKS. Or the user may try e2fsck -E unshare_blocks in TWRP. If the shortage of space is a problem, dump system.img to /data partition or external SD card or PC, remove block sharing (by resizing filesystem) and flash back to system partition. ATM I can't think of a reason for this to not work. Bigger problem is dm-verity. – Irfan Latif Feb 4 at 13:11
  • 1
    @IrfanLatif my Nokia 8.1 updated from Android 9 to 10 and it had this problem and that's when I discovered TJW's tweets. I tried with a custom ROM and dm-verity was out too. My experience with dm-verity is more about device denying to boot or marking it as corrupt/won't boot types. It shouldn't be the one causing R/W from not happening. But I believe you know more on that topic. I don't know how and in what ways custom ROM devs can sort this out, but the few GSIs I used had this issue and I can't expect many of modifications from a GSI. Let's see what the ROM developers achieve in the future. – singhnsk Feb 4 at 19:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.