www.chinaphonearena.com

Full Version: modding internal storage on newer mediatek roms (mt6732, mt6735, mt6752, mt6753, etc)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Tool tutorial guide how to repartition mt6732, mt6735, mt6752, mt6753
Preface

if you have a 64 bit chinaphone that is running android 4.4.4 or 5.0+ you may notice that the phone no longer uses the old MBR/EBR scheme when it comes to partitioning. luckily, a lot of the manufacturers are deciding to use a unified storage layout, like you see on the nexus phones, where you have a system partition and a userdata partition and the internal SD card is emulated... it is a folder in the userdata partition and is linked to the /sdcard folder. this has several benefits and several disadvantages to this. the main benefit is that since app storage is shared with data storage you have limitless room to install apps until your sdcard is full, you no longer have to worry about running out of application space while your internal data space remains near empty. the main downside is that the USB Storage option when you plug your phone is going to be gone. your only option for accessing data is going to be MTP. this is because the userdata partition (and therefore your emulated internal sd card) is formated as a linux file system, Ext4. android refuses to share this as a USB Thumbdrive, even if you are connecting to a linux computer.

anyway, as mentioned before, the phone no longer uses the MBR/EBR partition layout. if you inspect the sdcard, the phone has a true GUID partition table (which i will refer to as the GPT). this is really really really a good thing. you can read more about GPT partition tables here if you want [Only registered and activated users can see links Click here to register] but suffice to say, this is how modern partitioning is done on windows, mac, and unix computers.

so, why this tutorial? well some manufacturers have decided to stick with the old way of doing things. they are using the GPT partition table, but they are still splitting the phone in to a internal userdata partition and a seperate internal sd card. i'll tell you that it is a pain in the ass to change it to a unified storage solution. but with a little knowledge and a little hacking on the scatter file, it is quite easy to resize the internal storage so you can install more apps and shrink the near useless internal SD card partition.

requirements

you will need several things to do this:
  • a mediatek based android phone that has split storage running android 4.4.4 or more
  • a current version of spflash tools
  • a copy of your ROM for your phone that can be flashed with spflashtool
  • experience flashing ROMs (this isn't difficult, but it isn't for the faint of heart)
  • a recent backup (we will be wiping out everything on your phone, so you will have to restore your apps/data when you are done)
  • a calculator that can convert hex to decimal and vice versa.

procedure with example

first of all: i take no responsibility if you brick your device. this is a relitivly benign mod, but if it somehow fscks up your phone and you can't recover it, i will do my best to help, but i won't be buying you a new phone.

i am going to use the Kingzone Z1 for my example here. i'll add some pictures later if anyone needs it, but the code should be enough to let you figure it out.

after you have your backup and you downloaded and extracted your sp flashtool ROM image, open up the scatter file in a text editor. i use gedit whether i am on linux, windows, or a mac. i prefer it to notepad++. you can get it here [Only registered and activated users can see links Click here to register]. it doesn't much matter what you use, as long as it can read the file.

you want to search the file until you find the reference to the userdata partiton and the intsd partition. in the kingzone ROM it looks like this:

Code:
- partition_index: SYS19
  partition_name: userdata
  file_name: userdata.img
  is_download: true
  type: EXT4_IMG
  linear_start_addr: 0x61000000
  physical_start_addr: 0x61000000
  partition_size: 0x100000000
  region: EMMC_USER
  storage: HW_STORAGE_EMMC
  boundary_check: true
  is_reserved: false
  operation_type: UPDATE
  reserve: 0x00

- partition_index: SYS20
  partition_name: intsd
  file_name: fat_spare.img
  is_download: true
  type: EXT4_IMG
  linear_start_addr: 0x161000000
  physical_start_addr: 0x161000000
  partition_size: 0x0
  region: EMMC_USER
  storage: HW_STORAGE_EMMC
  boundary_check: true
  is_reserved: false
  operation_type: UPDATE
  reserve: 0x00

all address and sizes here are written in hex, so we are going to have to convert them to decimal, change them to whatever we want, then convert them back to hex.

lets look at the first value we need to change. if you look at the section titled - partition_index: SYS19 you will find that there is a directive partition_size: 0x100000000. this tells sp flash tool to make this partition called userdata, and have it have a size of 100000000 hex. if you go to [Only registered and activated users can see links Click here to register] we can easily convert the hex value, and we get 4294967296, which is 4.0 gb (4294967296/1204/1024/1024). easy enogh

important!!! do not make your internal storage size more then 12gb-ish. you need to have that internal sd card partition, and you do not have unlimited storage. out of the 16gb flash, you only have about 13gb left to split between app storage and the internal sd card. if you go to big you will either not be able to flash your phone, or you will bork it and and boot loop when you try to boot up.

so, lets say we thing 4gb is too small for apps, and we want more like 8gb available for apps. no problem. 4+4=8. then convert 8 gb to megabytes by multiplying it by 1024 three times: 8*1024*1024*1024 = 8589934592. now use that same [Only registered and activated users can see links Click here to register] to do a decimal to hex conversion, and you get: 200000000. so our first edit will be to replace the size of the partition_size: of the userdata section with 200000000 like so:

- partition_index: SYS19
partition_name: userdata
file_name: userdata.img
is_download: true
type: EXT4_IMG
linear_start_addr: 0x61000000
physical_start_addr: 0x61000000
partition_size: 0x200000000 <--edit here
region: EMMC_USER
storage: HW_STORAGE_EMMC
boundary_check: true
is_reserved: false
operation_type: UPDATE
reserve: 0x00

