• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[SCRIPT][Android 10+] Universal Mount SystemRW / SuperRW featuring MakeRW (read/write)

Search This thread

lebigmac

Senior Member
Jan 31, 2017
971
588
restore , you mean install firmware or what??
can you explain please im currently locked out of my phone with twrp saying data partition 0mb
should i format data or wipe everything or what should i do

Twrp should have avbctl binary by default.

Bash:
adb shell
avbctl enable-verity
avbctl enable-verification

Now fastboot flash your stock read-only super image to your super partition and you have just undone all changes that the script has done to your device. Congratulations.

If you ask me you shouldn't have installed that OTA since script was working fine in previous firmware version. Maybe Asus closed this R/W vulnerability in their latest OTA?
 
Last edited:
  • Like
Reactions: JimmyMX

JimmyMX

Member
Jun 29, 2012
37
9
36
Tripoli
Google Nexus 5
Huawei Nexus 6P
Twrp should have avbctl binary by default.

Bash:
adb shell
avbctl enable-verity
avbctl enable-verification

Now fastboot flash your stock read-only super image to your super partition and you have just undone all changes that the script has done to your device. Congratulations.

If you ask me you shouldn't have installed that OTA since script was working fine in previous version.
ok
thanx for the reply
im currently extracting payload.img
should i excute avbctl commands in twrp terminal or adb on pc
and can you give me the command to fastboot flash the super image exactly

and for the OTA i cant stay not updated updates bring battery improvements and secuity patches thats all


Edit: i executed the avb commands in twrp , i first ran the commands Get-
on slot a and slot b to know the status of dm-verity and verification slot a gave disabled and slot b gave enabled

and after that i rebooted to slot a twrp which is different than slot b twrp one is 3.1.51 and one is 3.1.52

then i rebooted into slot a system without flashing stock super img ,

now im back on android but the system is not rw anymore ,

what should i do now to get rw system ??

by the way your a life saver i cant thank you enough , but MAY THE FORCE BE WITH YOU ❤️❤️❤️❤️❤️❤️



and for the record this is exactly what happend to me a year ago when i told you i HAD to wipe , it was back then my fault not to ask for help

anyway thank you sir
 
Last edited:

JimmyMX

Member
Jun 29, 2012
37
9
36
Tripoli
Google Nexus 5
Huawei Nexus 6P
Hi All, It is odd but thats how it is working for me -

For phones with A and B partition , one way to make it work is upgrade both partitions to same version, make partition B as active and then run script fresh that will work perfectly.

Or just make partition B as active and then run script fresh that can also work.

When partiton A is active, this is the failure.

========================================================================

makesysrw: Joining all extracted images back into one single super image...
makesysrw: Please wait and ignore the invalid sparse warnings...


makesysrw: Error! failed to create super_fixed.img file


No change , only swap active partition to B , and it is success !!
========================================================================

makesysrw: Joining all extracted images back into one single super image...
makesysrw: Please wait and ignore the invalid sparse warnings...

Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic
Invalid sparse file format at header magic

makesysrw: Successfully created patched super image @
makesysrw: /data/local/tmp/makesysrw_1.24/files/super/super_fixed.bin
makesysrw: Congratulations! Your images should now be rw
makesysrw: Please reboot into bootloader and flash the file(s) manually
#

Slot swapping can be done from fastboot -
#command to check current active
.\fastboot.exe getvar current-slot

#command to swap , below will set active slot to b
./fastboot --set-active=b
hello
it is odd indeed
i tried this method on asus ROG III with a b partitions but everytime i set active slot to b and boot into recovery twrp is telling me that it cannot mount data and data partition is 0mb

do you have any idea about how to fix this
im running it on android 11 stock
thanx
 

Kira565

Member
Oct 13, 2021
10
2
"Be careful with this comment" Yesterday I published that the script worked very well on my motorola one fusion and yes and what I did later was change my bootanimation but after trying several it brikeo me and I tried to copy the original bootanimation and remove the one that I had placed but the recovery at the time of doing the process told me that it only had reading not writing and I gave it the option to mount but it only left me in reading I could not modify it in conclusion I had to install the software again since I formatted it And it did not work for me well I installed the android again today I already did it root I installed the recovery and now that I try to use the script again it gives me error # 73 both in the recovery and the manual installation I would appreciate if you can give me help on how use the repair.zip to see if it helps me fix my problem. Edit excuse my English I am using a translator. Again I would appreciate your help with that error 73 Thank you.
 
  • Like
Reactions: JimmyMX

lebigmac

Senior Member
Jan 31, 2017
971
588
Hi @Kira565 to fix error 73 use the included sysrw_repair script (linux only)
sysrw_repair script instructions



and for the record this is exactly what happend to me a year ago when i told you i HAD to wipe , it was back then my fault not to ask for help
A year ago this script didn't exist yet ;)



