[MAGISK][TWRP][ARM32/64][A8+]Universal Read Only to Read Write for android (RO2RW) | Auto converting SUPER "system partitions" to read/write mode

Add support for other CPU architectures?


  • Total voters
    40
Search This thread

dunhill_

Member
Jan 12, 2011
44
3
Hi,

I have tried the script via TWRP 3.6.2 on Samsung A51 (SM-A515F)

First time, it worked for Android 11 (OneUI 3 firmware A515FXXU5EUL3), I could make some changes for the partitions /system and /product

Then I used ODIN to flash Android 12 (OneUI 4 firmware A515FXXU5FVG3). The script did not successfully work via TWRP 3.6.2 . My phone did not boot properly, instead of that, my phone went to download mode for flashing firmware

I rolled back Android 11 via ODIN and the result is same as Android 12, not same as the fisrt time of Android 11.

Update: I have found out the mistake. After running the script for the first time for Android 11, the partitions /system and /product have been changed. If run it again, it will cause mistake as in the attached picture. So no need to run it again. I have tested via ODIN, not OTA

@ LeeGarChat: If you can, please add a checking method to the scipt. If the partitions /system already can be written then ignore something to prevent error.

Sorry for my English

Thanks in advanced
 

Attachments

  • Screenshot_2023-02-27-01-34-51.png
    Screenshot_2023-02-27-01-34-51.png
    169.6 KB · Views: 114
Last edited:

gckim250

Member
Nov 21, 2017
15
6
Thank you so much! I tried 3.7.2.1 on my A536N, it works!!

I chose 50% system expansion, No DFE, no remove, Force verify disable, recovery-flashable option.
My devices is rooted with magisk, and custom kernel, TWRP is installed.
Android version is 13
 
Last edited:

Eteon x

Member
Mar 17, 2023
15
1
Thank you so much! I tried 3.7.2.1 on my A536N, it works!!

I chose 50% system expansion, No DFE, no remove, Force verify disable, recovery-flashable option.
My devices is rooted with magisk, and custom kernel, TWRP is installed.
Android version is 13
Hello Senior I updated my Huawei p10 VTR L29 to latest version EMUI 9.1 I unlocked the bootloader before updating it and use TWRP to flash VTR AL00 on it but showing failed to mount ODM/cust/system/product..... I switched to use Chimera tool when flashing using the Chimera during the user interaction to hold power + up and down button the phone bricked and never power up again my PC recognise it in fastboot test point is working too.
I searched for solution on XDA found one called p10 unbrick I downloaded the archive provided called p10 revive follow the procedures when I run commands to flash system, product,cust.... It's showing error length partition. Can it be that the EROFS is stopping it from flashing?
please help.

Can I solve it with editing the update App
 
Last edited by a moderator:

firsthtc

Senior Member
Dec 27, 2007
149
16
I have S23+ with Magisk, no TWRP (and I would prefer not to install it, is requiring data wipe). I did installed RO2RW as Magisk module, I can prepare the image, but... how to flash it?
From Android recovery is not working, no Fastboot... Is there an option to flash it over Odin?

Update: I've tried, using last test version of ro2rw (3.7.3.0s) to flash the file (in a tar archive) with Odin, first as AP (but I got "Unassigned file" error), then as USERDATA (but the flash froze before actually starting to write - fortunately without bricking my phone).
Any idea?
@LeeGarChat ?
 
Last edited:

donkeyman1234

Senior Member
Dec 29, 2009
300
44
Huawei Mate 20 Pro
Sony Xperia 1 II
I have S23+ with Magisk, no TWRP (and I would prefer not to install it, is requiring data wipe). I did installed RO2RW as Magisk module, I can prepare the image, but... how to flash it?
From Android recovery is not working, no Fastboot... Is there an option to flash it over Odin?

Update: I've tried, using last test version of ro2rw (3.7.3.0s) to flash the file (in a tar archive) with Odin, first as AP (but I got "Unassigned file" error), then as USERDATA (but the flash froze before actually starting to write - fortunately without bricking my phone).
Any idea?
@LeeGarChat ?
Its a magisk module or flashed by twrp not meant to be flashed by odin.
 

gckim250