now we have to move the intsd card partiton. you will see that it has two lines in it giving start addresses: linear_start_addr and physical_start_addr. the values that are given are already the same. this partition starts right after the end of the last partition. it is pretty easy to calculate. we will take the start address of the userdata partiton and add the size of the user data partiton. they are:
Code:
physical_start_addr: 0x61000000
  partition_size: 0x200000000

you can't just add hex straight (though in this case you can). so lets turn to this [Only registered and activated users can see links Click here to register] to do the addition for us. 61000000 + 200000000 = 261000000. it is a straight edit here, but if you have some hex numbers in there, it might not be so simple. anyway, we edit the intsd partition to have these values

- partition_index: SYS20
partition_name: intsd
file_name: fat_spare.img
is_download: true
type: EXT4_IMG
linear_start_addr: 0x261000000 <--edit 1
physical_start_addr: 0x261000000 <--edit 2
partition_size: 0x0
region: EMMC_USER
storage: HW_STORAGE_EMMC
boundary_check: true
is_reserved: false
operation_type: UPDATE
reserve: 0x00

simple, hugh? now save your scatter file and start up sp flash tool. load your scatter file to flash your phone. the trick before flashing is you have to untick the box for "INTSD". why? well, in the Kingzone's case, it points to a file called fat_spare.img. this file is only 20676 bytes in size. but it is an Android Sparse Image File. what this means is that it is sort of a framework file. it contains a couple of bytes detailing the file system, how big it should be and what not, any small files that should be in there, but all of the blank space has been removed from it. if you convert this file to a regular filesystem image, it is 9gb in size. flash tool will try to flash this file, and it being 9gb, plus your new 8gb userdata partition (plus whatever else is on your phone), comes to over 17 gb. most likely your phone has a 16gb flash memory chip. so it will fail. sp flash tool will give you a warning about there not being enough room on your device, and you wont be happy. so just untick the intsd partition. it will still be created, and it will automatically be sized for whatever space is left. it will just be empty.

future

since the phone uses a GPT instead of MBR, live resizing of the partitions should be possible. i do it all the time on my raspberry pi's, without any data loss. a couple of guys and i have been working on this over at XDA with a flashable zip, but so far we haven't had any luck. if you want to try any of the beta zips, follow the thread at [Only registered and activated users can see links Click here to register]. there are some beta zips you can try, but either they have produced bricks or they have not modified storage. either way, it is going to work eventually, and i'll update this post when it does.

support

i hope i have been clear in this tutorial. if you have any questions, feel free to ask. if your scatter is different, and you need help modifing it, let me know, post it here, etc, and i will give it a go!

good luck!!
In case anyone is interested... we have a zip that actually appears to work. I caution you to backup fully before trying it as it still may wipe all your data, but if it works, it will give space to the app storage area and take it from the internal sd. You will loose everything on your internal sd card regardless.

Link [Only registered and activated users can see links Click here to register]

Save it to your external sd card, boot into your custom recovery, select install zip, select this zip, follow the prompts. Easy!

this has been tested on several phones (thl and kingzone) by several people and it has worked flawlessly so far! give it a try if you have split partitions and what to resize them!
Excellent. Stickied.
just a quick note no nomenclature: in this tutorial i refer to a lot of different things as 2 general parts of the android storage system: app storage, internal storage, internal sd card, userdata, intsd, etc. if you look at settings - > storage on your phone, the two things i am talking about are phone storage and sd card. app storage, internal storage, user data, etc all refer to phone storage. internal sd card, intsd, user storage etc, are all the internal sd card. what we hope to accomplish here is take storage space from the sd card and put it in to the phone storage space.
so here is the current script that you can flash to mod your internal storage. It has been tested a bunch of times on a bunch of different phone's with no issues so far. Put it on an external sd card, boot in to your custom recovery, and flash it. Follow the prompts. REMEMBER that your internal sd card will be wiped, so back it up. Your apps should be fine, but it wouldn't hurt to back them up too. [Only registered and activated users can see links Click here to register]. Happy modding!
Great. Used the Aroma auto package. Extended partition Mlais M4 to 10GB w/Carliv + your magic. Apps and data survived. Thanks much Alex.
(2015-08-18, 06:46)alexzap Wrote: [ -> ]just a quick note no nomenclature: in this tutorial i refer to a lot of different things as 2 general parts of the android storage system: app storage, internal storage, internal sd card, userdata, intsd, etc. if you look at settings - > storage on your phone, the two things i am talking about are phone storage and sd card. app storage, internal storage, user data, etc all refer to phone storage. internal sd card, intsd, user storage etc, are all the internal sd card. what we hope to accomplish here is take storage space from the sd card and put it in to the phone storage space.
hi i have a elephone p8000 16gb i want to make my 64gb sd card as internal can i do this
Thanks Alex, very interresting.
I am using "Symphony Helio S1", MT6753, MALI-T720, 64 BIT, Kernel no: 3.10.65, Android- 5.1.
I want to ROOT my device. But All pc & apk' apps are failed to do it. Many tools are ffailed and porting tools failed to create CUSTOM RECOVERY.img without Rooting. So i have 2 questions.........

1. How can i build a Custom Recovery.img without Root?
2. How can i ROOT my device?

N.B: I have official Firmware....

Plz help me someone.
I have used the zip file and it worked but when I used it 2nd time it showing "type password to decrypt storage " even factory reset didnt work
What should I do now

(2015-08-17, 10:03)alexzap Wrote: [Only registered and activated users can see links Click here to register]

Save it to your external sd card, boot into your custom recovery, select install zip, select this zip, follow the prompts. Easy!

this has been tested on several phones (thl and kingzone) by several people and it has worked flawlessly so far! give it a try if you have split partitions and what to resize them!

it works perfectly for first time but if u use it 2nd time it will screw your device
Pages: 1 2