FORUMS
Remove All Ads from XDA

[Flashable zip] Magisk IMG Resizer

2,157 posts
Thanks Meter: 2,550
 
Post Reply Email Thread
Magisk IMG Resizer


By default, magisk.img is 64M in size, so the space in /magisk is approximately 64M too (thanks captain obvious 😑). If you flash a Magisk Module whose size is bigger than the current free space in /magisk, the update-binary automatically resizes magisk.img for the module to fit in /magisk. This is flashable zip (atm...) does the same thing, kinda 😶. It resizes magisk.img, which will also change the space available in /magisk so you can add more stuff into it.

This can be useful to some modules that occupies space if it's function is used (like @stangri's App Systemizer and my Terminal App Systemizer).

HOW TO USE:
  1. You can add your custom size in /data/.imgsize or /cache/.imgsize in MB. You can create and edit the file or do this command in TWRP's Terminal or ADB Shell.
    Code:
    echo '87' > /data/.imgsize
  2. Flash Magisk IMG Resizer zip

* To the guys who've read the update-binary, shut up! (jk 😂). I haven't touch anything that much and only made patches in the magisk module template's update-binary. I barely have time to do this thing this time of the year... so shut up! (just kidding.... 😂😂)
** Resizing will not be the same as the size you gave. Example, if you enter 87 in /data/.imgsize, the update-binary will calculate the size to be more than what you gave, in this case it'll resize it to 128M so more other stuff can snuck into the extra free space.
** The first thing you need to do after flashing/resizing is to occupy some space in /magisk. But don't make it full! Just add what you want to add so that magic_mask.sh doesn't do anything to magisk.img's current size.

Download
The Following 10 Users Say Thank You to veez21 For This Useful Post: [ View ] Gift veez21 Ad-Free
 
 
21st April 2017, 08:53 AM |#2  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,550
 
Donate to Me
More
reserved
21st April 2017, 08:54 AM |#3  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,550
 
Donate to Me
More
reserved #2
21st April 2017, 01:54 PM |#4  
Senior Member
Thanks Meter: 81
 
More
Z5 Premium, Magisk 11.6 (newest v12 doesn't work), works! Successfully resized to 256 MB
The Following User Says Thank You to the_brad For This Useful Post: [ View ] Gift the_brad Ad-Free
21st April 2017, 01:58 PM |#5  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,550
 
Donate to Me
More
Quote:
Originally Posted by the_brad

Z5 Premium, Magisk 11.6 (newest v12 doesn't work), works! Successfully resized to 256 MB

I have v12 and it works. Strange that it doesn't work for you. The first thing you have to do after flashing is to occupy the space, but don't make it full (I should add this to the OP 😊).
21st April 2017, 03:38 PM |#6  
Senior Member
Thanks Meter: 81
 
More
No, i can't use v12 at all (depends on something in the kernel, I use). Stock kernel works! Resizing should work on v12, too (if I used it)

Gesendet von meinem E6853 mit Tapatalk
21st April 2017, 09:41 PM |#7  
zexmunze's Avatar
Senior Member
Flag MUNZE TEBRA
Thanks Meter: 248
 
More
Note 4, Emotion os 7.1.2 using magisk v12 successfully resized to 128mb

Sent from my SM-N910F using Tapatalk
22nd April 2017, 05:19 AM |#8  
ahrion's Avatar
Retired Forum Moderator / Recognized Developer
Thanks Meter: 5,073
 
More
Doesn't magisk automatically resize the partition with the magisk template zips?
22nd April 2017, 06:22 AM |#9  
Didgeridoohan's Avatar
Recognized Contributor
Flag Gothenburg
Thanks Meter: 6,700
 
Donate to Me
More
Quote:
Originally Posted by ahrion

Doesn't magisk automatically resize the partition with the magisk template zips?

It does. But this probably has something to do with his systemizer module and not being able to systemize large apps because there's not enough space in /magisk.
The Following User Says Thank You to Didgeridoohan For This Useful Post: [ View ] Gift Didgeridoohan Ad-Free
22nd April 2017, 07:04 AM |#10  
veez21's Avatar
OP Senior Member
Flag Guess Where
Thanks Meter: 2,550
 
Donate to Me
More
Quote:
Originally Posted by ahrion

Doesn't magisk automatically resize the partition with the magisk template zips?

Yes it does. But if you want to put stuff in /magisk (like large apps or something else) without flashing a module, this can be useful
22nd April 2017, 06:40 PM |#11  
loserskater's Avatar
Inactive Recognized Developer
Flag Palmdale, CA
Thanks Meter: 4,447
 
Donate to Me
More
Quote:
Originally Posted by ahrion

Doesn't magisk automatically resize the partition with the magisk template zips?

To clarify a little bit, when installing a standard module zip the script gets the size of that zip and adds it to the magisk image size. This module basically tells magisk to not use the zip size but rather whatever size is in /data/.imgsize. So most zips work perfectly fine and you won't need to adjust the image size. There are a few small use cases where you need to adjust the image size after installing a zip. Like adding apps to be systemized that weren't included in the zip.
The Following 2 Users Say Thank You to loserskater For This Useful Post: [ View ] Gift loserskater Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes