Disable Zram Magisk «90% Official»
If the "Swap" or "zram0" line shows 0 or is missing, it is successfully disabled. Why Disable It?
Before proceeding, ensure your device meets the following requirements to prevent system instability:
: Long-press your new disable_zram.sh file, open its Attributes/Permissions , and ensure it is set to 755 ( rwxr-xr-x ). It must be executable, or Magisk will ignore it. Restart : Reboot your phone to trigger the script. How to Verify That zRAM is Disabled
Before you proceed, keep the following hardware realities in mind: lululoid/LMKD-PSI-Activator - GitHub disable zram magisk
For testing before making a module:
: Visit a trusted repository and download the flashable .zip file for a zRAM or swap disabler module. Open Magisk : Launch the Magisk App on your Android device.
If your Android smartphone has 8GB, 12GB, or 16GB of physical RAM, your system rarely needs to swap data to prevent out-of-memory (OOM) crashes. If the "Swap" or "zram0" line shows 0
Create a script at common/post-fs-data.sh . This execution timing ensures we attack the system after vold has finished setting up zRAM. Android usually creates the zRAM node at /dev/block/zram0 . Copy and paste this script:
The most reliable way to disable zRAM systemlessly is to create a startup script within Magisk's service.d directory. Scripts placed here execute late in the boot process, allowing them to override the default kernel configurations set by your device manufacturer. Step 1: Create the Script File
Inside the disable_zram folder, create a text file named module.prop . Paste the following content into it: It must be executable, or Magisk will ignore it
rm -rf /data/adb/modules/disable_zram
This public link is valid for 7 days and shares a thread, including any personal information you added. This link or copies made by others cannot be deleted. If you share with third parties, their policies apply. Can’t copy the link right now. Try again later.
In the service.sh script (which executes late during the boot process), include these lines:
: A widely used Magisk module intended to kill both zRAM and physical disk swap at startup to preserve flash memory lifespan. You can source it directly from the rompelhd Swap-Disabler GitHub Repository .