Jump to content


Photo

[GUIDE] How to modify your partitions

- - - - -

  • Please log in to reply
21 replies to this topic

#1
D3abL3

D3abL3

    Addict

  • Members
  • PipPipPipPipPip
  • 597 posts
  • Gender:Male
  • Location:Trofa, Porto, Portugal
  • Devices:ZTE Skate, "virgin" SGS
  • Twitter:@D3abL3
Hello fellows, this guide is to help you and teach you how to modify your partitions size, specificaly system & data & cache partitions.
First of all we'll need an example to work with.
Get it here: http://dl.dropbox.co...428/Example.rar
This is a 200MB system & 205MB data & 35MB cache partition layout.(made by Amphoras)

You can use any HEX editor, but I'll be using HxD.
So let's open the partition_zte.mbn with our HEX editor, and we get the following(I get this in HxD):
Attached File  partition_zte_output.png   150.56KB   97 downloads

As you can see we have the partition names on the right side:
Recovery; Boot; Splash; Misc; Cache; System; UserData; OEM; Persist.

Let's say we want to edit the System partition, so we select on the right side "system" and it will highlight both the right side and the corresponding on the left side, like this:
Attached File  system_highlight.png   7.46KB   114 downloads

As we can see, after the highlighted selection in hex(left side) we have a lot of zeros(0), when the zeros end we will get a set of 12 characters with 4 zeros in the middle, like this:
Attached File  after_system.png   5.79KB   78 downloads

Let's write down this set of caharacters: 44 03 00 00 40 06
Every set of this will be in this format XX XX 00 00 XX XX, always with 4 zeros in the middle.
But we only need the last 4 characters, those correspond to that specific partition size: 40 06
Now we need to reverse this set so we can work with it: 06 40

Here's a table to convert Hex to Decimal:
Attached File  hex_dec.png   4.64KB   55 downloads

Let's convert this Hex set to MB:
Let's make 4 columns from 3 to 0.
| Column 3 | Column 2 | Column 1 | Column 0 |
And now we'll place each number in 00 28 to each column.
| Column 3 | Column 2 | Column 1 | Column 0 |
|----0----|-----6----|----4-----|----0----|
In the next step we should convert each hex to its corresponding decimal, but the numbers will look the same as you can see from the table attached to this post.
In the following step we multiply the each decimal for 16 elevated to the corresponding column number.
| Column 3 | Column 2 | Column 1 | Column 0 |
|-----0-----|-----6-----|-----4-----|-----0-----|
|-----0-----|-----6-----|-----4-----|-----0-----|
| 0*(16^3) |
6*(16^2) | 4*(16^1) | 0*(16^0) |
Now we write down the results and add them all together.
| Column 3 | Column 2 | Column 1 | Column 0 |
|-----0----|-----6----|----4-----|----0-----|

|-----0----|-----6----|----4-----|----0-----|
| 0*(16^3) |
6*(16^2)| 4*(16^1)| 0*(16^0) |
|-----0----|--1536---|---64----|-----0----|
The total here is 1600
Now we divide 1600 by 8 and we get the size in MB.
1600 / 8 = 200 MB
, our System partition has 200 MB.



How to do the inverse? MB to HEX? Easy!
Take the result from before: 200 MB
Multiply those 200 by 8: 200 * 8 = 1600
Now let's divide 40 for 16 and the remainders are our hexs.
1600 / 16 = 100
, here our reminder will be 0 as we can see: 0 * 16 = 0 <- This is our first Hex
100 / 16 = 6,25
, now let's keep the number 6 in our head and take only the value after comma(,), let's get our remainder: 0,25 * 16 = 4 <- This is our second Hex

6 / 16 = 0,375
, same thing as before, we keep the 0(zero) and take only the value after comma(,) to get the remainder: 0,375 * 16 = 6 <- This is our third Hex
0 / 16 = 0 , so the remainder will also be 0 <- This is our fourth and last Hex

We do the above process untill the remainder is less than 1.
Sow we have 06 40.
Now we need to switch places each pair so we get the hex we need 40 06.


So if you want to build a partition layout with 150MB you'll have to use the 40 06 hex value.