not working anymore on Android 12 Miui on Mi 11 Ultra :(
@season 8 @012345678 Did you try adding Android 12 support in script yet?
Simply add these 2 lines between line #403 and #404, save file and try again. Good luck!
Bash:
elif (( $sdkVersion == 31 )); then
        android=12



Lo probé en mi motorola one fusion y funcionó muy bien para mí, gracias por esa contribución.
Hello @Kira565 thank you for the nice words. Congratulations! I am happy that my script works well on your motorola one fusion device. Did you experience error 73 during the process?
Have fun optimizing and customizing your fully read/write-able device! :love:(y)

Please send me your log files from this location thank you! (y)
/data/local/tmp/systemrw_1.32/log/



Test in Pixel 2XL , Android 10 sucess! Thanks a lot!!!

130|taimen:/data/local/tmp/systemrw_1.32 # ./systemrw.sh
--------------------------------------------------
| SystemRW v1.32 automated script by lebigmac |
| @xda ©2021 Big thank you to @Kolibass @Brepro1 |
|@munjeni @AndyYan @gabrielfrias @YOisuPU @bynarie |
| without your help this would not be possible! |
--------------------------------------------------

systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: Google
systemrw: Current Android version: 10
systemrw: Current SELinux status: Permissive
systemrw: Unable to locate super partition on device. Ignoring
systemrw: /system is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is read-only
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
verification is already disabled on slot with suffix _b.
verity is already disabled on slot with suffix _b.
systemrw: Partition detected -> system_a @ /dev/block/sda7
systemrw: Dumping system_a to: /data/local/tmp/systemrw_1.32/nosuper/system_a.img
5242880+0 records in
5242880+0 records out
2684354560 bytes (2.5 G) copied, 29.424051 s, 87 M/s
systemrw: Successfully dumped system_a

systemrw: Current size of system_a.img in bytes: 2684354560
systemrw: Current size of system_a.img in MB: 2560
systemrw: Current size of system_a.img in 512-byte sectors: 5242880

systemrw: 'shared_blocks feature' detected @ system_a.img

systemrw: Increasing filesystem size of system_a.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_a.img to 819200 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_a.img is now 819200 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of system_a.img...
e2fsck 1.44.4 (18-Aug-2018)
systemrw: Read-only lock of system_a.img successfully removed

systemrw: Shrinking size of system_a.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_a.img to 132001 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_a.img is now 132001 (4k) blocks long.

=================================================

systemrw: Partition detected -> system_b @ /dev/block/sda8
systemrw: Dumping system_b to: /data/local/tmp/systemrw_1.32/nosuper/system_b.img
5242880+0 records in
5242880+0 records out
2684354560 bytes (2.5 G) copied, 29.835570 s, 86 M/s
systemrw: Successfully dumped system_b

systemrw: Current size of system_b.img in bytes: 2684354560
systemrw: Current size of system_b.img in MB: 2560
systemrw: Current size of system_b.img in 512-byte sectors: 5242880

systemrw: 'shared_blocks feature' detected @ system_b.img

systemrw: Increasing filesystem size of system_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_b.img to 819200 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_b.img is now 819200 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of system_b.img...
e2fsck 1.44.4 (18-Aug-2018)
systemrw: Read-only lock of system_b.img successfully removed

systemrw: Shrinking size of system_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_b.img to 614530 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/system_b.img is now 614530 (4k) blocks long.

=================================================

systemrw: Partition detected -> vendor_a @ /dev/block/sde14
systemrw: Dumping vendor_a to: /data/local/tmp/systemrw_1.32/nosuper/vendor_a.img
1024000+0 records in
1024000+0 records out
524288000 bytes (500 M) copied, 6.126449 s, 82 M/s
systemrw: Successfully dumped vendor_a

systemrw: Current size of vendor_a.img in bytes: 524288000
systemrw: Current size of vendor_a.img in MB: 500
systemrw: Current size of vendor_a.img in 512-byte sectors: 1024000

systemrw: 'shared_blocks feature' detected @ vendor_a.img

systemrw: Increasing filesystem size of vendor_a.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_a.img to 160000 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_a.img is now 160000 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of vendor_a.img...
e2fsck 1.44.4 (18-Aug-2018)
systemrw: Read-only lock of vendor_a.img successfully removed

systemrw: Shrinking size of vendor_a.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_a.img to 98513 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_a.img is now 98513 (4k) blocks long.

=================================================

systemrw: Partition detected -> vendor_b @ /dev/block/sde28
systemrw: Dumping vendor_b to: /data/local/tmp/systemrw_1.32/nosuper/vendor_b.img
1024000+0 records in
1024000+0 records out
524288000 bytes (500 M) copied, 5.473983 s, 91 M/s
systemrw: Successfully dumped vendor_b

systemrw: Current size of vendor_b.img in bytes: 524288000
systemrw: Current size of vendor_b.img in MB: 500
systemrw: Current size of vendor_b.img in 512-byte sectors: 1024000

systemrw: 'shared_blocks feature' detected @ vendor_b.img

systemrw: Increasing filesystem size of vendor_b.img...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_b.img to 160000 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_b.img is now 160000 (4k) blocks long.

systemrw: Removing 'shared_blocks feature' of vendor_b.img...
e2fsck 1.44.4 (18-Aug-2018)
systemrw: Read-only lock of vendor_b.img successfully removed

systemrw: Shrinking size of vendor_b.img back to minimum size...
resize2fs 1.45.4 (23-Sep-2019)
Resizing the filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_b.img to 98543 (4k) blocks.
The filesystem on /data/local/tmp/systemrw_1.32/nosuper/vendor_b.img is now 98543 (4k) blocks long.

=================================================

systemrw: Congratulations! Your image(s) should now have R/W capability
systemrw: Please reboot into bootloader and flash the file(s) manually
Hello @EveryYest thank you for your log file. It's unusual to have no super partition but WITH shared_blocks feature on all partitions!
Did you end up fastboot flashing all those .img files from the /nosuper/ subfolder? And phone actually booted afterwards? That is amazing news! I can't believe the script actually works on your Pixel 2 XL (2017) device!
Congratulations! Enjoy a fully read/write-able device! :love:(y)

Could you please run the code below and send me this file thank you (y) /sdcard/my_lpdump.txt
/data/local/tmp/systemrw_1.32/tools/lpdump>/sdcard/my_lpdump.txt
 
Last edited:
  • Like
Reactions: JimmyMX

JimmyMX

Member
Jun 29, 2012
37
9
36
Tripoli
Google Nexus 5
Huawei Nexus 6P
Hi @Kira565 to fix error 73 click here


A year ago this script didn't exist yet ;)

@season 8 @012345678 Did you try adding Android 12 support in script yet?
Simply add these 2 lines between line #403 and #404, save file and try again. Good luck!
Bash:
elif (( $sdkVersion == 31 )); then
        android=12
sorry for the misinformation , i got so exited and i had so much fun having my phone sysrw i felt it was a year maybe 😁😁😁😁😁 , anyway
trying out your linux method fix for the repair zip using linux mint
i will report that im currently waiting for the script to flash super_fixed.bin at bootloader 😵😵😵😵😵

it booted into bootloader but in terminal its saying waiting for any device and its taking so long ,
should i do something or should i wait???


Edit : things are happening ,

after the script sysrw.sh repacked the super fixed partition on linux it restarted to bootloader to flash the super partition but didnt finish i unplugged the phone and returned to windows and flashed the super fixed.bin via fastboot and finally it flashed all 21/21 in my case,

the command was : fastboot flash super super_fixed.bin
afterwards i rebooted into twrp and i re-enabled virity and verification on slot b then slot a
then i rebooted into android and BANG mount -o remount,rw / worked on terminal
and finally i have RW System on latest stock android 11 on asus ROG III

A/B partitions

thanx @lebigmac thanx @poyiqqq thanx @harpreet.s

😵 😵 😵 😵 😵 😁😁😁😁😁
 
Last edited:
  • Haha
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
971
588
@JimmyMX
Congratulations! I can't believe you actually got it to work in the end using the harpreet workaround :ROFLMAO:
What was the problem? Did you experience error 73 or what?
Could you please send me all your log files from this folder? Thanks! It helps with fixing bugs.
/data/local/tmp/systemrw_1.32/log/
Enjoy a fully read/write-able device! :love:(y)

You've been using the script for almost a year now? That's great! How do you like the project so far?
If you like this project and want to support further development of SystemRW & the creation of more amazing projects like this then please feel free to donate to the developer by clicking the Donate button on front page. Thanks! Your support is very much appreciated! (y)



Alguien ayúdeme. ¿Cómo ejecuto el script para el error 73 en una máquina virtual Linux?
Hi @Kira565 please see my reply to you here

Try this:
Extract sysrw_repair_v1.32_proper.zip on your computer
Open Terminal window inside this folder ./sysrw_repair_v1.32_proper/sysrw_repair_v1.32/
Make repair script executable: chmod +x ./sysrw_repair.sh
Execute the repair script in your Linux terminal app: ./sysrw_repair.sh
After repair script finishes you can fastboot flash super super_fixed.bin
 
Last edited:

Kira565

Member
Oct 13, 2021
10
2
[USER = 4712662] @JimmyMX [/ USER]
¡Felicidades! No puedo creer que al final lo hayas conseguido con la solución alternativa de Harpreet : ROFLMAO:
¿Cual fue el problema? ¿Experimentó el error 73 o qué?
¿Podría enviarme todos sus archivos de registro de esta carpeta? ¡Gracias! Ayuda a corregir errores.
/data/local/tmp/systemrw_1.32/log / [/ ICODE] ¡Disfrute de un dispositivo con capacidad de lectura / escritura! :amor:(y) ¿Has estado usando el guión durante casi un año? ¡Eso es genial! ¿Qué te parece el proyecto hasta ahora? Si le gusta este proyecto y desea apoyar un mayor desarrollo de SystemRW y la creación de proyectos más asombrosos como este, no dude en donar al desarrollador haciendo clic en el botón Donar en la página principal. ¡Gracias! ¡Tu apoyo es muy apreciado!(y) [HR] _ [/ HR] Hola, [USER = 11850077] @ Kira565 [/ USER], consulta mi respuesta [URL='https://forum.xda-developers.com/t/script-android-10-universal-mount-system-read-write-r-w.4247311/post-85816321'][B]aquí.[/B][/URL] Prueba esto: Extraiga sysrw_repair_v1.32_proper.zip en su computadora Hacer ejecutable el script de reparación: [ICODE] chmod + x sysrw_repair_v1.32_proper / sysrw_repair_v1.32 / sysrw_repair.sh [/ ICODE] Ejecute el script de reparación en su aplicación de terminal de Linux: [ICODE] sysrw_repair_v1.32_proper / sysrw_repair_v1.32 / sysrw_repair.sh [/ ICODE] Una vez que finalice el script de reparación, puede [ICODE] flash super_fixed.bin [/ ICODE] fastboot [/QUOTE] gracias hermano, pero no funciona para mí, no sé si soy yo, lo estoy haciendo mal, pero cuando lo ejecuto en la terminal de Linux, no me da, tal vez lo estoy haciendo mal, no saber mucho sobre linux
 

dna1982

Senior Member
Mar 12, 2011
100
30
Finally succeeded on OnePlus 8 Pro (Android 11 OOS_11.0.9.9.IN11AA).
But I still need to run "mount -o remount,rw /system_root" in TWRP to get /system_root to be writable.
Is this normal?
 
Finally succeeded on OnePlus 8 Pro (Android 11 OOS_11.0.9.9.IN11AA).
But I still need to run "mount -o remount,rw /system_root" in TWRP to get /system_root to be writable.
Is this normal?
Did the script run, and flash the super_fixed.bin file all correctly/successfully? If yes, then you don't need to run that from recovery. Termux or most other full featured terminal emulators work fine for this.
 
Last edited:

trunghaut1

Member
Oct 20, 2015
8
3
Ho Chi Minh
Successfully flashed on Redmi Note 10 Pro MIUI 12.5 android 11 without error. I can change /system to RW.
But I can only rename or delete files in /system, moving files to /system fails on Root Explorer app (magisk root), reboot is still working at this time.
Then I try to move the file in twrp file manager with "rw remount" command and it works, but my phone gets bootloop when reboot :((
 
Jan 11, 2018
37
5
Xiaomi Poco X3 NFC
Hi. I'm not surprised it works perfectly on Xiaomi Poco X3 NFC. That's the device I used to develop the script ;)
What do you mean it failed but still worked? Can you please show me your Orangefox error? Was it error 255? You can find recovery log file @ /tmp/recovery.txt or /sdcard/Orangefox/log.txt. Thanks!


If you see these errors after successfully running script that's completely normal. Those are TWRP related errors and I can't do anything about that!

Are you sure your Custom ROM... crdroid 7.10 cannot mount your partitions as R/W by default without running my script? Custom ROM's should be able to do that straight out of the box. If your custom ROM cannot mount your partitions as R/W then it's missing some important features. Just my 2 ¢
Yes I'm sure I'm on Crdroid 7.10......And it can't mount R/W without your script...
And the flashing error was my fault.... systemrw_1.32_flashable.zip and sysrw_repair_v1.32_proper.zip were in the same zip....
I flashed without extracting.
Thank You
 
  • Like
Reactions: lebigmac

lebigmac

Senior Member
Jan 31, 2017
971
588
Successfully flashed on Redmi Note 10 Pro MIUI 12.5 android 11 without error. I can change /system to RW.
But I can only rename or delete files in /system, moving files to /system fails on Root Explorer app (magisk root), reboot is still working at this time.
Then I try to move the file in twrp file manager with "rw remount" command and it works, but my phone gets bootloop when reboot :((

Hi @trunghaut1. Thanks for your feedback.
Congratulations! I am happy that script works as expected on your Redmi Note 10 Pro device running MIUI 12.5 (Android 11). :love: (y)
Please send me your log files from this folder, thanks (y)
/data/local/tmp/systemrw_1.32/log/*
Don't forget bootloop can always happen if you modify the wrong system file ;) Always make lots of backups! What kind of bootloop was it? Stuck at the MIUI logo?

It looks like you ran script without custom size parameter or with size=0. By default this will shrink each partition to minimum size before flashing super partition. Then you can only delete stuff from /system path but not copy stuff to it. You get the annoying insufficient space error in your file explorer app.
To fix this try running script again with larger custom size.
On Xiaomi devices size=25 or size=50 seems to work well. Good luck!

Enjoy a fully read/write-able device! :love:(y)



Finally succeeded on OnePlus 8 Pro (Android 11 OOS_11.0.9.9.IN11AA).
But I still need to run "mount -o remount,rw /system_root" in TWRP to get /system_root to be writable.
Is this normal?
First run script in TWRP, got 73 error. Then run repair script in Debian 11, create and flash super_fixed.bin file successfully.
Now you can debloat the hell out of it.
Hi @dna1982
Thanks for your feedback.
Congratulations! I am happy that script works as expected on your OnePlus 8 Pro device running (Android 11 OOS_11.0.9.9.IN11AA) :love:(y)

Error 73 is mysterious. It only happens on about 50% of devices I believe.
Please send me your log files from this folder. Thanks! (y)
/data/local/tmp/systemrw_1.32/log/*

Enjoy a fully read/write-able device! :love:(y)



Did the script ran successfully and flash the super_fixed.bin file all correctly/successfully? If yes, then you don't need to run that from recovery. Termux or most other full featured terminal emulators work fine for this.
Hi @Keven11 thanks for chiming in.
That's true. Script can be run both in Android and custom recovery mode ;) (y)



Yes I'm sure I'm on Crdroid 7.10......And it can't mount R/W without your script...
And the flashing error was my fault.... systemrw_1.32_flashable.zip and sysrw_repair_v1.32_proper.zip were in the same zip....
I flashed without extracting.
Thank You
Successfully flashed and working on Redmi 9 power (MIUI 12.0.10)
Flashed via Orange Fox
Hi @Ringsofsaturn777
Thanks for your feedback.
Congratulations! I am happy that script works as expected on your Redmi 9 power device running MIUI 12.0.10 - Android 11 :love: (y)
How did you like the script?
Please send me your log files from this folder. Thanks! (y)
/data/local/tmp/systemrw_1.32/log/*

Enjoy customizing your fully read/write-able stock Android device! :love:(y)
 
Last edited:

Hippie459MN

Senior Member
With the help of lebigmac in private chat, I got this somewhat figured out and the script ran perfect but my new Sony Xperia 1 iii does not have a custom recovery yet so I have to flash the file manually in fastboot/bootloader. Silly question, so I dont screw something up here, what would the proper flash command procedure be for this? Thanks.
 

xpxc

New member
Oct 28, 2021
3
0
systemrw: Initiating procedure...

systemrw: Device is in Android mode. Ignoring
systemrw: Current device: samsung
systemrw: Current Android version: 10
systemrw: Current SELinux status: Enforcing
systemrw: Unable to locate super partition on device. Ignoring
systemrw: /system is already R/W capable. Ignoring
systemrw: /product is already R/W capable. Ignoring
systemrw: /vendor is already R/W capable. Ignoring
systemrw: Adjusting permissions...
systemrw: Attempting to disable dm-verity and verification...
systemrw: Partition detected -> system @ /dev/block/sda22
systemrw: NO 'shared_blocks feature' detected @ system. Ignoring
systemrw: Partition detected -> vendor @ /dev/block/sda23
systemrw: NO 'shared_blocks feature' detected @ vendor. Ignoring
systemrw: There was a problem removing read-only restriction(s) of your device. Abort



He did not execute successfully
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Thanks and respect to sir Lebigmac for this awesome creation.

    It works on Redmi 9 Power (India variant)

    Over: MIUI 12.5.4 / 12.5.5 Android 11 (Xiaomi eu)
    Rooted: Magisk Canary - f822ca5b (patched boot image)
    Kernel: Stock
    Recovery: TWRP (XTRV)
    After flashing this script, I got my full super partitions as rw namely but not limited to /system; /system_ext; /product & /vendor respectively.
    THANK YOU AGAIN SIR!
    Feeling blessed.
    2
    Works on Oneplus 8 Pro with OOS 11.0.10.10 IN11BA.
    Good job thanks.
    2
    Can someone explain what does this script do? ELI15
    Do I need it on my OnePlus 7 Pro OOS 11.0.5.1?
    Hi @iamMG thanks for your interest in this project. By default Android 10+ devices have their partitions locked to read-only due to shared_blocks read-only feature. This script attempts to remove this shared_blocks read-only feature from your partitions. Enjoy!(y)



    Confirm, works on Oneplus 8 Pro with OOS 11.0.10.10 IN11BA.
    I needed use repair script. adb shell has no root access I modified it a little.

    Bash:
    adb_shell(){
      ./tools/bin/adb shell "su -c [email protected]"
    }


    Awesome job, thanks a lot.

    EDIT: I used munheni's superrepack tool and I socked on R/W /vendor but not writable. I've lost /vendor/etc/mixer_paths.xml than all audio. This lebigmac's script has fixed my phone!
    Of course file content has been restored from old backup.
    Hello @rysson_. I'm very happy that my script works smoothly on your Oneplus 8 Pro device with OOS 11.0.10.10 IN11BA firmware! Congratulations! (y)
    Thanks for sharing your optimization with me. I'm very new to bash scripting as you can tell :)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    This works on my moto g stylus 2021 android 11
    I just flashed the imgs files manually through my custom recovery that had fastboot mode
    And after I reboot vendor system and product are rw
    Hello @footjobs. Thanks for your feedback. I'm glad that my script works on your moto g stylus 2021 device with android 11 firmware! Congratulations! (y)
    Did you have to use the included sysrw_repair script at the end?
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    thanks for the tool
    I've been using it since Xiaomi.eu 12.5.18
    and now installed on 12.5.19 also working fine
    poco f3 xiaomi.eu rom v 12.5.19View attachment 5491695
    Hi @samy2015. Thanks for your feedback. I'm happy that my SystemRW script works well on your Xiaomi Poco F3 device with Xiaomi.eu 12.5.19 firmware! Congratulations! (y)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    Works on duoqin F21 pro, thanks. Still testing some things but it does work, i'm able to import/delete/edit in /system
    Hi @kaidok997. Thanks for your feedback. I'm happy that my script works as expected on your duoqin F21 pro device! Congratulations! (y)

    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    Works on Oneplus 8 Pro with OOS 11.0.10.10 IN11BA.
    Good job thanks.
    Hello @Johncaffee. You're welcome. Thanks for your kind words. I'm very happy that my script works smoothly on your Oneplus 8 Pro device with OOS 11.0.10.10 IN11BA firmware! Congratulations! (y) You've got the same device as @rysson_ above.
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)



    I flash the script using recovery mode and it succusfully installed and reboot
    It still say
    '/dev/block/dm-1' is read-only'


    There is log files
    Should i use bigger size??

    I want rw😭😭

    I have redmi 9 fully rooted with magisk
    Hello there, I tried this on Mi11x running AICP rom. Even after successful installation I don't see any difference in particular. I can only copy to the system/priv-apps when in android and it reverts to normal when I reboot. When in recovery it doesn't even see it as rw at all, keeps saying the partition is read-only. @lebigmac
    Hi @sarbazg180 @Peter1212 thanks for your interest in this project.
    Did you check if shared_blocks read-only feature was successfully removed from your partitions? See NOTE section in first post on how to do this.
    Please send me your log file to check for any errors. Thanks. You can find the log files here /data/local/tmp/systemrw_1.32/log/
    Did you try to remount your partitions as rw? And immediately after that run dmesg to catch the error. What was the result? Please show screenshot thanks. I'm afraid your device has some additional special read-only features :(

    Maybe if you're lucky next upcoming release version might fix your issue but I can't guarantee it ;)(y)



    @lebigmac first of all great work.
    I flashed a RW100 zip in 7t pro. Everything went as usual but ur code to test whether script works fails. Not in /proc/mounts is the reply.

    But I can copy/delete stuff from /system using total commander.😅.

    But unfortunately the OS is broken. Awkward bugs are happening here and there.

    So my question is can I make system.img rw before flashing on android. I want to do the job on windows to avoid too much write operation on phone nand after every OS update is release.

    Is it possible to do it on windows?
    Hi @Ayan Chakraborty thanks for your interest in this project. I'm happy that script works on your OnePlus 7t Pro device!
    If you send me your log files from script folder I can add you to the list of successful devices on first page ;)(y)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)

    You mean the code in the NOTE section first post How to check if script worked? What result do you get?
    Maybe this code doesn't work on older devices.

    Yes sometimes modifying the wrong system file can cause unstable system :D

    Sorry this tool is Android only (and the included sysrw repair script is Linux) only. If you want to do the job on the fly you can check out the amazing superrepack tool by @munjeni see first post for link. Have fun!



    Dear lebigmac,
    a BIG THANK YOU.
    It works, after a bit of struggle with the error code 73 I was able to run sysrw_repair file from a VM and Linux Mint. Everything was fine and automatic. After the parsing it rebooted to bootloader and flashed. It cost ca. 5 min. The file system is shown as ro, but it behaves like rw. As first I got rid of preinstalled YouTube. Nice.
    Moto g30, Stock ROM Android 11, Magisk, A/B, Ramdisk.
    Again, you helped to solve the biggest Android problem nowadays. Thank you for it.

    Update:
    One thing: I tried to change gpio-keys.kl in /system/... With x-plorer the permission set to 777. In system/usr/keylayout/ one can create/delete/change the files, but after every change they become empty, even if copied in here. The same after reboot. Apparently there is still a problem with the /system/ directory. Other things are superb.
    Any idea hjw to “fill“ a *.kl file?

    Tomas
    Hi @anglican007. If I had access to a Motorola device I'm sure I could fix error code 73 easily. I've already fixed it before on my Poco but that didn't fix it for Motorola devices it seems?!
    Thanks for your kind words. The solution was already out there. I only put the pieces of the puzzle together into one compact script (or 2 if you count that repair script lol).
    Can you successfully remount your partitions as rw now in terminal? That's awesome! (y)
    Enjoy debloating and customizing your fully read/write-able device! :love:(y)

    If you can only create empty files in /system that means you must run script again with larger custom size. Try again with something like size=50 for example. Good luck! Don't worry next upcoming version has auto-resize feature so you shouldn't encounter this problem anymore in the future ;)(y)

    What do you mean file system is shown as ro ? Even if you remount your partitions as rw in terminal?
    Please show screenshot thanks.

    What's a .kl file?

    I have one plus Nord and flash your script successfully and got rw system.
    But system/reserve folder still ro how to got rw in this folder. This folder has lot of bloatware.
    hi guys
    can you help me to change system/product R/O to R/W?

    system partition is R/W but system/product R/O and cant change

    my device : redmi note 10 pro max
    android : 11 miui : 12.5.8.9
    root method : magisk 23
    Hi again @Facebooook and hi @Pouya Rezaei thanks for your interest in this project.
    Congratulations for unlocking rw capability in your /system partition with the script! :love:(y)
    Please send me the output of your mount command
    Bash:
    adb shell
    su
    mount>/sdcard/mymount.txt
    Did you try to remount that path in question as rw? What was the result?
    ~ $ mount -o remount,rw /system/reserve
    mount: '/dev/block/loop6' not user mountable in fstab
    You forgot su command!

    HI, lebigmac and all others
    I think I cannot install OTA because of this script, is that so?
    Is the solution to flash repair zip and then install OTA and then I can run r/w again?
    Or any other solution?
    Thank you
    Hi @jis251 thanks for chiming in.
    Yes you can install OTA but this will remove your new RW features.
    After installing OTA you will have to run script again to get RW features back.
    Only use the included sysrw_repair script if you experience error 73!
    1
    And after I reboot vendor system and product are rw
    1
    SystemRW script worked successfully using manual method on AVD / Android 11 Emulator x86_64 (with arm64 support - Google API version), but can't find a way to flash the super_fixed.bin file on the emulator.

    AVD is rooted with Magisk v23 (by patching ramdisk using MagiskOnEmulator from github) and also tried directly using adb root and adb remount but same result.

    System Image: Android 11 (API 30) x86_64 Image with Google API support
    RAM: 4096 MB (4000 MB limit)
    Internal Storage space: 32768 MB (32 GB)

    I think, since system images can't be entirely modified (changes made to system are saved in system-qemu.img and system-qemu.qcow2 files instead of actually modifying the original image), I'll have to modify system.img file myself from system-images folder of android SDK directly.

    SystemRW Script created super_fixed.bin in /data/local/tmp/systemrw_1.32/img/ and worked successfully. So now I have to modify system.img but I only work on windows and have no idea how to modify these images. Sadly it won't be as simple as fastboot flash super super_fixed.bin like it is on actual phones.

    Since it's an emulator and I can try stuff without risks, I tried the script with
    • no size parameter (I don't know what the default size is)
    • size=15 parameter
    • size=50 parameter
    • size=65 parameter

    It worked well with all 4, generated super_fixed.bin but trying sizes greater than that, like 75 or above, doesn't work and says insufficient space.

    In summary - script generated a modified super image but now it needs to be pushed into the actual system image to work since AVD doesn't have fastboot or recovery.

    I opened the original system.img using 7zip on windows and I can see two files:
    system img files.png


    Any suggestions / advice / ideas on how I can do this? (preferably within the emulator itself for any linux commads I might need to use)

    Another thought I have is, I saw this specific line as output when using systemrw:
    Code:
    systemrw: Your super partition is located at: /dev/block/vda2

    Can I just flash that from within the emulator using lpflash? I read about lpflash here

    When I run
    Code:
    mount -o remount,rw /
    I get this as output:
    Code:
    '/dev/block/dm-0' is read-only
    Which means that super partition block (reported by script) - /dev/block/vda2 is NOT read-only and should be writable, which means I could try to modify it from within the emulator...

    Something like this in adb shell su:
    Code:
    /data/local/tmp/systemrw_1.32/tools/lpflash /dev/block/vda2 /data/local/tmp/systemrw_1.32/img/super_fixed.bin

    Or I could also try
    Code:
    /data/local/tmp/systemrw_1.32/tools/lpflash /dev/block/by-name/super /data/local/tmp/systemrw_1.32/img/super_fixed.bin

    Edit: Tried it, but lpflash gives an error - "error reading image file" even after converting between sparse / raw files
    Code:
    /data/local/tmp/systemrw_1.32/tools/simg2img /data/local/tmp/systemrw_1.32/img/super_fixed.bin /data/local/tmp/systemrw_1.32/img/super_fixed_raw.img

    At this point I guess I'll have to do this outside the emulator.

    Log files are attached (of the time I ran it without size parameter)
    Thanks again!
  • 121
    If you can't get this script to work on your device check out the brand new sophisticated superrepack tool by @munjeni


    logo_large.jpg

    SystemRW / SuperRW (feat. MakeRW) v1.32 by lebigmac
    NEW VERSION COMING SOON! STAY TUNED!;)(y)
    ANY TALENTED C++ DEVELOPERS WANT TO CONTRIBUTE TO NEXT VERSION PLEASE CONTACT ME NOW! THANKS! :love:(y)

    Creation date: February 2021
    Updated: August 2021

    Requirements:
    • rooted STOCK Android 10 or newer (custom ROM should already be R/W!)
    • at least 10+ GB free space on phone for dumping data
    Description:
    A script for all Android power users that wish to make their read-only Android 10+ system read/write-able again to remove bloatware and make more thorough customizations to their device.
    Script only modifies super and vbmeta partitions. /data partition is not affected. It's only used for dumping data and for storing script files.
    In a nutshell this is what the script is doing:
    • dumps your existing super OR your system / product / vendor partitions depending on whether or not you've got super partition
    • extracts embedded read-only partitions (system, vendor, product...) from super if applicable
    • makes these partitions read/write-able
    • joins everything back together to new super.img OR NOT depending on whether or not you've got super partition
    • flashes read/write-able images back to device using the super fast Kolibass technique (only in recovery mode)

    NOTE:
    • Before running this experimental software on your device it is recommended to make a full backup of your device (just in case you are unlucky enough to end up in an irreversible bootloop)
    • Extract BUNDLE.zip (the included sysrw_repair.zip is only for fixing error 73!)
    • The script can be run both inside custom recovery and inside Android operating system.
      If you run script in Android mode you will need to fastboot flash the patched image(s) manually!
    • To check whether or not you've got a super partition on your device you can run this command: adb shell "ls -l /dev/block/by-name/super"
    • To check whether or not your device has the notorious 'shared_blocks' read-only feature you can run these commands:
      Bash:
      adb shell
      su
      for a in /dev/block/dm-*; do tune2fs -l $a | grep "feat"; done
    • To check whether or not the script worked correctly you can run this code:
      Bash:
      adb shell
      su
      for a in /dev/block/dm-*; do mount -o remount,rw $a; done
    Manual installation:
    • Extract flashable.zip and copy systemrw_*VERSION* folder into /data/local/tmp/
    • run this command to make the script executable:
      chmod +x /data/local/tmp/systemrw_*VERSION*/systemrw.sh
    Automatic installation:
    Installation of the script has never been this easy!
    Download the flashable.zip below, do NOT enable zip signature verification and simply install it in your custom recovery (works in TWRP, OrangeFox and PBRP!)
    The installer binary will auto-detect whether or not your device has a super partition and launch the script accordingly with the proper command line arguments.

    Flashable zip custom usage:
    You can set these custom installation arguments in the included config.ini file.
    Simply extract the flashable.zip and modify the included config.ini file and then save the file. Then compress the systemrw_*VERSION* and META-INF folders again as a new .zip and install it in recovery.
    First line of config.ini contains the script arguments for those WITHOUT super partition.
    By default this line is completely empty (no space).
    Second line of config.ini contains the script arguments for those WITH super partition.
    For example if you already dumped your super_original.bin and want to skip that process next time you install the .zip then put this in line #2 of config.ini :
    in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` size=15
    Remember if you decide to use custom arguments in config.ini then the first character should always be an empty space. If no arguments are used such as by default in line #1 (no super) then the line should be completely empty, no space, nothing.

    Script usage:
    If you've got no super partition then simply call the script with no arguments from the shell (see examples below).
    If you've got a super partition I would recommend using the optional size=15 parameter as well to give some extra free space (in MB) to each partition.
    Optional script arguments:
    Replace x with your custom value
    • in=x *THIS IS IGNORED IF YOU'VE GOT NO SUPER PARTITION*
      With this flag you can specify an existing super image as input and skip the entire dumping of the super image process. Here you can use the super_original.bin which you dumped earlier with systemrw or the official unsparsed super.img from your downloaded firmware. (unsparse with simg2img). It's also possible to use your super partition block device as input.
      If omitted, systemrw will dump super image from phone to ./img/super_original.bin
      (path is relative to the script)
    • out=x *THIS IS IGNORED IF YOU'VE GOT NO SUPER PARTITION*
      With this argument you can specify the output path of the new patched super file.
      If omitted, default output value is ./img/super_fixed.bin
    • size=x *ONLY RECOMMENDED IF YOU'VE GOT SUPER PARTITION*
      With this parameter you can specify the extra free space (in megabytes) that will be added to each partition. There is a limit as to how much extra free space you can add per partition. Check your lpdump.txt to find out the exact maximum extra size.
      If omitted, default extra size is 0 (shrink to minimum)

    Examples:
    Bash:
    adb shell
    su
    cd /data/local/tmp/systemrw_1.32
    chmod +x ./systemrw.sh
    
    # Run this command *IF YOU'VE GOT NO SUPER PARTITION*
    ./systemrw.sh
    
    # Run this command if you're first time user *AND YOU'VE GOT SUPER PARTITION*
    # Specify the extra free space in megabytes for each partition:
    ./systemrw.sh size=15
    
    # Plug an existing super image into the script like this *ONLY IF YOU'VE GOT SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin size=15
    
    # Specify both the input file as well as the output destination *ONLY IF YOU'VE GOT SUPER PARTITION*
    ./systemrw.sh in=./img/super_original.bin out=./custom/path/super_fixed.bin size=15
    
    # EXPERT EXAMPLE:
    ./systemrw.sh in=`ls -l /dev/block/by-name/super | awk '{print $NF}'` out=./img/super_fixed.bin size=50

    Uninstallation:
    • To free up space and keep script as well as r/w capability you can simply delete /img subfolder at /data/local/tmp/systemrw_1.32/img
    • To delete script and keep r/w capability you can simply delete whole script folder at /data/local/tmp/systemrw_1.32
    • To undo all changes performed by the script you can simply reflash original stock read-only super image and re-enable dm-verity and verification either through adb/fastboot or with the included avbctl binary (inside /tools/ subfolder - also available in recovery).

    Troubleshooting:
    If you get error 255 in custom recovery when trying to install flashable zip then try to install it manually. If you encounter this error please send me this file /tmp/recovery.log
    Make sure the script folder was correctly extracted to:
    /data/local/tmp/systemrw_*VERSION*
    If you can't run the script try making the file executable like this: chmod +x ./systemrw.sh
    If you still can't get it to work run which sh in your shell and replace the shebang in the first line of the script with the output of that command. Don't remove the first two #! symbols though. Then save the file and try again.
    Make sure you have full read write access to the /data/local/tmp directory and that the containing files are not encrypted in custom recovery!
    If you get bootloop after successfully flashing super_fixed.bin then you can undo bootloop simply by re-flashing original stock super image and re-enabling dm-verity and verification with the included avbctl binary (inside /tools/ subfolder - also available in recovery). Those are the only changes performed by the script.
    Good luck!

    About:
    I did not come up with all this by myself. After searching for a solution for countless days without success, going even as far as learning hex editing - I accidentally came across a couple of very interesting threads burried deep inside the new forum interface where this method has been described by various enthousiasts (links can be found in the credits section below). Therefore I take absolutely no credit for the underlying core mechanisms of the script. I'm only the amateur who put it all together into a compact script so that everybody can enjoy an Android system that's read/write-able again. Just like it used to be in Android 9 or earlier. Before this annoying 'shared_blocks feature' was implemented.

    Credits:
    Huge thanks to @Kolibass for allowing me to use his partition tools for Android. Without your tools this script would not work on the Android platform! This genius also showed me how to flash a 5GB file to my partition in just under 30 seconds! Much faster than fastboot! I still can't believe it!
    Big thanks to @Brepro1 for allowing me to use his awesome tutorial and make it into a script. Without your tutorial guiding me I couldn't have created this script.
    Big thanks @munjeni for allowing me to use his superunpack V1 tool in the initial version. It helped me to understand how these super images work.
    Thanks @AndyYan your great tutorial also helped me a lot for automating the script especially the lpdump part.
    Thanks @bynarie for making available his otatools package! A part of it was bundled with the initial version which helped me to create this universal version. It's still part of the troubleshooting repair script to fix error 73.
    More thanks @gabrielfrias for his helpful comment
    Thanks @YOisuPU and of course @topjohnwu for discovering the 'shared_blocks feature'
    Thanks @HemanthJabalpuri for assisting me in optimizing the underlying algorithm!

    Disclaimer:
    #Disclaimer v2.0​
    This open source software is provided as is without any kind of warranty or support whatsoever.
    By using and viewing this software you agree to the following terms:
    • Under no circumstances shall the author be held responsible for any damages that may ensue from the (inappropriate) use of this software.
    • All responsibility, liability and risk lies with the end-user. You hereby agree not to abuse this software for illegal purposes.
    • Under no circumstances shall the comments & title section of the script (lines #1 - #65) as well as the included update-binary be modified or removed by the end-user without the original author's explicit consent.
    • Under no circumstances shall the end-user steal and / or abuse my entire SystemRW project or parts thereof (including but not limited to my update-binary, my script, my program logo, my program name or the names of my functions and my variables and more...) only to rename and republish my SystemRW project (or parts thereof) as his / her own without even mentioning original source or original credits!!! (yes this actually happened :( perpetrated by a fellow forum member...)
    • Unauthorized re-uploads of any files contained within this project to 3rd party websites are not permitted without the original author's prior consent! If you want to share this project with your friends just send them the link to this website. Thanks.
    • The end-user is allowed to improve the underlying algorithm (as long as no malicious code is added) and post his/her improvements, results and feedback right here in the official SystemRW project thread @ xda-developers.com
    • If the end-user wants to integrate my SystemRW project into his/her own project then he/she shall first ask me (the original author) for permission.
      If you want to make a video tutorial about my script please contact me first!
      Thank you! I can give you high resolution project logo and more!

    Please make sure to post your feedback and suggestions in the official thread right here.
    Enjoy customizing your fully read/write-able Android device! And feel free to share your Android system mods with other users in this thread! Thanks!


    v1-31d_01-jpg.5309953
    v1-31d_02-jpg.5309955
    v1-31d_03-jpg.5309957


    1-jpg.5235933


    Confirmed working on these devices:

    Download v1.32 mirror #1
    Download v1.32 mirror #2
    more official download mirrors coming soon!
    current status: experimental


    If you like this project and want to support further development of SystemRW/SuperRW & the creation of more amazing projects like this then please feel free to donate to the original developer by clicking the button below. Thanks! Your support is very much appreciated!
    Donate
    13
    If the script works on your device please send me your log files from this folder:
    /data/local/tmp/systemrw_1.32/log/

    And please write your phone model - Android version - firmware version

    Then I can add you to the list of successful devices and it will be helpful for further development. Thank you!(y)
    6
    New version 1.20 is ready! DOWNLOAD HERE
    Good news for those that don't have TWRP or couldn't get it to work in their TWRP. Now the script can also be run directly inside Android. Keep in mind that you will have to flash the patched images manually in this case using fastboot flash.

    The zip can still be flashed in TWRP (make sure zip signature verification isn't checked). This time I bundled my device's stock sh binary (which I used to develop the script) with the archive. Hopefully this will prevent avoidable sh-related syntax errors for some folks. The flashable zip installer update-binary automatically launches the script with the proper arguments using this bundled sh program (it's inside the tools subfolder).

    To those that were having difficulties running the previous version due to empty partitions or multiple partition groups inside their super : this has finally been fixed :D

    Please give this new version a try and let me know if it works for you or not and I will add it to the first post. Thanks for your feedback!
    5
    I try to redo the procedure, i want to change the size. but i get error, can't remove lock.

    Good news. New hotfix available HERE
    I got rid of that buggy get minimum size function and reworked the size querying algorithm a little bit. Should be more stable now.

    Next step will be to make the script compatible with those devices that have empty partitions embedded inside their super partition...
    Also ronnie was complaining about syntax error but I have yet to find the syntax error... If anyone finds it please let me know so I can fix it. Thank you!