[Question] Resizing partitions with TWRP - G3 Q&A, Help & Troubleshooting

I have a brand new G3 (D852) with Koodo that I just got 2 days ago. I've rooted, installed TWRP and flashed a few AOSP roms. Not a fan of any manufacturer UI, even though LG's is very minimal, so AOSP it is. I noticed that my system partition has more than 1GB of free space after everything is flashed and good to go. I also noticed that the latest TWRP (2.8.7.0) has a resize partition option inside the Wipe section. What I want to know is, how can I use this to resize the system and data partitions so that 1GB+ isn't being wasted and unused. I'd really like to get that 1GB+ added to my data partition for apps.
I've tried using it. The only time it didn't spit out an error was after I wiped the system partition. It succeeded in "resizing" it after that, but it didn't change anything. The system partition remained the same size.

ToYeD said:
I have a brand new G3 (D852) with Koodo that I just got 2 days ago. I've rooted, installed TWRP and flashed a few AOSP roms. Not a fan of any manufacturer UI, even though LG's is very minimal, so AOSP it is. I noticed that my system partition has more than 1GB of free space after everything is flashed and good to go. I also noticed that the latest TWRP (2.8.7.0) has a resize partition option inside the Wipe section. What I want to know is, how can I use this to resize the system and data partitions so that 1GB+ isn't being wasted and unused. I'd really like to get that 1GB+ added to my data partition for apps.
I've tried using it. The only time it didn't spit out an error was after I wiped the system partition. It succeeded in "resizing" it after that, but it didn't change anything. The system partition remained the same size.
Click to expand...
Click to collapse
This it why the option is there:
resize2fs feature: On some devices like the Nexus 6, the factory images include a userdata image that is the proper size only for the 32GB units. If you flash the factory image to a 64GB Nexus 6, the data partition will appear as if it only has the free space of a 32GB device. Using the resize2fs option, TWRP can resize your data partition to take up the full space available. The resize2fs may also be useful to resize system partitions on devices where custom ROM system images don’t take up the full partition space. Lastly, resize2fs may be useful in some cases to reserve the proper space at the end of a data partition for a full disk encryption key, should your partition be formatted incorrectly for some reason.