Member
Nov 21, 2017
15
6
I have S23+ with Magisk, no TWRP (and I would prefer not to install it, is requiring data wipe). I did installed RO2RW as Magisk module, I can prepare the image, but... how to flash it?
From Android recovery is not working, no Fastboot... Is there an option to flash it over Odin?

Update: I've tried, using last test version of ro2rw (3.7.3.0s) to flash the file (in a tar archive) with Odin, first as AP (but I got "Unassigned file" error), then as USERDATA (but the flash froze before actually starting to write - fortunately without bricking my phone).
Any idea?
@LeeGarChat ?
Did you try with modded odin?
If this not work, you have only one choice: using TWRP

 

firsthtc

Senior Member
Dec 27, 2007
149
16
Did you try with modded odin?
If this not work, you have only one choice: using TWRP

I've used Odin3 v3.14.4. It's probably not modded. If you have experience with it, please help.
Anyhow, not everyone wants to install TWRP and because Samsung is only using Download Mode with Odin this tool should be tested at some point for this too, right?
I'm willing to try :)
 

IamTheBRAVE

Senior Member
I've used Odin3 v3.14.4. It's probably not modded. If you have experience with it, please help.
Anyhow, not everyone wants to install TWRP and because Samsung is only using Download Mode with Odin this tool should be tested at some point for this too, right?
I'm willing to try :)
Hey, friend.
I used to have a samsung device, and in odin sometimes you'd need to make a Tar mixing two imgs together (like boot + vbmeta).
Is the img you created with module system only or a super img?
If system only, maybe extract one of your stock product or system-ext img then Tar them together.
Or if Super img, extract the content of it (product, system, vendor, etc) then tar them and flash.
Just a thought. Not sure it would work cause maybe the modified partitions will have different size than stock.
Hope this helps.
 

JedidroidX

Senior Member
Jan 30, 2015
194
69
it seems whenever I create the RW super and flash though twrp and/or fastboot there is no RW access and even a bigger problem it breaks the persist partition leaving the camera and fingerprint unusable. Is there a workaround for these issues? any info is much appreciated!

Oneplus 8T (TMobile variant) converted to EU via msm tool OxygenOS 13
 

Jurigag