Now that we understand HEX let's make a partition layout using the above.
We should just touch system, data and cache unless you want to mess up your phone's partitions.
Let's use the above partition_zte.mbn where system has 40 06, data has 68 06 and cache has 18 01.
By the method above we can say that each partition is 200MB, 205MB and 35MB.

Let's say we want a system 150MB, data 250MB and cache 40MB.
We just need to convert these to HEX values using the method above:
150 = B0 04
250 = D0 07
40 = 40 01

So we go on our partition_zte..mbn and make the changes:
System: From 44 03 00 00 40 06 go to 44 03 00 00 B0 04
Data: From 84 09 00 00 68 06 go to 84 09 00 00 D0 07
Cache: From 2C 02 00 00 18 01 go to 2C 02 00 00 40 01

You must make this changes in appsboot.mbn as well, you can find it in the end of the file.
Attached File  appsboot_edition.png   163.03KB   37 downloads

Congratulations, you just graduated in HEX :lol:

Happy Math!


P.S.: You can always use Google, but here you have everything already ;)

Edited by D3abL3, 21 November 2011 - 11:23 AM.

  • 0

Did I help? Hit me a Posted Image Posted Image

Vote here please! :)

ADB Made Easy

Posted Image


#2
Amphoras

Amphoras

    Addict

  • Members
  • PipPipPipPipPip
  • 766 posts


So we go on our partition_zte..mbn and make the changes:
System: From 44 03 00 00 40 06 go to 44 03 00 00 B0 04
Data: From 84 09 00 00 68 06 go to 84 09 00 00 D0 07
Cache: From 2C 02 00 00 18 01 go to 2C 02 00 00 40 01


You need to change the offsets as well if you change the size of a partition, otherwise you are leaving random space between some and overlapping others.

In your above example, the partitions come in the order cache, system, userdata. You've made cache larger, so you have to make system start later. To get the new offset for system, you need to add the size of cache to the offset of cache: 022C + 0140 = 036C. So now system starts at 036C instead of 0344. You do the same to find out where userdata starts: 036C + 04B0 = 081C. So now userdata starts at 081C.

Now you go to partition_zte..mbn with these new values and make the changes:
Cache: From 2C 02 00 00 18 01 go to 2C 02 00 00 40 01
System: From 44 03 00 00 40 06 go to 6C 03 00 00 B0 04
Data: From 84 09 00 00 68 06 go to 1C 08 00 00 D0 07

  • 0

TPT Helper lets you easily repartition your ZTE phone, install a new ROM and for the Blade, convert to/from Gen 2. Available for Orange San Francisco/ZTE Blade, Orange Monte Carlo/ZTE Skate and Orange San Francisco II/T-Mobile Vivacity. https://market.andro...horas.tpthelper

TPTs and other apps


#3
Reaskawallah

Reaskawallah

    Newbie

  • Members
  • Pip
  • 9 posts
  • Devices:ZTE Skate Arcos 101
What are the benefits of modifying your partitions ?

  • 0
<a href="http://giffgaff.com/...e/reaskawallah" target="_blank"><img src="http://giffgaff.com/.../06_250x52.png" width="250" height="52" alt="Get a free Giffgaff Sim" /></a>

#4
dadashi

dadashi

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,157 posts
  • Gender:Male
  • Devices:MonteCarlo + HTC EVO 3D

What are the benefits of modifying your partitions ?


gain more storage space for more apps....

BUT, don't try it if you've never done it before and are not sure...

USE the partitions amphoras TPT's he's already made in his TPT thread...

  • 0
MonteCarlo + HTC EVO 3D

#5
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts
And why do we have only 440 MB? What takes the rest, and how much of each? Can't we change them as well?

Edited by atillaahun, 21 November 2011 - 01:43 PM.

  • 0

#6
D3abL3

D3abL3

    Addict

  • Members
  • PipPipPipPipPip
  • 597 posts
  • Gender:Male
  • Location:Trofa, Porto, Portugal
  • Devices:ZTE Skate, "virgin" SGS
  • Twitter:@D3abL3

And why do we have only 440 MB? What takes the rest, and how much of each? Can't we change them as well?


You don't have only 440MB, you have 512MB if I'm not mistaken.
But those 512MB are distributed through all the partitions: Persist, OEM, Splash, Boot, Misc, Recovery, Data, System and Cache.