jeffrey268 said:
This it why the option is there:
resize2fs feature: On some devices like the Nexus 6, the factory images include a userdata image that is the proper size only for the 32GB units. If you flash the factory image to a 64GB Nexus 6, the data partition will appear as if it only has the free space of a 32GB device. Using the resize2fs option, TWRP can resize your data partition to take up the full space available. The resize2fs may also be useful to resize system partitions on devices where custom ROM system images don’t take up the full partition space. Lastly, resize2fs may be useful in some cases to reserve the proper space at the end of a data partition for a full disk encryption key, should your partition be formatted incorrectly for some reason.
Click to expand...
Click to collapse
Thank you for the reply
If I understand you correctly, the feature's original intent is to resize /data partitions in the event the rom/system image treats a larger storage capacity device as a lower capacity one, ie. 64GB device is treated like 32GB so /data will only reflect 32GB minus (system image install size), wasting 32GB and leaving it inaccessible to the user.
However, it also seemed like you were saying I also could use it to resize my /system partition to a smaller size so CM12.1 (with it's ~900MB install size after Full TK-Gapps) will only leave ~50MB to ~100MB on /system instead of ~1.5GB. However, the question remains. How do I do this and can I reallocate the ~1.5GB to the /data partition for apps and internal storage? If this can't be done then I see no point in resizing /system to begin with as it will still be inaccessible to me as the user.

ToYeD said:
Thank you for the reply
If I understand you correctly, the feature's original intent is to resize /data partitions in the event the rom/system image treats a larger storage capacity device as a lower capacity one, ie. 64GB device is treated like 32GB so /data will only reflect 32GB minus (system image install size), wasting 32GB and leaving it inaccessible to the user.
However, it also seemed like you were saying I also could use it to resize my /system partition to a smaller size so CM12.1 (with it's ~900MB install size after Full TK-Gapps) will only leave ~50MB to ~100MB on /system instead of ~1.5GB. However, the question remains. How do I do this and can I reallocate the ~1.5GB to the /data partition for apps and internal storage? If this can't be done then I see no point in resizing /system to begin with as it will still be inaccessible to me as the user.
Click to expand...
Click to collapse
I read a few things online and it seems you need aan unlocked bootlader, the G3 bootloader is not unlockable, so you are probily out of luck maby you can ask in the Q&A thread of the rom you are using.

Related

[Q] Arc's /cache partition

Hey,
I've got Arconium ICS rom installed on my Xperia Arc. I'm running low on internal memory, and while trying to find more space on the device I've found this:
Code:
Filesystem Size Used Available Use% Mounted on
/dev/block/mtdblock2 225.0M 1.1M 223.9M 1% /cache
So my question is - what is the cache partition used for on ICS? How big should it be? I found this in the description of some Nexus HD ICS rom:
Cache partition (/dev/block/mtdblock4) is only used by CWM.
Cache partition size is not important because the data partition (/dev/block/mtdblock5) is used as the cache space when running Android.
Click to expand...
Click to collapse
Of course partitions path varies, but the info seems to be relevant.
And a final question - fdisk doesn't seem to work (getting "fdisk: can't read from" error) - how do I go about changing partition table?
To my knowledge (based mostly on HTC phones), in normal use the cache partition is used for downloading apps prior to installing, and for downloading OTA updates (which is why it's so big).
If youre running custom ROMs then this partition doesnt need to be anything like this size, because youre not going to be installing OTA updates. HTC desire owners resize this down to as little as 5meg (though this seems low to me, IMO it should be at least as big as the biggest app youre ever likely to install, so i'd say 25-50 meg is a safer bet.
Now, i have no idea how CWM works, so if this is using the partition to perform installs or nandroid backups or something then your probably wouldnt want to make it much smaller.
There is also a lot of space which could be freed up on the system partition, particularly if youre using a stripped down ROM.
All of the above is all well and good, if there is a way of changing the Arc's partition table. I have no idea how this is done, or if it is even possible. So would love someone who knows about this stuff to respond. BUT: i very much doubt FDISK (you mean windows fdisk?!?!?) is the answer - at the very least i'd expect that you'd need a specially modified kernel in order to boot with a modified partition table. The fact that it fdisk with an error instead of giving it a try is probably the only reason your phone still boots.

TWRP 2.2.1.1 Backup help

I move old backups to computer then do a new backup.
Sent from my MB855 using xda premium
I'm only guessing but it may be possible that TWRP will only allow so much data to be stored in the TWRP folder. How much do you have stored there? Have you tried getting rid of some old backups?
Boot into TWRP, run the following commands...
adb shell parted /dev/block/mmcblk0 print
adb shell du -s /sdcard
The first will output the partition table details.
The second will tell you how much storage space you are using in the /sdcard partition.
I looked into this a bit in the past but never found clear info. First, as you are aware FFF Extended does some moving around of the partitions to load/unload your primary or alternate ROMs depending on what you are booting into. Root Explorer would give you partition information from within the partitions after FFF Extended has loaded the partition tables as needed for whichever ROM you are loading. TWRP isn't running from "within" one of your two ROMs and therefore it is likely that it does not see your partition tables the same as one or both of your ROMs would. Not much help I know, but I have read through most of the info on the FFF Extended wiki and the documentation isn't real clear on how it manipulates the /sdcard and partition tables as needed to dual boot.
danscxda said:
I looked into this a bit in the past but never found clear info. First, as you are aware FFF Extended does some moving around of the partitions to load/unload your primary or alternate ROMs depending on what you are booting into. Root Explorer would give you partition information from within the partitions after FFF Extended has loaded the partition tables as needed for whichever ROM you are loading. TWRP isn't running from "within" one of your two ROMs and therefore it is likely that it does not see your partition tables the same as one or both of your ROMs would. Not much help I know, but I have read through most of the info on the FFF Extended wiki and the documentation isn't real clear on how it manipulates the /sdcard and partition tables as needed to dual boot.
Click to expand...
Click to collapse
I think you might be a little confused about how FFFe works. The partition table is not a dynamic structure manipulated on the fly by whatever operating system loads at the time. The partition table is stored at a specific location on the storage space, so the device can determine how the storage space has been divided (partitioned). There's only one partition table and it can only be seen one way.
For Android ROMs, you typically need 4 different partition spaces for them to run... boot, system, userdata and cache. FFFe shrinks the media partition (typically called the /sdcard) by approximately 2 GB, then creates another set of these partitions... boot2, system2, userdata2, and cache2, in that space. An alt-ROM has to be specially modified to get the recovery to flash it into this alternate space and to get the booting system to mount the alternate partitions (system2, userdata2, and cache2) instead of the "normal" partitions (system, userdata, and cache). Once all of these have been set up correctly, you just need to have the bootloader select the desired boot partition (boot or boot2) and off it goes.
Hope that clears things up.

[Q] GB to JB - Reformat SD?

Currently running MikG3.11 w/a2sd so have a EXT3 partition for data (I have my /cache pointing there also). I'm looking to move to a JB rom (probably Evervolv - http://forum.xda-developers.com/showthread.php?t=1961602).
How do I need to re-partition my 16G sd to make the most efficient use? It's been quite a while so a quick 'step1,2,3 howto would be great..including suggested sizes, ext3/ext4...)
Recovery is SmelkusMod..
Thanks Tons!
You may not *need* to do anything out of the ordinary.
If your ext3 partition is of a reasonable size, you might be able to just wipe everything (except 'SD card') in smelkus, flash the ROM, and proceed from there. Nandroid first of course.
'Reasonable' means about 512 to me, others may have different ideas.
How big is your ext partition?
The main reason to repartition is if you are having mystery SD card issues or you want to add or resize partitions. If these don't apply, just wipe, flash, and go.
6100 using xda app-developers app
NxNW said:
You may not *need* to do anything out of the ordinary.
If your ext3 partition is of a reasonable size, you might be able to just wipe everything (except 'SD card') in smelkus, flash the ROM, and proceed from there. Nandroid first of course.
'Reasonable' means about 512 to me, others may have different ideas.
How big is your ext partition?
The main reason to repartition is if you are having mystery SD card issues or you want to add or resize partitions. If these don't apply, just wipe, flash, and go.
6100 using xda app-developers app
Click to expand...
Click to collapse
I would. Repartition, 0/1024, ext3, then ext4....i actually do this before any flash. Think about what a2sd does, and you'll realize that if you don't format, your system has to run through more dead data to get to the info it needs
Sent from my EVO 4G using Tapatalk 2
jwitt418 said:
I would. Repartition, 0/1024, ext3, then ext4....i actually do this before any flash. Think about what a2sd does, and you'll realize that if you don't format, your system has to run through more dead data to get to the info it needs
Sent from my EVO 4G using Tapatalk 2
Click to expand...
Click to collapse
/system 318 used out of 350mb
/data 369/428mb
/cache 1.38mb/160mb
sdcard ext3 .97 used, 1.79GB total.
sdcard fat32 (rest of the 16G)
I had thought that going ext4 was typically recommended for JB. Are you saying first create a 1G ext3, then the rest as ext4? How does that work for transferring files back and forth via usb to a win7 box?
I intend on doing this fresh.. ie, install gbapps and individual app re-installs from there.
I have a lot of opinions on this but let me just try to answer your one specific question about ext4.
(going from memory here, I'm sure someone will correct me if I'm wrong..)
When creating partitions in recovery, you will be prompted to allocate space to three separate partitions, swap, sd-ext, and 'the rest'. You have to choose a specific size for the first two, the third partition gets whatever is left. If you choose a size of zero when prompted, it will skip creating that partition.
So if you follow jwitts advice above, you will answer zero for swap, then 1024 for the ext partition.
This will skip the creation of a swap partition and create a sd-ext partition with size 1024. Initially you want to format this as ext2.
The rest of the SD card will go in the main sdcard partition and will be formatted as FAT.
As a last step you convert your ext2 partition to ext3 (and if you think there would be a benefit, you can further convert it from ext3 to ext4 in a subsequent step.)
Honestly, I installed evervolv over the exact same partition scheme you have already and have seen no need to tamper with it. Obviously others do. I leave you to make whatever decision you feel most comfortable with.
Partitioning is destructive: you lose all the contents of the entire SD card in the process so you need to make a backup first, and I don't mean nandroid. To me it's a bit more inconvenience plus the risk of losing irreplaceable data (ie pictures, music, etc).
By contrast, wiping partitions is routine and doesn't touch the main FAT partition. If you use smelkus to wipe your sd-ext partition (as implied in the oft-repeated advice to "wipe everything except 'SD card'") you should be starting with a pretty clean slate.
Maybe I've had the wrong understanding all this time, but I have been working under the assumption that "wiping" has the effect of deleting all the files below certain mount point.
The contents of your sd-ext folder are just as gone as if you "formatted". There may be other benefits to additional formatting or partitioning, and when you are planning to start from scratch, that can be a good time to do this sort of "preventive maintenance", but I was just pointing out that under normal conditions it is not strictly necessary.

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

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.).
Click to expand...
Click to collapse
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
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?
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
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?
Which app do you use to see partition sizes? How can I see what it is vs what it should be? Thanks.
CazeW said:
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?
Click to expand...
Click to collapse
Exactly.it corrects some internal ext4's variables that represents the size of fs to match the block's
lepa71 said:
Which app do you use to see partition sizes? How can I see what it is vs what it should be? Thanks.
Click to expand...
Click to collapse
There are plenty out there . I use fx embedded filesystem's analysis
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?
You are on aosp ?
Khaon said:
You are on aosp ?
Click to expand...
Click to collapse
Stock factory image + root, uninstalled Play Movies to make room for busybox
Do I need to do anything?
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.
Khaon said:
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.
Click to expand...
Click to collapse
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!
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.
If you replying to my question then I didn't do anything. I'm asking I should do it.
Is this only for CM based roms?
Thanks
Khaon said:
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.
Click to expand...
Click to collapse
lepa71 said:
If you replying to my question then I didn't do anything. I'm asking I should do it.
Is this only for CM based roms?
Thanks
Click to expand...
Click to collapse
any roms
Khaon said:
any roms
Click to expand...
Click to collapse
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
_Raziel666 said:
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
Click to expand...
Click to collapse
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://forum.xda-developers.com/showthread.php?p=59016220
Sent from my Xiaomi MI2s.
So mine shows 800 for system partition. Does this mean I don't have to do anything? Thanks
Khaon said:
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.
Click to expand...
Click to collapse
Don't use disk info but rather one of tje two over here.
Sent from my Xiaomi MI2s.
lepa71 said:
So mine shows 800 for system partition. Does this mean I don't have to do anything? Thanks
Click to expand...
Click to collapse
Yes, if your system partition is already 800MB in size then you're already using the whole block.

Partition resizing

I have 1.8GB of free space on my SYSTEM partition. Is there any way to shred that down so I can have more space on my DATA partition?
I'm running cm12.1 on my t805
slobodan0104 said:
I have 1.8GB of free space on my SYSTEM partition. Is there any way to shred that down so I can have more space on my DATA partition?
I'm running cm12.1 on my t805
Click to expand...
Click to collapse
As far as I know it is not possible because system partition size is fixed in source of the ROM. Theoretically it could be done but I am not sure if custom recovery also needs to be customised like ROM? I think best solution would be to buy large sdcard (64GB) ?
T.
Sent from my SM-T805 using Tapatalk
It is somewhat possible to resize partitions by adjusting the parameters in the pit file.
However how risky this is for the sake of what, 1.5gb, I don't know?
The better option, if you don't want to waste that space, is to use it.
Move your apps from user to system apps.
Its easy enough to do and can be accomplished with little effort using apps already available and with the bonus of gaining the extra space on the data partition.
Thanks guys. I just moved some of my bigger apps to system partition.

Categories

Resources