Member
Feb 1, 2011
21
4
Damn, run it in twrp and I just have copy system_b.ext4. Waiting..., any ideas how long it will do it? Already 30 minutes passed or more and still waiting.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    But I can't actually write to any of them (system, product, vendor). Any idea?
    Apply choice 1
    1
    Fantastic! Thank you. Worked flawlessly.
    1
    I managed to apply successfully RO2RW to S23+, thanks to @LeeGarChat and you! :)
    And I did a "How to" also, to help people apply it more easily (see here: https://forum.xda-developers.com/t/how-to-root-23-and-have-full-access-to-system-partitions.4585399/ )

    Still, I found out that there is a partition, or maybe only a folder, where I still can't activate RW.
    Path is: /apex/com.android.adservices/

    Looks like this is a new advertising method/app from Google, added with Android 13.

    https://source.android.com/docs/core/ota/modular-system/adservices

    Can't be deleted after applying the latest version (3.7.3.0s) of RO2RW as this folder is still RO.
    Can you help?
    Or maybe @LeeGarChat ?
  • 17

    Read Only to Read Write for android (RO2RW)

    Update 03.01.2023 : Stable Beta v 3.7.2.1

    The first truly working script, original and unique in its logic for all devices with a SUPER partition

    Universal auto RO2RW | EROFS-2-RW | F2FS-2-RW by LeeGarChat

    27013307.png


    photo_2022-12-05_14-01-11 (1).jpg
    photo_2022-12-05_14-01-13 (1).jpg


    Short description:
    Converts EROFS, EXT4(RO), F2FS Super partition to RW

    Description:
    A simple utility to convert your Super partition to RW mode (Read/Write) As well as the expansion and distribution of free space for each section, depending on how much space is available in the original Super section.
    You can flash both via:
    1. TWRP: by using controls in the script: (Volume control (+) to switch, Volume control (-) to select) in this case, the new super RW is flashed directly.
    2. Magisk module: in this case you will need to go to the terminal and enter RO2RW, and a new RW-super.img will be prepared in the internal memory, you can choose both image output for FASTBOOT and RECOVERY.
    For these two modes, the creation of the original super as a backup is supported, the file will also be output to the internal memory as bak-super.img

    Do I need to format the data after installation?

    - No, it is not necessary in normal cases, this script does not affect encryption in the data section. But in some cases, it is necessary to do the date format, it is not yet clear how this is related, for example on Asus devices.


    Why do I need this script, for what and why; why do I, need it?

    - When your system partitions have read-only mode (RO), then you cannot integrate modifications directly into the firmware, (such as Viper4Android) as well as manually edit/delete files from system partitions. This script converts it in the case of F2FS and EROFS to EXT4, or forcibly in the case of EXT4 enables the "Read/Write" (RW) mode, and also expands partitions as much as possible.

    What are systems partitions?

    What are system partitions?
    - These are the sections that are located in the main container "super" (the script is focused only on devices with super), it includes system, product, vendor, etc., when mounting the system, the structure looks like this:
    System <--- In TWRP it is mounted as /system_root
    , in the system itself it is mounted as
    Code:
    / <--- The main mount point for system
    ├── /product <--- The main mount point for product
    ├── /vendor <--- The main mount point for vendor                            
    |
    ├── /system <--- Here are the main system files
    │   │
    │   ├── /system/vendor <--- Additional mount point for vendor
    │   │
    │   ├── /system/product <--- Additional mount point for product

    And by analogy with product and system, all other partitions, or other mount points. This can be viewed in the fstab file located in vendor/etc/
    Some files cannot be edited at the root, or even if they can be edited without RW, those modifications won't stick, because these are temporary files responsible for the operation of the kernel and the entire linux system, in this case android. For example, proc, or sys, if you open a clean image, or mount a system image, you will see that these folders are empty, and files appear there only after the system is started.

    Is ROOT required?

    - If you want to prepare a new super partition inside the system, then you need it, the firmware via TWRP does not need root.

    How does the script work in Magisk?

    - You need to install the archive via Magisk manager as a module, the script will tell you if you need to restart the device. Next, you need to launch the terminal and give it root rights with the command "su", Then enter the command "RO2RW" and the script will run, it will prepare an image of RW-super.img according to your choice and optionally backup the original super bak-super.img, these files will be located in internal memory, after which you need to them to a PC if it is a fastboot image, or flash it via TWRP as super img if the images are for recovery.

    What does S=40% SE=10% and so on mean?

    - This is the distribution of free space in the super between the partitions 'System=S' 'Product=P' 'System_ext=SE' 'Vendor=V' 'Other sections are there they are= OT'
    - For example: The whole system occupies a conditional 4.7 GB. The super partition always has a fixed size in the memory block on the device, for example, take the example with PocoF3, it has 8.5GB there

    Code:
    Super size 8.5-GB
    {1111111111,111111111111,111111111,11111,11111111,111111111111111,000000000000000}
       System    System_ext   Product   Odm   Vendor   Others if any   Unused memory
      2.2/2.2G   0.5/0.5G     0.8/0.8G  7/7M  1.2/1.2G    1/1GB           3.8~G
    - As you can see, there is unused space for the second slot in the section (In 99.99% of cases it is not needed for users with root), and we can use this space for expansion of the partitions, and for system, 40% of this free space will be distributed. For system_ext 10%, for other partitions, if there are any, conditional 10% will be divided between all of them

    RO2RW worked correctly, and the system started, but I can't delete or change files, what is the reason?

    - Perhaps you have some Magisk module installed that prevents you from doing this, for example OverlayFS.
    Also, the reason may be that your device is of the MTK family, in some models there is a restriction at the kernel level for changing system partitions, and therefore mounting in RW, you will not even be able to reinstall magisk on such devices from the system
    In this case, you open the way only to modding via TWRP

    Also, you need to use the latest version of a normal file manager, these are the ones I recommend:
    Solid Explorer File Manager
    Root Explorer
    MT manager

    RO2RW worked correctly, the system started, but in any section, for example vendor, there is little free space available, 2-10mb, can it be expanded somehow?

    In- That's how it will not be possible to expand a lot, this is due to the limitation of space in the super itself. System partitions occupy a certain amount of space in it, in response to "What does S=40% SE=10% and so on mean?" there is an example of how it works inside. So, perhaps your firmware weighs a lot, and there is simply not enough space in the super itself, you can fix it if you know what you are doing, you need to remove any garbage, applications from the system partitions.
    "/" is system, including "/system/
    "/vendor" is a vendor, including "/system/vendor", with the rest of the sections in the same way by analogy. Some partitions have a different mount point, this can be viewed in your fstab, it is located along the path /vendor/etc/*fstab*.
    So, you first need to delete something from the system partitions, after which, according to the configuration in RO2RW (it is available in config.txt inside the archive, or in the first choice when installing where "max expansion"), distribute the size according to percentages or a fixed size, i.e. flash ro2rw again, or generate rw-super one more time.


    Will RW disappear after the OTA software update?

    - Yes, in this case, after OTA, you need to boot into the system first, the process will take place, re-mark super for new data, after that you can make a new super through the system or through TWRP:
    1. OTA installation
    2. Reboot into the system
    3. Preparing a new super, or rebooting in TWRP
    4. Installing a new super via fastboot, or firmware the archive inside TWRP

    How to flash a file via fastboot?

    - You need to move the finished file from the phone to the PC, throw RW-super.img into the folder with fastboot/adb, switch to fastboot mode on the phone, and enter the command in the console on the PC "fastboot flash super RW-super.img".
    Read more about using fastboot in the branch of your device.

    What are the differences between the first 4 options and the rest when first selected in the script?

    - The first four expand the sections based on the maximum size of the super, the rest expand on a fixed scale for each section, for example, it is more logical for OnePlus to choose one of the first 4, since there are a lot of sections, about 8, and it will be very large size to expand each by the same 200 MB.

    I cannot delete or modify files from /system/app or from /product/app or from any other specific directory, but at the same time in this directory or I can create a file, and at the same time in the neighboring directory I can change files, the system is RW, how to fix it?

    - This happens due to the non-direct mounting of specific folders, it is called overlay filesystem, more about it here: https://wiki.archlinux.org/title/Overlay_filesystem

    It specifically mounts any folder read-only. At the moment, you can delete or change or add to this directory only via TWRP, having previously flashed RO2RW by selecting the LiteRW option.

    Or go to the terminal and write the commands:
    Code:
    su
    magisk --path

    The last command will show the path to the magisk directory, you will need to follow the path:
    "The path that the magisk --path command displayed"/.magisk/mirror/

    There will be partitions that Magisk mounts directly; by going to them, you will be able to change files without obstacles from OverlayFS.

    I have a device with 32GB of memory, I do not know which option to choose so that the memory does not suffer?

    - The super section occupies a fixed size in the device's memory and has already been marked up by the manufacturer, i.e. even if the system takes up a conditional 2 GB, super still takes up all its conditional 6 GB in memory, I wrote above about how memory is distributed in super.

    Why does the script at some point ask to delete some applications?

    - This means that the firmware weighs a lot, and after conversion to RW, it does not fit into super, my script suggests deleting some system applications, for example, in Chinese miui there are such stupid advertising things as TikTok, MiShop, etc. Applications are removed from temporary partitions that are being prepared for conversion to super, from the installed system you do not delete anything, well, if you only interrupt the process, after installing a new super, naturally the applications will disappear.

    So why should I redistribute something, I didn't understand. I don't care how the system distributes its "empty space" there, they are still not used by me for files, because it's still a system partition. Just need RW super in the same form as it is. That's all. Is it possible somehow without distribution?

    - No, you can't, because it won't be original anyway, it won't affect user memory, it won't affect the OTA process if the firmware is pumping FullOTA, only the process of light (incremental) updates that weigh from 2mb to 800mb on average will be prohibited, and the process will not become faster. And if you don't care, then don't you care that there is free memory in the system partitions? in any case, you can fix it through the config as you need and give 1% for all partitions, or 10 or less MB for all partitions.
    If all the tests turn out to be successful, I will start adding more features to the script, so I'm waiting for the tests, and also please fill out the Google form if RO2RW worked correctly or incorrectly, by doing this you help the development, as well as other people to understand how it works on their device and their ROM

    Do not PM me about the script and help without permission, write to the support group



    DOWNLOAD - SourceForge
    TG Group
    Telegram support chat for quick feedback

    Donate only TG link https://t.me/mfpupdate/47

    Credits:
    - Thanks to the first link in a Google search for" e2fsck --help" link for clarification on disabling RO
    - Many thanks to my own tests with the super section and the official Google utilits lpdump/lpmake/lpunpack as well as the --help menu for it
    - Many thanks to the first Google search result for explaining tune2fs and resize2fs
    - Thanks to the Magisk team for the BusyBox and bootctl binary
    - Thanks to the kory-vadim with UKA for the make_ext4fs bibary, and thanks help menu make_ext4fs
    - Thanks to SKKK for the erofs.unpack binary
    - Thanks all test users



    Please take the survey for more RO2RW statistics

    Also, the entire list from the survey will be available on this table
    3
    Good luck getting all the the instructions it is never just flash zip with this stuff and the telegram thread or whatever is probably the hardest telegram thread to figure out in all of telegram. I have over 200 telegram threads I watch normally you'll have pinned messages with download and another pinned message with instructions a to z laid. Not this guy you'll have to figure out the puzzle that is his way of doing things
    Just flash the zip in recovery?
    I have been into xda now for about 6 or 7 years. I was edger to learn and even built 3 custom roms back in android 9. Every year or 2 now google makes changes that are huge changes and I still find myself having to learn things like day 1 at times. The new EROFS kernels and roms is brand new I have no idea how they work. F2FS is samsung and thats one of the reasons I was interested because I have a tab s8 plus. The problem is for this to work it makes a copy of your super partition your system. I was trying to figure all of that out and they get pissed you dont understand all of it already. Well I tried flashing it on poco f3 because I thought I was on a RO rom because of EROFS and it failed and I had 13gb of img files in a couple of folders. It requires a lot of free space and if people have there phone filled up and start flashing it will fill it all the way up depending on how big your system is compared to storage. That should be mentioned its not.
    I have added a FAQ, if there are any more questions, I will expand the FAQ
    3
    Changes in the latest release: Stable Beta 3.7.0.0:

    - Fixed non-removable logs. (To delete old logs from versions 3.6.2.1 and below, go to the /data/media/0/NEO.LOGS directory and you can delete them, or in TWRP and delete them
    - Changed configuration logic for RW_SIZE and RW_SIZE_MOD parameters
    - Changed the logical chain of appearance of SELECT MENU when there was a request for mount2ext4 or continue without mounting
    - The logic has been completely redesigned, when in case of unsuccessful mounting, all partitions were not mounted, now everything will be mounted, except for unsuccessful ones during installation, only EXT4 is affected
    - Completely redesigned config.txt, a simple one will open it and be surprised
    Конфиг.png
    - Now added support for forced start of the script (FOR TWRP), just configure the config as you need, in case of any failure, the script will fall into an error, do not be afraid
    photo_2023-01-03_05-06-50 (4).jpg
    photo_2023-01-03_05-06-50 (3).jpg
    photo_2023-01-03_05-06-50 (2).jpg
    photo_2023-01-03_05-06-50.jpg
    - Added a parameter to the config to disable timeout for the volume keys, so that the script does not fall into an error when you do not press the button for a long time
    2
    Just flash the zip in recovery?
    Good luck getting all the the instructions it is never just flash zip with this stuff and the telegram thread or whatever is probably the hardest telegram thread to figure out in all of telegram. I have over 200 telegram threads I watch normally you'll have pinned messages with download and another pinned message with instructions a to z laid. Not this guy you'll have to figure out the puzzle that is his way of doing things
    2
    That is one of the reasons I trust lebigmac script, he is through and instructions are clear!
    I have been into xda now for about 6 or 7 years. I was edger to learn and even built 3 custom roms back in android 9. Every year or 2 now google makes changes that are huge changes and I still find myself having to learn things like day 1 at times. The new EROFS kernels and roms is brand new I have no idea how they work. F2FS is samsung and thats one of the reasons I was interested because I have a tab s8 plus. The problem is for this to work it makes a copy of your super partition your system. I was trying to figure all of that out and they get pissed you dont understand all of it already. Well I tried flashing it on poco f3 because I thought I was on a RO rom because of EROFS and it failed and I had 13gb of img files in a couple of folders. It requires a lot of free space and if people have there phone filled up and start flashing it will fill it all the way up depending on how big your system is compared to storage. That should be mentioned its not.