[MOD][TWRP][RECOVERY] Reclaim the whole free space of your system partition

Search This thread

Khaon

Senior Member
Apr 3, 2012
1,271
1,677
Louvain-la-Neuve, Belgium
Hello,

many users complain that since lollipop their system partition size doesn't reflect the actual system of the block device. Therefore, they can not install some extra in this partition( busybox, big gapps packages,etc.).

This is due to the system image size specified when building the rom:
One of the parameter of your system partition(which has been hardcoded in some config file, I.e. BoardConfig) is its size, but if the block device(i.e. the part of your internal storage that will be mounted for the system partition)'s size that is mounted is larger than the system partition's size than you will loose some space.


TWRP has included this feature into their recovery from 2.8.7.0 and onwards ! You don't need to get my flashable package if you got a newer version than this.


Fortunately resize2fs executable allows to modify an ext2,ext3,ext4 partition size:

linux man page said:
The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 only.).

This package simply resizes your system size to match the size of your block device size.
It does not alter your partitions table just reclaim the unmounted space.

Instructions:


  • Boot on a twrp 2.8.x.y TWRP recovery
  • flash the package


Download :


https://drive.google.com/file/d/0B9kxrJw-dzUmNG12QkdaU3R4Ujg/view


Credits :

@m11kkaa from whom I took the idea
 
Last edited:

CazeW

Senior Member
Nov 14, 2008
869
457
Lets see if I understood this correctly. Currently in Lollipop the system partition is smaller than the block where the partition resides? And if the partition size doesn't match the block size, you will loose the remaining space on the block? The remaining space on the block is not available to any other partition?
 
Last edited:

CazeW

Senior Member
Nov 14, 2008
869
457
Tried it and my system partition went from 643.7MB to 787.9MB in size on Lollipopalooza. That definetily helps with installing gapps as last time I had to leave off quite a few apps to get it to fit. So just to make sure, this extra space isn't taken from any other partition? It just made the system partition use the unallocated free space on the block?
 

Khaon

Senior Member
Apr 3, 2012
1,271
1,677
Louvain-la-Neuve, Belgium
Tried it and my system partition went from 643.7MB to 787.9MB in size on Lollipopalooza. That definetily helps with installing gapps as last time I had to leave off quite a few apps to get it to fit. So just to make sure, this extra space isn't taken from any other partition? It just made the system partition use the unallocated free space on the block?
Exactly.it corrects some internal ext4's variables that represents the size of fs to match the block's
Which app do you use to see partition sizes? How can I see what it is vs what it should be? Thanks.
There are plenty out there . I use fx embedded filesystem's analysis
 

tylerdurden83

Senior Member
May 28, 2011
1,196
227
Excellent! I have one more question. As we know, modifying the system partition means that otas will fail. So if before I had to uninstall say Play Movies to make room for busybox, then I'd have had to reinstall it if I wanted to flash an OTA. With this method, the md5 signature of system isn't altered, and therefore otas wont fail, right?
 

lepa71

Senior Member
Aug 25, 2010
1,220
153
Minneapolis
Do I need to do anything?
 

Attachments

  • Screenshot_2015-02-19-17-41-17.png
    Screenshot_2015-02-19-17-41-17.png
    227.3 KB · Views: 4,125

_Raziel666

Senior Member
Jun 15, 2011
727
209
Athens
You used my mod right ?

Best way is either issue

df in a terminal console or install this app

https://play.google.com/store/apps/details?id=com.cls.partition

It will display the actual filesystem size .disk info display the size of your ssd

Sent from my nexus 10.

Thank you very much for your mod.

I want to try it but I'm a little bit afraid. Do I lose any data? Will this affect the installation of other ROMs? I'm on stock now but I want to try some custom ROMs to decide. Do I have to use your mod every time I install a new ROM?

Thanks in advance!
 

Khaon

Senior Member
Apr 3, 2012
1,271
1,677
Louvain-la-Neuve, Belgium
You won't loose any data it will adjust the size of ext4 fs to the actual physical size of your partition.

Flashing a new lollipop ROM flashes a new system image which specifies the image size.

Our device system image size is defined here https://github.com/CyanogenMod/android_device_samsung_manta/blob/cm-12.0/BoardConfig.mk#L64

685768704 is 654 megabyte but your mmcblk0p8 partition mounted on /system is 800 mb.

Until this is fixed. Will open a ticket to increase this value but there are maybe few reason google chose 654.

And yes you must reflash it each to flash

Sent from my nexus 10.
 
Last edited:

lepa71

Senior Member
Aug 25, 2010
1,220
153
Minneapolis
Last edited:

Khaon

Senior Member
Apr 3, 2012
1,271
1,677
Louvain-la-Neuve, Belgium
I installed the app you said, but I didn't see any unclaimed space. Is your mod for stock ROM as well? I seem to have 644MB of space on the /system partition.

Sent from my Nexus 10 using Tapatalk
Well the maximum space you system partition can get is 800mb. The system of je partition number 8.

Thus you are looking space.

The resizes just fixes that

Read this post.

http://xdaforums.com/showthread.php?p=59016220

Sent from my Xiaomi MI2s.
 
  • Like
Reactions: _Raziel666

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    Hello,

    many users complain that since lollipop their system partition size doesn't reflect the actual system of the block device. Therefore, they can not install some extra in this partition( busybox, big gapps packages,etc.).

    This is due to the system image size specified when building the rom:
    One of the parameter of your system partition(which has been hardcoded in some config file, I.e. BoardConfig) is its size, but if the block device(i.e. the part of your internal storage that will be mounted for the system partition)'s size that is mounted is larger than the system partition's size than you will loose some space.


    TWRP has included this feature into their recovery from 2.8.7.0 and onwards ! You don't need to get my flashable package if you got a newer version than this.


    Fortunately resize2fs executable allows to modify an ext2,ext3,ext4 partition size:

    linux man page said:
    The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the filesystem is mounted, it can be used to expand the size of the mounted filesystem, assuming the kernel supports on-line resizing. (As of this writing, the Linux 2.6 kernel supports on-line resize for filesystems mounted using ext3 only.).

    This package simply resizes your system size to match the size of your block device size.
    It does not alter your partitions table just reclaim the unmounted space.

    Instructions:


    • Boot on a twrp 2.8.x.y TWRP recovery
    • flash the package


    Download :


    https://drive.google.com/file/d/0B9kxrJw-dzUmNG12QkdaU3R4Ujg/view


    Credits :

    @m11kkaa from whom I took the idea
    5
    Just reminding you, and thanks in advance! :good:

    This should resize your partition
    4
    That's correct. Your system partition is mounted with am 800 mb allocated space. Depending on your ROM ypou might loose some space.

    Here I got 437 mb of free space .

    Sent from my nexus 10
    3
    You used my mod right ?

    Best way is either issue

    df in a terminal console or install this app

    https://play.google.com/store/apps/details?id=com.cls.partition

    It will display the actual filesystem size .disk info display the size of your ssd

    Sent from my nexus 10.
    3
    Yes, if your system partition is already 800MB in size then you're already using the whole block.
    Diskinfo reports always 800mb. It not reliable for this 'hehe

    Sent from my Xiaomi MI2s.