[MOD][EMMC][I9070/P][8/16GB] Internal Memory Repartition

Search This thread

gugav

Member
Mar 25, 2012
40
1
Sydney
hi, the files in attachments to download, are already modified?
if yes, as would be the 8GB version after the update ??

thanks
 

jineshpatel30

Senior Member
Nov 8, 2012
1,583
1,188
hi, the files in attachments to download, are already modified?
if yes, as would be the 8GB version after the update ??

thanks
yes file in attachmnet from above post is already modified.

it'll work for both 8GB & 16GB as it DOES NOT MODIFIES USB STORAGE.

so you will get 2.6GB in /Data patition but your USB storage remains same ( i think it's 3.4 GB in 8Gb version )

Use OP guide from which that script was built

( script form ace2 just for more reference if someone wants to change values in this script or add USB storage for more space BTW don't blindly copy those values bcz it's for ace2 not SGSA so use 1st post of this thread for SGSA partition details )

check and understand it.

you can also change values in script as per your requirement :)


how to use:

1. make Nandroid backup from recovery ( Must) ( it's Not optional )

2. Factpry reset and wipe cache & dalvik cache from recovery

3. flash script

4. wipe /cache , /dalvik-cache , /preload , /data ( if you get any error in /preload wipe ignore it )

5. restore only Data from Nandroid backup (use advance restore )

6. reboot



Use that file ONLY IF YOU ARE ON CUSTOME ROM i.e rom which does not require /cache & /preload partition at all !


some CM rom like CM10.1 use /cache partition as dalvik-cache storage so if you use that script on those rom your phone will stuck in boot-loop and you'll have to re-flash stock rom (4.1.2) with pit file for re-partition.

so use it if you are 100% sure what you are doing & your ROM will support it or not.

because Nandroid backup will not give you original partitions after wrong re-partition and you'll have to re-flash stock rom from scratch
 
Last edited:
  • Like
Reactions: #Henkate

No-Lags

Senior Member
Jun 5, 2014
108
45
new way to partition just by flashing a zip!!! and your data is not wiped! :)

f2fs is not suported. if you have f2fs /data you need to wipe data:
-data=3+wipe
it will wipe to ext4.

yes, -system=1 would work

for how to flash, read the docs.


edit:
you can also use -data=same++raw
to ignore and keep the contents of data, in case data is f2fs.

will work but CANNOT resize data.


Hi .. Lanchon .. Sorry I have to report back the results of my experiment some time ago. So I've done all the commands that are described in your github. But they have not succeeded.

The Chronology is:

  1. I have to change the file system from F2FS to Ext-4 (to avoid many problems) through TWRP. then;
  2. I still use parameters when changing the name tool.zip as I wrote in a previous post.
  3. lanchon-repit-20160317-system=1-data=3-cache=0.03125+wipe-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice
    then;
  4. Go to TWRP.
  5. When in TWRP I try to copy a file tool.zip (with configuration parameters that I have set before) to the / tmp folder. then;
  6. I also had unmount all the partitions first. then;
  7. Trying to install it via the / tmp folder that are on the system.