@Amphoras: Thanks I forgot about the offsets.

Edited by D3abL3, 21 November 2011 - 02:18 PM.

  • 0

Did I help? Hit me a Posted Image Posted Image

Vote here please! :)

ADB Made Easy

Posted Image


#7
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts

You don't have only 440MB, you have 512MB if I'm not mistaken.
But those 512MB are distributed through all the partitions: Persist, OEM, Splash, Boot, Misc, Recovery, Data, System and Cache.

@Amphoras: Thanks I forgot about the offsets.


Okay, let's count than.

Data 205 MB
System 200 MB
Cache 35 MB
Boot 5 MB
Recovery 5 MB
OEM 1 MB


Than we have 451 MB, so these below are 61 MB if I want to get the 512 MB altogether.

Misc ? MB
Splash ? MB
Persist ? MB

What do they contain and why take up much space?
I suppose splash is just a picture, the misc would be the miscellaneous (for what exactly?), and persist would be the space for firmware?

Edited by atillaahun, 21 November 2011 - 04:09 PM.

  • 0

#8
Indiant

Indiant

    Regular

  • Members
  • PipPip
  • 63 posts
  • Gender:Male
  • Devices:Samsung Omnia, ZTE Blade&Skate

Misc ? MB
Splash ? MB
Persist ? MB

What do they contain and why take much space?



splash 1,5 MB - bootlogo
misc 0,5 MB ?
cache 57,5 MB -cache
system 200 MB - android
userdata 162,5 MB -data
oem 21 MB -maybe for photos without sd
persist 1,5 MB ?

Together 454,5 MB

  • 0

#9
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts

splash 1,5 MB - bootlogo
misc 0,5 MB ?
cache 57,5 MB -cache
system 200 MB - android
userdata 162,5 MB -data
oem 21 MB -maybe for photos without sd
persist 1,5 MB ?

Together 454,5 MB


And what about the other 512-454,5= 57,5 MB, and recovery and boot?

Edited by atillaahun, 21 November 2011 - 04:13 PM.

  • 0

#10
D3abL3

D3abL3

    Addict

  • Members
  • PipPipPipPipPip
  • 597 posts
  • Gender:Male
  • Location:Trofa, Porto, Portugal
  • Devices:ZTE Skate, "virgin" SGS
  • Twitter:@D3abL3

Okay, let's count than.

Data 205 MB
System 200 MB
Cache 35 MB
Boot 5 MB
Recovery 5 MB
OEM 1 MB


Than we have 451 MB, so these below are 61 MB if I want to get the 512 MB altogether.

Misc ? MB
Splash ? MB
Persist ? MB

What do they contain and why take up much space?
I suppose splash is just a picture, the misc would be the miscellaneous (for what exactly?), and persist would be the space for firmware?


I just read all values in this TPT and in Portuguese Stock TPT.
This TPT:
Recovery 5 MB
Boot 5 MB
Splash 1.5 MB
Misc 0.5 MB
Cache 35 MB
System 200 MB
Data 205 MB
OEM 1 MB
Persist 1.5 MB

Total 454.5 MB

PT Stock TPT:
Recovery 0.375 MB
Boot 0.25 MB
Splash 1.5 MB
Misc 0.5 MB
Cache 57.5 MB
System 220 MB
Data 162.5 MB
OEM 1 MB
Persist 1.5 MB

Total 445.125 MB

This makes me think that there is unalocated space... :blink:

P.S.: OEM is where the drivers, for example, are stored.

EDIT
Guess I was wrong, in the Amphoras TPT's thread he mentions that total space is 454.5 MB...
Seriously to me doesn't make much sense, I would prefer the 512 MB :P

Edited by D3abL3, 21 November 2011 - 04:41 PM.

  • 0

Did I help? Hit me a Posted Image Posted Image

Vote here please! :)

ADB Made Easy

Posted Image


#11
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts

This makes me think that there is unalocated space... :blink:

P.S.: OEM is where the drivers, for example, are stored.


Well, let's just say than it's quite troubling.

ZTE!

What have you done with the rest of our memory?!
I want it back! :D


EDIT: so the other ~60MB we can not see would be the firmware, or what?

Edited by atillaahun, 21 November 2011 - 04:42 PM.

  • 0

#12
D3abL3

D3abL3

    Addict

  • Members
  • PipPipPipPipPip
  • 597 posts
  • Gender:Male
  • Location:Trofa, Porto, Portugal
  • Devices:ZTE Skate, "virgin" SGS
  • Twitter:@D3abL3
I've just edited my post, look in the end of it :blush:

Edited by D3abL3, 21 November 2011 - 04:43 PM.

  • 0

Did I help? Hit me a Posted Image Posted Image

Vote here please! :)

ADB Made Easy

Posted Image


#13
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts

I've just edited my post, look in the end of it :blush:


Yeah, I saw, I edited too. But you're saying after all, that ~60 MB we missing from the 512 Mb doesn't even exist?
So we're just the victims of ZTE's marketing? Posted Image

Edited by atillaahun, 21 November 2011 - 04:49 PM.

  • 0

#14
Amphoras

Amphoras

    Addict

  • Members
  • PipPipPipPipPip
  • 766 posts

Yeah, I saw, I edited too. But you're saying after all, that ~60 MB we missing from the 512 Mb doesn't even exist?
So we're just the victims of ZTE's marketing? Posted Image


The full 512MB is used. If you go with the first TPT from the other thread you have 150MB system, 35MB cache, 255MB data. So that's 440MB straight off. You have 5MB for each of recovery and boot, 1.5MB for splash, 0.5MB for misc, 1MB for OEM and 1.5MB for persist. This gives you a total of 454.5MB. If you look at the offset of the first partition (recovery) you'll notice its 0x1CC and not 0. 0x1CC is 57.5MB and 454.5 + 57.5 = 512. This 57.5MB at the start is used for the radio partitions (amss.mbn etc.) so you can't use this.

It is possible to get a little bit of extra space from the other partitions. You could reduce misc, OEM and persist to 0.125MB and reduce splash to 1.125MB. This would give you another 2.5MB for data. However the tiny bit of extra space isn't really worth the trouble. I don't know what, if anything, misc and persist are used for so changing then might cause problems. OEM should be safe enough to change, but you're getting less than 1MB extra space. If you start taking stuff off the splash partition, then it can cause problems if some of the blocks are corrupted. For the tiny (0.375MB) bit of extra space you could get off it its just not worth it.

  • 1

TPT Helper lets you easily repartition your ZTE phone, install a new ROM and for the Blade, convert to/from Gen 2. Available for Orange San Francisco/ZTE Blade, Orange Monte Carlo/ZTE Skate and Orange San Francisco II/T-Mobile Vivacity. https://market.andro...horas.tpthelper

TPTs and other apps


#15
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts

The full 512MB is used. If you go with the first TPT from the other thread you have 150MB system, 35MB cache, 255MB data. So that's 440MB straight off. You have 5MB for each of recovery and boot, 1.5MB for splash, 0.5MB for misc, 1MB for OEM and 1.5MB for persist. This gives you a total of 454.5MB. If you look at the offset of the first partition (recovery) you'll notice its 0x1CC and not 0. 0x1CC is 57.5MB and 454.5 + 57.5 = 512. This 57.5MB at the start is used for the radio partitions (amss.mbn etc.) so you can't use this.

It is possible to get a little bit of extra space from the other partitions. You could reduce misc, OEM and persist to 0.125MB and reduce splash to 1.125MB. This would give you another 2.5MB for data. However the tiny bit of extra space isn't really worth the trouble. I don't know what, if anything, misc and persist are used for so changing then might cause problems. OEM should be safe enough to change, but you're getting less than 1MB extra space. If you start taking stuff off the splash partition, then it can cause problems if some of the blocks are corrupted. For the tiny (0.375MB) bit of extra space you could get off it its just not worth it.


Thanks for the clarification, I haven't heard about this 57.5 MB partion used for the radio before, that' why the confusion.
But now I'm finally fine. :)
Btw I wasn't considering changing those small partitions of course.

Tho I still have a blind spot: where do the firmware files go, that would be the radio partition?

Edited by atillaahun, 21 November 2011 - 05:22 PM.

  • 0

#16
D3abL3