And the result was not working. :(
As can be seen in recovery.log (attached).

PS. I've tried several configuration parameters (according to the direction that has been written on github). But the result is still not succeed. Perhaps you could provide a new enlightenment.

Oh yeah I almost forgot what if repit process successfully, then we want to return to the default configuration parameters?

Log experiment with different configuration parameters are also added.

lanchon-repit-20160317-system=1-data=same-cache=0.03125+wipe-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice

lanchon-repit-20160317-system=1-data=3-cache=0.03125+wipe-preload=min+wipe-fota=min+wipe+ext4-sdcard=max++ext4-janice

lanchon-repit-20160317-system=1-data=3-cache=0.03125+wipe-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-i9070

Thank you in advance.
 

Attachments

  • recovery.log
    15.2 KB · Views: 6
  • logrepit23.zip
    9.2 KB · Views: 10
Last edited:
  • Like
Reactions: #Henkate

Lanchon

Senior Member
Jun 19, 2011
2,751
4,487
Hi .. Lanchon .. Sorry I have to report back the results of my experiment some time ago. So I've done all the commands that are described in your github. But they have not succeeded.

The Chronology is:

  1. I have to change the file system from F2FS to Ext-4 (to avoid many problems) through TWRP. then;
  2. I still use parameters when changing the name tool.zip as I wrote in a previous post.
  3. then;
  4. Go to TWRP.
  5. When in TWRP I try to copy a file tool.zip (with configuration parameters that I have set before) to the / tmp folder. then;
  6. I also had unmount all the partitions first. then;
  7. Trying to install it via the / tmp folder that are on the system.

And the result was not working. :(
As can be seen in recovery.log (attached).

PS. I've tried several configuration parameters (according to the direction that has been written on github). But the result is still not succeed. Perhaps you could provide a new enlightenment.

Oh yeah I almost forgot what if repit process successfully, then we want to return to the default configuration parameters?

Log experiment with different configuration parameters are also added.







Thank you in advance.


hi,

sorry i don't think i can't help you.

i don't understand you.
you talk about some strange "tool.zip".
i have no idea of what you are doing.
your 3 logs show that you never ran REPIT at all.
you posted here instead of in a github issue.

really, i don't think you understood the docs, and i certainly don't understand you.

im sorry.
 

No-Lags

Senior Member
Jun 5, 2014
108
45
hi,

sorry i don't think i can't help you.

i don't understand you.
you talk about some strange "tool.zip".
i have no idea of what you are doing.
your 3 logs show that you never ran REPIT at all.
you posted here instead of in a github issue.

really, i don't think you understood the docs, and i certainly don't understand you.

im sorry.

Previously I apologize if you can not understand it. I also can not understand how it could happen. Just as I try it again (this morning).

PS. tool_aka_scripts.zip is this:
lanchon-repit-20160317-system=same-data=3-cache=0.03125+wipe-preload=min+wipe-fota=min+wipe+ext4-sdcard=max-janice.zip

Edit: Just found a log file in the folder /cache/recovery/last_log (attached).
hope you can help me.

Thank In Advance..
 

Attachments

  • last_log.txt
    45 KB · Views: 8
Last edited:

waheem

Senior Member
Dec 10, 2014
487
87
@AntaresOne Wating for pit please will you ad a pit if you still have a repartition internal please create a pit and share with us
 

blacksuan19

Recognized Developer
Aug 7, 2014
768
1,742
kuala Lumpur
blacksuan19.dev
here:

https://github.com/Lanchon/REPIT

read the doc and configure it to your taste.
OK edited Janice.sh partition sizes as above
System 1000m
Datafs 1660m (moved to system)
I edited 2 tables my question is am I right and what table should I edit the first or the second one and should I touch the start end sector or resizing won't effect them

Sent from my GT-I9070 using Tapatalk

---------- Post added at 08:32 AM ---------- Previous post was at 07:43 AM ----------

yes file in attachmnet from above post is already modified.

it'll work for both 8GB & 16GB as it DOES NOT MODIFIES USB STORAGE.

so you will get 2.6GB in /Data patition but your USB storage remains same ( i think it's 3.4 GB in 8Gb version )

Use OP guide from which that script was built

( script form ace2 just for more reference if someone wants to change values in this script or add USB storage for more space BTW don't blindly copy those values bcz it's for ace2 not SGSA so use 1st post of this thread for SGSA partition details )

check and understand it.

you can also change values in script as per your requirement :)


how to use:

1. make Nandroid backup from recovery ( Must) ( it's Not optional )

2. Factpry reset and wipe cache & dalvik cache from recovery

3. flash script

4. wipe /cache , /dalvik-cache , /preload , /data ( if you get any error in /preload wipe ignore it )

5. restore only Data from Nandroid backup (use advance restore )

6. reboot



Use that file ONLY IF YOU ARE ON CUSTOME ROM i.e rom which does not require /cache & /preload partition at all !


some CM rom like CM10.1 use /cache partition as dalvik-cache storage so if you use that script on those rom your phone will stuck in boot-loop and you'll have to re-flash stock rom (4.1.2) with pit file for re-partition.

so use it if you are 100% sure what you are doing & your ROM will support it or not.

because Nandroid backup will not give you original partitions after wrong re-partition and you'll have to re-flash stock rom from scratch
How can I edit your script to move some of datafs to system??
 
Last edited:

Lanchon

Senior Member
Jun 19, 2011
2,751
4,487
OK edited Janice.sh partition sizes as above
System 1000m
Datafs 1660m (moved to system)
I edited 2 tables my question is am I right and what table should I edit the first or the second one and should I touch the start end sector or resizing won't effect them

Sent from my GT-I9070 using Tapatalk

---------- Post added at 08:32 AM ---------- Previous post was at 07:43 AM ----------


How can I edit your script to move some of datafs to system??

jeezas!!! you dont need to edit any *.sh file! you just need to read the docs for REPIT!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    Internal Memory Repartition


    Hey guys, after a very long time I show you the way to repartition your internal memory (EMMC).

    You can modify partitions as you want, increase data partition to install more apps, increase internal storage for media files...

    It's based on a little Linux binary called Parted, it's a part of CWM/TWRP recovery ramdisk.

    This means that you can repartition in any recovery of any 4.2/4.3/4.4 ROM.



    ==========WARNING==========

    Operations on EMMC partitions could be EXTREMELY DANGEROUS if you don't understand well what you do.

    If you touch wrong partitions (CSPSA, EFS, SBLs...) you can lose your IMEI or hardbrick your device (in this case only JTAG can save you) so...

    READ CAREFULLY!!!!!

    Responsibility is all yours, but if you follow well this guide you will not risk anything.

    Stock partition table is designed to be used in stock ROM, since it uses preload partition to store some system apps and needs bigger system (ROM is heavier than CM-based ones) and bigger cache partitions (more system apps=more dalvik-cache).

    This mod is compatible with any ROM except stock and stock-based.


    This is the stock partition table:

    4vlg14.png


    You can touch ONLY:
    Kernel2
    SYSTEM
    DATAFS
    CACHEFS
    HIDDEN
    FOTA
    UMS

    Kernel2 is the backup of stock kernel, we don't need it.

    SYSTEM is the /system partition (where the ROM is installed/stored).

    DATAFS is /data partition (default 1.97 GB where are stored installed apps, Android settings, contacts, messages... User data).

    CACHEFS is /cache partition (art/dalvik-cache is stored here, together with recovery logs/temporary files. In stock ROM here is stored also CSC. If you repartition to the minimum (at least 5 MB needed for recovery) you need to put dalvik.vm.dexopt.data-only=1 flag in system/build.prop

    HIDDEN is /preload partition (some Samsung TouchWiz system apps are stored here and symlinked with /system/app. This is a swap partition on MIUI v5, CM10.2 and all CM11/Omni 4.4 builds (these 4.4 before 15 June), also every custom ROM based on Canjica device tree 4.3/4.4 (always before 15 June), resize it to the minimum (128 KB to format it as EXT2).

    FOTA is Firmware Over The Air, so is needed to get OTA updates while on stock ROM, can be directly deleted.

    UMS is the internal storage (3.96 GB one), you can repartition this to have less/more space, or repartition to the minimum (8 MB or less, you will need to swap internal/external storages).

    Parted commands useful for us:

    rm (to delete a partition)
    mkpart primary (to make a partition)
    format (to format a partition, only in ext2)
    name (to rename a partition)

    For an extended list/explanation of commands, type "help" without quotes


    Let's go!

    First make a nandroid backup of your current ROM, to be restored after repartition

    If you touch UMS you will lose all the content of /sdcard (internal storage), so make a backup first!


    You need a Linux distro or Windows with ADB configured.

    Reboot device in recovery and connect to USB, then open ADB and write:

    Code:
    adb shell
    parted /dev/block/mmcblk0

    You can choose to display partitions as Gigabytes, Megabytes, Kilobytes (suggested), or Bytes by "unit **" command, where ** can be gb/mb/kb or b

    Now type "print" to display partition table.

    Parted create new partitions by following "Number", for example SYSTEM is 3, CACHEFS is 4 and DATAFS is 5 (for other partitions is the same), so when you create new partitions, you need to make them in order!! For example:

    SYSTEM is 3 and its size is from 105906KB to 747635KB

    CACHEFS is 4 and its size is from 2895118KB to 3215983KB

    DATAFS is 5 and its size is from 747635KB to 2895118KB

    The "end" of a partition is the "start" of the next partition

    As you can see, DATAFS is between SYSTEM and CACHEFS. This means that after you create SYSTEM, you need to calculate new DATAFS size that you want and then first create CACHEFS (at the end of calculated DATAFS size) then create DATAFS from the end of SYSTEM to the start of CACHEFS.

    To understand more:

    We will resize now CACHEFS from 320864 KB to 5000 KB gaining 315864 KB for DATAFS:

    Unmount /cache from recovery first!

    Code:
    rm 4 (to delete CACHEFS)
    
    rm 5 (to delete DATAFS)
    
    calculate now the new size of DATAFS, in this case add 315864 KB to DATAFS end: 2895118+315864=3210982 KB
    
    calculate now the new end of CACHEFS, in this case add 5000 KB to 3210982 KB: 3210982+5000=3260982 KB
    
    mkpart primary 3210982 (end of DATAFS and start of CACHEFS) 3260982 (end of CACHEFS, start of the next partition)
    Now we made a new partition, its number is 4. Do: name 4 CACHEFS
    
    It's time to make new DATAFS partition: from the end of SYSTEM to the start of CACHEFS
    mkpart primary  747635 (end of SYSTEM and start of DATAFS) 3210982 (end of DATAFS and start of CACHEFS)
    New partition has number 5, name it DATAFS by name 5 DATAFS

    Basically the method is this, you can apply it to partitions listed above.

    Remember to reboot recovery, go in Mounts and storage then (depending on what partitions you touched in Parted, excluding /preload) do the appropriate formats after repartition. Now you're ready to restore your nandroid backup (needs to have less size than new partitions) or install a ROM.

    I suggest an useful program to check partition size on Android, Partition Table

    If you touch HIDDEN partition and you are on 4.2 ROM or 4.4 builds after 15 June:

    Code:
    format
    y
    9
    ext2

    If you repartition UMS to the minimum, you will need to swap internal and external storages (MicroSD card will be the new internal storage):

    On 4.2 open system/etc/vold.fstab and replace the content with this:
    Code:
    # MicroSD as internal storage
    dev_mount sdcard0 /storage/sdcard0 auto /devices/sdi0/mmc_host/mmc1/mmc1
    
    # UMS as external storage
    dev_mount sdcard1 /storage/sdcard1 8 /devices/sdi2/mmc_host/mmc0/mmc0 nonremovable,encryptable
    
    # usbdisk
    dev_mount usbdisk0 /storage/usbdisk0 auto /devices/platform/msm_hsusb_host.0

    On 4.3 ROMs open system/build.prop and add these lines at the end of the file:
    Code:
    persist.sys.vold.switchexternal=1
    ro.vold.switchablepair=/storage/sdcard0,/storage/sdcard1

    On 4.4 ROMs just open NovaThor Settings and enable "Swap Storages"

    To restore original partition table flash stock ROM through Odin with "Repartition" enabled and correct PIT file for your model, in attachment (extract zip), soon CHN pits too

    I know that it's difficult to understand well the first times, but think at me that I developed this method, a lot of testing and bricks on bricks :D

    If you found this useful, you can support me at least by pressing "Thanks" or considering to offer me a beer, a coffee... Any kind of support will be very appreciated :cool:
    9
    Another reserved just in case!!
    7
    Reserved for "The PIT Zone" (soon available!) :cool:
    3
    new way to partition just by flashing a zip!!! and your data is not wiped! :)