D3abL3

    Addict

  • Members
  • PipPipPipPipPip
  • 597 posts
  • Gender:Male
  • Location:Trofa, Porto, Portugal
  • Devices:ZTE Skate, "virgin" SGS
  • Twitter:@D3abL3

Thanks for the clarification, I haven't heard about this 57.5 MB partion used for the radio before, that' why the confusion.
But now I'm finally fine. :)
Btw I wasn't considering changing those small partitions of course.

Tho I still have a blind spot: where do the firmware files go, that would be the radio partition?


What do you mean by firmware? When you flash a ROM?
*.zip ROM or TPT ROM?

In *.zip ROMs the mainly touched partition is /system, on TPTs almost all partitions(if not all) are touched.

Edited by D3abL3, 21 November 2011 - 05:34 PM.

  • 0

Did I help? Hit me a Posted Image Posted Image

Vote here please! :)

ADB Made Easy

Posted Image


#17
Amphoras

Amphoras

    Addict

  • Members
  • PipPipPipPipPip
  • 766 posts

Thanks for the clarification, I haven't heard about this 57.5 MB partion used for the radio before, that' why the confusion.
But now I'm finally fine. :)
Btw I wasn't considering changing those small partitions of course.

Tho I still have a blind spot: where do the firmware files go, that would be the radio partition?


If you mean the radio firmware then it goes in the radio partitions. If you mean the rom, then like D3abL3 said, it goes in the system and boot partitions.

  • 0

TPT Helper lets you easily repartition your ZTE phone, install a new ROM and for the Blade, convert to/from Gen 2. Available for Orange San Francisco/ZTE Blade, Orange Monte Carlo/ZTE Skate and Orange San Francisco II/T-Mobile Vivacity. https://market.andro...horas.tpthelper

TPTs and other apps


#18
atillaahun

atillaahun

    Regular

  • Members
  • PipPip
  • 86 posts

What do you mean by firmware? When you flash a ROM?
*.zip ROM or TPT ROM?

In *.zip ROMs the mainly touched partition is /system, on TPTs almost all partitions(if not all) are touched.


Sorry, I didn't realize, that "firmware" is not really used around here, we just say it in the hungarian forums, and mean by the image.bin updates ZTE publish. So I guess it's the TPT than.
One more thing is clear for the day. Thanks again. :)

Though there would be a last one. Posted Image
How is it possible than, that for instance I TPT my phone with OMC "firmware", and it still accepts only the HU T-Mobile SIMs?Posted Image Shouldn't be the mobile carrier specific editions (I linked above) carry the locking method?
Know that unlocking is partly solved, but that's just too complicated for me.

Edited by atillaahun, 21 November 2011 - 05:48 PM.

  • 0

#19
Amphoras

Amphoras

    Addict

  • Members
  • PipPipPipPipPip
  • 766 posts

Sorry, I didn't realize, that "firmware" is not really used around here, we just say it in the hungarian forums, and mean by the image.bin updates ZTE publish. So I guess it's the TPT than.
One more thing is clear for the day. Thanks again. :)

Though there would be a last one. Posted Image
How is it possible than, that for instance I TPT my phone with OMC "firmware", and it still accepts only the HU T-Mobile SIMs?Posted Image
Know that unlocking is partly solved, but that's just too complicated for me.



The locking mechanism appears to be in cefs.mbn. This can't be flashed by a TPT, so after you flash the UK TPT, your cefs.mbn is still the Hungarian one so is still locked exactly as it was before.

  • 0

TPT Helper lets you easily repartition your ZTE phone, install a new ROM and for the Blade, convert to/from Gen 2. Available for Orange San Francisco/ZTE Blade, Orange Monte Carlo/ZTE Skate and Orange San Francisco II/T-Mobile Vivacity. https://market.andro...horas.tpthelper

TPTs and other apps


#20
xiaoyaoswim

xiaoyaoswim

    Diehard

  • Members
  • PipPipPipPip
  • 365 posts
  • Gender:Male
  • Devices:ZTE Skate
Thanks to Amphoras and D3abL3 for the partition guide. I managed to push the userdata size to extreme (2MB cache,130MB system, and 308MB userdata) and it works fine with CM7.

@D3abL3 The conversion between hex and dec could be easily done by the calculator in Windows to save the trouble of doing math

@atillaahun Sim-lock state will not be affected by any TPT.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users