[6039y] **GUIDE** Repartitioning of the internal memory

Search This thread

petrov.0

Senior Member
Aug 4, 2015
367
275
Here it is as I promised.
This phone (the model with one sim card) is sold as a device with 8GB internal memory. In fact the memory chip inside is 16GB, so we can increase the available internal space.
PLEASE READ CAREFULLY AND IF SOMETHING IS NOT CLEAR DO NOT HESITATE TO ASK.
*** The data on your device will be untouched after this operation. But again please read carefully! ***
*** A good practice is always to make a backup of everything which will be changed. I do it and I've made a backup of the entire internal memory of the device before the start of the operation which is described below. ***
*** At the end of the post there is a link to a ZIP file which can be flashed through TWRP in order to perform the procedure automatically. Also includes a check for the size of the EMMC (as there are devices on which the resizing cannot be performed...their chip is smaller).***

1. You can go to this thread and to say Thanks! @meghd00t as his static build of gdisk is used in the recovery below.
2. What is needed:
- A different TWRP Recovery with gdisk inside. It can be downloaded from here twrp-2.8.7.0-idol3-6039y-with-gdisk.img - md5sum: 66b3f82a3e2e1afe14627b3b900a9319
- (Optional) An SD card for backup of the original GPT partition layout.
- Patience and careful reading.
- The Windows users probably need the drivers from this post, for access to the device in recovery mode.
3. How to do it (the output used below is from the terminal window from which I've done this operation on my device):
- reboot to bootloader:
Code:
 adb reboot-bootloader
- start the recovery
Code:
 fastboot -i 0x1bbb boot twrp-2.8.7.0-idol3-6039y-with-gdisk.img
- go to the device
Code:
 adb shell
- unmount all partitions of the internal memory
Code:
 ~ # umount /cache
 ~ # umount /sdcard 
 ~ # umount /and-sec
- ensure that there are no mounted partitions from mmcblk0. The output from the mount command should looks like this:
Code:
~ # mount 
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=713016k,nr_inodes=157853,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=713016k,nr_inodes=157853)
adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
/dev/block/mmcblk1p1 on /external_sd type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
- start gdisk
Code:
 ~ # gdisk /dev/block/mmcblk0
all partitions can be listed by pressing 'p' but we are interested by the last two:
Code:
  37         5000400        15269853   4.9 GiB     FFFF  userdata
  38        15269854        30535646   7.3 GiB     0700  userdatabak
and their information which will be shown by pressing 'i' and entering the partition number:
Code:
Command (? for help): i
Partition number (1-38): 37
Partition GUID code: 1B81E7E6-F50D-419B-A739-2AEEF8DA3335 (Unknown)
Partition unique GUID: BDD7FA27-93D4-40BC-B266-313E074E0E87
First sector: 5000400 (at 2.4 GiB)
Last sector: 15269853 (at 7.3 GiB)
Partition size: 10269454 sectors (4.9 GiB)
Attribute flags: 0000000000000000
Partition name: 'userdata'

Command (? for help): i
Partition number (1-38): 38
Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
Partition unique GUID: BD12CF41-10E7-BBF7-D096-5553B89882E7
First sector: 15269854 (at 7.3 GiB)
Last sector: 30535646 (at 14.6 GiB)
Partition size: 15265793 sectors (7.3 GiB)
Attribute flags: 0000000000000000
Partition name: 'userdatabak'
The information which is needed from the above output is Partition GUID code, First sector, Last sector and Partition name. You can write these somewhere (if your values are different from the above) from where can be pasted easily later (alternatively you can use the scrollback function of the terminal :) ).

- if you have an SD card make a backup of the partitions layout (in case that something goes wrong):
Code:
Command (? for help): b
Enter backup filename to save: /external_sd/gpt_partitions_table.backup
The operation has completed successfully.
- delete partitions 37 and 38:
Code:
Command (? for help): d
Partition number (1-38): 38

Command (? for help): d
Partition number (1-37): 37
- create a new partition 37, bigger in size with the same (as before) Partition GUID code, and the same (as before) start sector:
Code:
Command (? for help): n
Partition number (37-40, default 37): 37
First sector (34-30535646, default = 5000400) or {+-}size{KMGTP}: 5000400
Last sector (5000400-30535646, default = 30535646) or {+-}size{KMGTP}: 30535546
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 1B81E7E6-F50D-419B-A739-2AEEF8DA3335
Changed type of partition to 'Unknown'
The difference here is in the last sector of the partition 30535546.

- create a new partition 38 with same Partition GUID code, but with different First sector:
Code:
Command (? for help): n
Partition number (38-40, default 38): 38
First sector (34-30535646, default = 34) or {+-}size{KMGTP}: 30535547
Information: Moved requested sector from 30535547 to 30535548 in
order to align on 2-sector boundaries.
Use 'l' on the experts' menu to adjust alignment
Last sector (30535548-30535646, default = 30535646) or {+-}size{KMGTP}: 30535646
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
Changed type of partition to 'Microsoft basic data'
Please note that here in the output after 'n' the default first sector is 34, so you explicitly must enter the value!!! As can be seen I've entered the next available sector (after partition 37) 305355547 but it has been corrected automatically to 30535548. So you can use directly 30535548 as a start sector. The last sector is at the end of the memory 30535646.

- write the names of the new partitions:
Code:
Command (? for help): c
Partition number (1-38): 37
Enter name: userdata

Command (? for help): c
Partition number (1-38): 38
Enter name: userdatabak
- if you list the partitions again (with 'p') the end of the table should looks like this:
Code:
  37         5000400        30535546   12.2 GiB    FFFF  userdata
  38        30535548        30535646   49.5 KiB    0700  userdatabak
- now it is safe to write the changes by pressing 'w':
Code:
Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/block/mmcblk0.
The operation has completed successfully.
- resize the file system:
Code:
~ # resize2fs -p /dev/block/mmcblk0p37
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/block/mmcblk0p37' first.
... hmm ... let's run it:
Code:
~ # e2fsck -f /dev/block/mmcblk0p37
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/block/mmcblk0p37: 12519/321280 files (5.8% non-contiguous), 678615/1283425 blocks
~ # resize2fs -p /dev/block/mmcblk0p37
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/block/mmcblk0p37' first.
... well the resize2fs have some checks and refuses to resize the file system therefore we must force the execution:
Code:
~ # resize2fs -fp /dev/block/mmcblk0p37
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/block/mmcblk0p37 to 3191893 (4k) blocks.
The filesystem on /dev/block/mmcblk0p37 is now 3191893 blocks long.
The device now can be rebooted and its internal memory will be almost 12GB which compared to its previous size is a very nice upgrade. Screenshots before and after the repartitioning can be seen here.

Update (19.09.2015): This is a link to a flashabable zip which can be used from the TWRP to automate the process. Can be used with any TWRP recovery for 6039.
md5sum: c3f685310283bdc00cee5412fa33259c
 
Last edited:

Scalpos

Senior Member
Feb 6, 2008
67
13
ASUS ZenFone 8
Wow ! Kudos to meghd00t and petrov.0. I just ordered this phone as a backup, waiting for my beloved Xperia Z1 Compact to be saved from watering (medium rain during less than 10min, so long Sony waterproof phones...). Can't wait to receive it and play with this extra storage !! Thank you :victory:
 

evilinheaven

Senior Member
May 22, 2011
105
22
Here i'am, crazy thinking that if the 6039y(Single chip, SDcard and 8Gb) come with 8Gb worth of wasted money, that the 6039j dual chip and 16Gb non-SDCard version may very well come with a SDCard reader hardware worth of wasted money.
It would be like just changing the Chip Support slot thing or whatever...

Can someone support my craziness and post a picture of thi "where the chip stays" of the SDCard reader version of this phone??

Thanks a lot!!
 

petrov.0

Senior Member
Aug 4, 2015
367
275
Here i'am, crazy thinking that if the 6039y(Single chip, SDcard and 8Gb) come with 8Gb worth of wasted money, that the 6039j dual chip and 16Gb non-SDCard version may very well come with a SDCard reader hardware worth of wasted money.
It would be like just changing the Chip Support slot thing or whatever...

Can someone support my craziness and post a picture of thi "where the chip stays" of the SDCard reader version of this phone??

Thanks a lot!!
Well ... I like crazy things. But is impossible just to add a chip.
The thread itself is for other things. I don't want more reminders from the moderators. So please use the general section next time.
Thank you in advance.
 
  • Like
Reactions: SyCoREAPER

rioachim

Senior Member
Jul 4, 2011
305
104
Here is the complete partition list for 8Gb single sim variant:

Code:
Disk /dev/block/mmcblk0: 30535680 sectors, 14.6 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 40 entries
First usable sector is 34, last usable sector is 30535646
Partitions will be aligned on 2-sector boundaries
Total free space is 256464 sectors (125.2 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1          131072          262143   64.0 MiB    0700  modem
   2          262144          265215   1.5 MiB     FFFF  tunning
   3          265216          267263   1024.0 KiB  FFFF  traceability
   4          267264          267265   1024 bytes  FFFF  fsc
   5          267266          267281   8.0 KiB     FFFF  ssd
   6          267282          268305   512.0 KiB   FFFF  sbl1
   7          268306          269329   512.0 KiB   0700  sbl1bak
   8          269330          270353   512.0 KiB   FFFF  rpm
   9          270354          271377   512.0 KiB   0700  rpmbak
  10          271378          272401   512.0 KiB   FFFF  tz
  11          272402          273425   512.0 KiB   0700  tzbak
  12          273426          274449   512.0 KiB   FFFF  hyp
  13          274450          275473   512.0 KiB   0700  hypbak
  14          275474          278545   1.5 MiB     FFFF  modemst1
  15          278546          281617   1.5 MiB     FFFF  modemst2
  16          281618          283665   1024.0 KiB  FFFF  simlock
  17          283666          286737   1.5 MiB     FFFF  efsdata
  18          393216          393279   32.0 KiB    FFFF  DDR
  19          393280          396351   1.5 MiB     FFFF  fsg
  20          396352          396383   16.0 KiB    FFFF  sec
  21          396384          398431   1024.0 KiB  FFFF  aboot
  22          398432          400479   1024.0 KiB  0700  abootbak
  23          400480          466015   32.0 MiB    FFFF  boot
  24          466016          531551   32.0 MiB    FFFF  recovery
  25          531552         4306427   1.8 GiB     FFFF  system
  26         4325376         4390911   32.0 MiB    FFFF  persist
  27         4390912         4407295   8.0 MiB     FFFF  splash
  28         4407296         4448255   20.0 MiB    0700  tctpersist
  29         4448256         4468735   10.0 MiB    0700  hdcp
  30         4468736         4468751   8.0 KiB     FFFF  fota
  31         4468752         4993039   256.0 MiB   FFFF  cache
  32         4993040         4995087   1024.0 KiB  FFFF  misc
  33         4995088         4996111   512.0 KiB   FFFF  keystore
  34         4996112         4996175   32.0 KiB    FFFF  config
  35         4996176         4996303   64.0 KiB    FFFF  oem
  36         4996304         5000399   2.0 MiB     FFFF  FactoryRP
  37         5000400        15269853   4.9 GiB     FFFF  userdata
  38        15269854        30535646   7.3 GiB     0700  userdatabak

Maybe someone can post the list for 16Gb dual sim variant?
 
  • Like
Reactions: jani0417

rioachim

Senior Member
Jul 4, 2011
305
104
Ok, I bit the bullet and resized the "userdata" partition. Only that I did not create the smaller #38 partition, I did not see any reason to do it (if any update tries to store something inside it, will fail anyway; this partition does not look special, all *bak partitions have the same GUID). Plus there isn't any "userdatabak" partition on 16Gb models. Instead I made partition #37 up to the latest available sector (30535646). The phone is working just fine.
 
Last edited:

petrov.0

Senior Member
Aug 4, 2015
367
275
Ok, I bit the bullet and resized the "userdata" partition. Only that I did not create the smaller #38 partition, I did not see any reason to do it (if any update tries to store something inside it, will fail anyway; this partition does not look special, all *bak partitionshave the same GUID). Plus there isn't any "userdatabak" partition on 16Gb models. Instead I made partition #37 up to the latest available sector (30535646). The phone is working just fine.
OK. But don't be fulled by the GUID. Most of the bak partitions contain data which is equivalent to the data in the primary ones (aboot, rpm, sbl1 etc.). The data is patched in both partitions with the same patch during an upgrade.
 

google99

Member
Oct 11, 2007
33
2
Script to repartition "internal memory"

Hello petrov.0, all

Is it possible to create a shell for all thoses commands ?

In this case if partitions are lost (upgrade, patchs....) we could apply it easily.
And nice discovered.
Regards
Google99
 

petrov.0

Senior Member
Aug 4, 2015
367
275
Hello petrov.0, all

Is it possible to create a shell for all thoses commands ?

In this case if partitions are lost (upgrade, patchs....) we could apply it easily.
And nice discovered.
Regards
Google99
No it is not:
Code:
GPT  fdisk  (aka gdisk) is a text-mode menu-driven program for creation and manipulation of partition tables.
 

Romagnolo1973

Senior Member
Jan 1, 2012
279
170
Hi petrov.0 great news and thanks.
Just a doubt, a friend of mine will receive Idol 3 4,7" 8 GB tomorrow, he can made OTA update (that I think are available for security reasons as "stagefright" and another I know Alcatel get users a way to set SD as main memory) and then use your guide to expand memory t 16 Gb or for this operation is better been in a fresh unchained device not updated?
Because in this second option device become 16 Gb Rom but will be afected by stagefright and for the rest of his life
Thanks!
 

petrov.0

Senior Member
Aug 4, 2015
367
275
Hi petrov.0 great news and thanks.
Just a doubt, a friend of mine will receive Idol 3 4,7" 8 GB tomorrow, he can made OTA update (that I think are available for security reasons as "stagefright" and another I know Alcatel get users a way to set SD as main memory) and then use your guide to expand memory t 16 Gb or for this operation is better been in a fresh unchained device not updated?
Because in this second option device become 16 Gb Rom but will be afected by stagefright and for the rest of his life
Thanks!
It shouldn't be updated. The official updates for 6039 removes the fastboot commands therefore you will not be able to do the repartitioning nor to root the device. Give me the update file and will modify it in a way which will preserve the commands (there is a risk for a broken device after it though ... I wish to try such modification first on my phone, but unfortunately I still do not have official update for it with which to test).
 

Rorshan

Member
Aug 3, 2015
42
3
It shouldn't be updated. The official updates for 6039 removes the fastboot commands therefore you will not be able to do the repartitioning nor to root the device. Give me the update file and will modify it in a way which will preserve the commands (there is a risk for a broken device after it though ... I wish to try such modification first on my phone, but unfortunately I still do not have official update for it with which to test).
By the way is there any hope (other than getting Alcatel to push an update to put fastboot commands back in, cause is anyone that optimistic?) for people who have indeed updated to recover those?

Sent from my 6039Y using Tapatalk
 

petrov.0

Senior Member
Aug 4, 2015
367
275
By the way is there any hope (other than getting Alcatel to push an update to put fastboot commands back in, cause is anyone that optimistic?) for people who have indeed updated to recover those?
Sent from my 6039Y using Tapatalk
If you find a way to root the device after the update then may be there is a hope.
 

Romagnolo1973

Senior Member
Jan 1, 2012
279
170
It shouldn't be updated. The official updates for 6039 removes the fastboot commands therefore you will not be able to do the repartitioning nor to root the device. Give me the update file and will modify it in a way which will preserve the commands (there is a risk for a broken device after it though ... I wish to try such modification first on my phone, but unfortunately I still do not have official update for it with which to test).

Understood the problem is new update that remove some action from fastboot needed for repartioning. Idol 3 was received and he resize rom from 8 to 16 with no issue with your guide, after that he made OTA update and they are working perfectly, no issue with the new partitioning size and device is working well.
 

petrov.0

Senior Member
Aug 4, 2015
367
275
Understood the problem is new update that remove some action from fastboot needed for repartioning. Idol 3 was received and he resize rom from 8 to 16 with no issue with your guide, after that he made OTA update and they are working perfectly, no issue with the new partitioning size and device is working well.
Not some but all fastboot commands are removed. Glad to see that you have made it though. The OTA update however is a mistake. Now you can't get root access nor the fastboot commands are available.
 

Romagnolo1973

Senior Member
Jan 1, 2012
279
170
Not some but all fastboot commands are removed. Glad to see that you have made it though. The OTA update however is a mistake. Now you can't get root access nor the fastboot commands are available.

Yes, it was risky but probably he is not interested in root, I only inform you that new partitioning with OTA is still there, I think is a goodnews and a base to start, now the perfect situation is if Alcatel made a future OTA as soon as possible with fastboot perfectly working.
 

petrov.0

Senior Member
Aug 4, 2015
367
275
Yes, it was risky but probably he is not interested in root, I only inform you that new partitioning with OTA is still there, I think is a goodnews and a base to start, now the perfect situation is if Alcatel made a future OTA as soon as possible with fastboot perfectly working.
There is nothing wrong with the fastboot commands prior the update. I have doubts that they will be returned. Thanks for the info though (despite that I already know this by looking in the update files). I can't live without root access however therefore there is no option to loose it.
 

Rorshan

Member
Aug 3, 2015
42
3
I'm kinda confused here. Are all the steps done from a terminal on the computer or is some of that to be typed inside the TWRP terminal? Because as soon as I boot TWRP with gdisk I get a device not found from typing adb shell. I'm pretty sure I have all the drivers mentioned in the linked post (and even more too). Any kind soul to explain how stupid I am being (because I know that's the solution in the end, I'm a fool)
 

petrov.0

Senior Member
Aug 4, 2015
367
275
I'm kinda confused here. Are all the steps done from a terminal on the computer or is some of that to be typed inside the TWRP terminal? Because as soon as I boot TWRP with gdisk I get a device not found from typing adb shell. I'm pretty sure I have all the drivers mentioned in the linked post (and even more too). Any kind soul to explain how stupid I am being (because I know that's the solution in the end, I'm a fool)
Everything after adb shell must be done directly on the device. The VID & PID of the device are different in the recovery and you don't have the necessary drivers. Try to install the drivers mentioned in the first post (- The Windows users probably need the drivers from this post, for access to the device in recovery mode).
 

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    Here it is as I promised.
    This phone (the model with one sim card) is sold as a device with 8GB internal memory. In fact the memory chip inside is 16GB, so we can increase the available internal space.
    PLEASE READ CAREFULLY AND IF SOMETHING IS NOT CLEAR DO NOT HESITATE TO ASK.
    *** The data on your device will be untouched after this operation. But again please read carefully! ***
    *** A good practice is always to make a backup of everything which will be changed. I do it and I've made a backup of the entire internal memory of the device before the start of the operation which is described below. ***
    *** At the end of the post there is a link to a ZIP file which can be flashed through TWRP in order to perform the procedure automatically. Also includes a check for the size of the EMMC (as there are devices on which the resizing cannot be performed...their chip is smaller).***

    1. You can go to this thread and to say Thanks! @meghd00t as his static build of gdisk is used in the recovery below.
    2. What is needed:
    - A different TWRP Recovery with gdisk inside. It can be downloaded from here twrp-2.8.7.0-idol3-6039y-with-gdisk.img - md5sum: 66b3f82a3e2e1afe14627b3b900a9319
    - (Optional) An SD card for backup of the original GPT partition layout.
    - Patience and careful reading.
    - The Windows users probably need the drivers from this post, for access to the device in recovery mode.
    3. How to do it (the output used below is from the terminal window from which I've done this operation on my device):
    - reboot to bootloader:
    Code:
     adb reboot-bootloader
    - start the recovery
    Code:
     fastboot -i 0x1bbb boot twrp-2.8.7.0-idol3-6039y-with-gdisk.img
    - go to the device
    Code:
     adb shell
    - unmount all partitions of the internal memory
    Code:
     ~ # umount /cache
     ~ # umount /sdcard 
     ~ # umount /and-sec
    - ensure that there are no mounted partitions from mmcblk0. The output from the mount command should looks like this:
    Code:
    ~ # mount 
    rootfs on / type rootfs (rw)
    tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,size=713016k,nr_inodes=157853,mode=755)
    devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
    proc on /proc type proc (rw,relatime)
    sysfs on /sys type sysfs (rw,seclabel,relatime)
    selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
    tmpfs on /tmp type tmpfs (rw,seclabel,relatime,size=713016k,nr_inodes=157853)
    adb on /dev/usb-ffs/adb type functionfs (rw,relatime)
    /dev/block/mmcblk1p1 on /external_sd type vfat (rw,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
    - start gdisk
    Code:
     ~ # gdisk /dev/block/mmcblk0
    all partitions can be listed by pressing 'p' but we are interested by the last two:
    Code:
      37         5000400        15269853   4.9 GiB     FFFF  userdata
      38        15269854        30535646   7.3 GiB     0700  userdatabak
    and their information which will be shown by pressing 'i' and entering the partition number:
    Code:
    Command (? for help): i
    Partition number (1-38): 37
    Partition GUID code: 1B81E7E6-F50D-419B-A739-2AEEF8DA3335 (Unknown)
    Partition unique GUID: BDD7FA27-93D4-40BC-B266-313E074E0E87
    First sector: 5000400 (at 2.4 GiB)
    Last sector: 15269853 (at 7.3 GiB)
    Partition size: 10269454 sectors (4.9 GiB)
    Attribute flags: 0000000000000000
    Partition name: 'userdata'
    
    Command (? for help): i
    Partition number (1-38): 38
    Partition GUID code: EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 (Microsoft basic data)
    Partition unique GUID: BD12CF41-10E7-BBF7-D096-5553B89882E7
    First sector: 15269854 (at 7.3 GiB)
    Last sector: 30535646 (at 14.6 GiB)
    Partition size: 15265793 sectors (7.3 GiB)
    Attribute flags: 0000000000000000
    Partition name: 'userdatabak'
    The information which is needed from the above output is Partition GUID code, First sector, Last sector and Partition name. You can write these somewhere (if your values are different from the above) from where can be pasted easily later (alternatively you can use the scrollback function of the terminal :) ).

    - if you have an SD card make a backup of the partitions layout (in case that something goes wrong):
    Code:
    Command (? for help): b
    Enter backup filename to save: /external_sd/gpt_partitions_table.backup
    The operation has completed successfully.
    - delete partitions 37 and 38:
    Code:
    Command (? for help): d
    Partition number (1-38): 38
    
    Command (? for help): d
    Partition number (1-37): 37
    - create a new partition 37, bigger in size with the same (as before) Partition GUID code, and the same (as before) start sector:
    Code:
    Command (? for help): n
    Partition number (37-40, default 37): 37
    First sector (34-30535646, default = 5000400) or {+-}size{KMGTP}: 5000400
    Last sector (5000400-30535646, default = 30535646) or {+-}size{KMGTP}: 30535546
    Current type is 'Linux filesystem'
    Hex code or GUID (L to show codes, Enter = 8300): 1B81E7E6-F50D-419B-A739-2AEEF8DA3335
    Changed type of partition to 'Unknown'
    The difference here is in the last sector of the partition 30535546.

    - create a new partition 38 with same Partition GUID code, but with different First sector:
    Code:
    Command (? for help): n
    Partition number (38-40, default 38): 38
    First sector (34-30535646, default = 34) or {+-}size{KMGTP}: 30535547
    Information: Moved requested sector from 30535547 to 30535548 in
    order to align on 2-sector boundaries.
    Use 'l' on the experts' menu to adjust alignment
    Last sector (30535548-30535646, default = 30535646) or {+-}size{KMGTP}: 30535646
    Current type is 'Linux filesystem'
    Hex code or GUID (L to show codes, Enter = 8300): EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
    Changed type of partition to 'Microsoft basic data'
    Please note that here in the output after 'n' the default first sector is 34, so you explicitly must enter the value!!! As can be seen I've entered the next available sector (after partition 37) 305355547 but it has been corrected automatically to 30535548. So you can use directly 30535548 as a start sector. The last sector is at the end of the memory 30535646.

    - write the names of the new partitions:
    Code:
    Command (? for help): c
    Partition number (1-38): 37
    Enter name: userdata
    
    Command (? for help): c
    Partition number (1-38): 38
    Enter name: userdatabak
    - if you list the partitions again (with 'p') the end of the table should looks like this:
    Code:
      37         5000400        30535546   12.2 GiB    FFFF  userdata
      38        30535548        30535646   49.5 KiB    0700  userdatabak
    - now it is safe to write the changes by pressing 'w':
    Code:
    Command (? for help): w
    
    Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
    PARTITIONS!!
    
    Do you want to proceed? (Y/N): Y
    OK; writing new GUID partition table (GPT) to /dev/block/mmcblk0.
    The operation has completed successfully.
    - resize the file system:
    Code:
    ~ # resize2fs -p /dev/block/mmcblk0p37
    resize2fs 1.42.9 (28-Dec-2013)
    Please run 'e2fsck -f /dev/block/mmcblk0p37' first.
    ... hmm ... let's run it:
    Code:
    ~ # e2fsck -f /dev/block/mmcblk0p37
    e2fsck 1.42.9 (28-Dec-2013)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/block/mmcblk0p37: 12519/321280 files (5.8% non-contiguous), 678615/1283425 blocks
    ~ # resize2fs -p /dev/block/mmcblk0p37
    resize2fs 1.42.9 (28-Dec-2013)
    Please run 'e2fsck -f /dev/block/mmcblk0p37' first.
    ... well the resize2fs have some checks and refuses to resize the file system therefore we must force the execution:
    Code:
    ~ # resize2fs -fp /dev/block/mmcblk0p37
    resize2fs 1.42.9 (28-Dec-2013)
    Resizing the filesystem on /dev/block/mmcblk0p37 to 3191893 (4k) blocks.
    The filesystem on /dev/block/mmcblk0p37 is now 3191893 blocks long.
    The device now can be rebooted and its internal memory will be almost 12GB which compared to its previous size is a very nice upgrade. Screenshots before and after the repartitioning can be seen here.

    Update (19.09.2015): This is a link to a flashabable zip which can be used from the TWRP to automate the process. Can be used with any TWRP recovery for 6039.
    md5sum: c3f685310283bdc00cee5412fa33259c
    1
    Here i'am, crazy thinking that if the 6039y(Single chip, SDcard and 8Gb) come with 8Gb worth of wasted money, that the 6039j dual chip and 16Gb non-SDCard version may very well come with a SDCard reader hardware worth of wasted money.
    It would be like just changing the Chip Support slot thing or whatever...

    Can someone support my craziness and post a picture of thi "where the chip stays" of the SDCard reader version of this phone??

    Thanks a lot!!
    Well ... I like crazy things. But is impossible just to add a chip.
    The thread itself is for other things. I don't want more reminders from the moderators. So please use the general section next time.
    Thank you in advance.
    1
    Here is the complete partition list for 8Gb single sim variant:

    Code:
    Disk /dev/block/mmcblk0: 30535680 sectors, 14.6 GiB
    Logical sector size: 512 bytes
    Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
    Partition table holds up to 40 entries
    First usable sector is 34, last usable sector is 30535646
    Partitions will be aligned on 2-sector boundaries
    Total free space is 256464 sectors (125.2 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1          131072          262143   64.0 MiB    0700  modem
       2          262144          265215   1.5 MiB     FFFF  tunning
       3          265216          267263   1024.0 KiB  FFFF  traceability
       4          267264          267265   1024 bytes  FFFF  fsc
       5          267266          267281   8.0 KiB     FFFF  ssd
       6          267282          268305   512.0 KiB   FFFF  sbl1
       7          268306          269329   512.0 KiB   0700  sbl1bak
       8          269330          270353   512.0 KiB   FFFF  rpm
       9          270354          271377   512.0 KiB   0700  rpmbak
      10          271378          272401   512.0 KiB   FFFF  tz
      11          272402          273425   512.0 KiB   0700  tzbak
      12          273426          274449   512.0 KiB   FFFF  hyp
      13          274450          275473   512.0 KiB   0700  hypbak
      14          275474          278545   1.5 MiB     FFFF  modemst1
      15          278546          281617   1.5 MiB     FFFF  modemst2
      16          281618          283665   1024.0 KiB  FFFF  simlock
      17          283666          286737   1.5 MiB     FFFF  efsdata
      18          393216          393279   32.0 KiB    FFFF  DDR
      19          393280          396351   1.5 MiB     FFFF  fsg
      20          396352          396383   16.0 KiB    FFFF  sec
      21          396384          398431   1024.0 KiB  FFFF  aboot
      22          398432          400479   1024.0 KiB  0700  abootbak
      23          400480          466015   32.0 MiB    FFFF  boot
      24          466016          531551   32.0 MiB    FFFF  recovery
      25          531552         4306427   1.8 GiB     FFFF  system
      26         4325376         4390911   32.0 MiB    FFFF  persist
      27         4390912         4407295   8.0 MiB     FFFF  splash
      28         4407296         4448255   20.0 MiB    0700  tctpersist
      29         4448256         4468735   10.0 MiB    0700  hdcp
      30         4468736         4468751   8.0 KiB     FFFF  fota
      31         4468752         4993039   256.0 MiB   FFFF  cache
      32         4993040         4995087   1024.0 KiB  FFFF  misc
      33         4995088         4996111   512.0 KiB   FFFF  keystore
      34         4996112         4996175   32.0 KiB    FFFF  config
      35         4996176         4996303   64.0 KiB    FFFF  oem
      36         4996304         5000399   2.0 MiB     FFFF  FactoryRP
      37         5000400        15269853   4.9 GiB     FFFF  userdata
      38        15269854        30535646   7.3 GiB     0700  userdatabak

    Maybe someone can post the list for 16Gb dual sim variant?
    1
    At the end of the memory/disk is the backup GPT ... it resides in the last 33 sectors (16.5 KB). No idea how important the GUID is, probably it will be changed when you delete the partition ... if you want to make a script with parted make it ... Probably I will make one with sgdisk (I think that the options are more comfortable ... and can write the GUID code with it). UUID and GUID code are different things.

    Wasn't meaning to step on any toes; just pointing that something similar is out there in script form - anyway using parted (and sgdisk for GUID); something like:
    Code:
    #!/sbin/sh
    parted -s /dev/block/mmcblk0 "unit s" "print" > /tmp/parted.txt
    uuidold=`blkid /dev/block/mmcblk0p37 | awk '{print $2}' | cut -d "\"" -f2`
    guidold=`sgdisk -p /dev/block/mmcblk0p37 | grep GUID | awk '{print $NF}'`
    usrdatasec=`cat /tmp/parted.txt | grep "37 " | awk '{print $2}' | cut -ds -f1`
    usrdtndssec=`cat /tmp/parted.txt | grep "38 " | awk '{print $3}' | cut -ds -f1`
    parted -s /dev/block/mmcblk0 "rm 37"
    parted -s /dev/block/mmcblk0 "rm 38"
    parted -s /dev/block/mmcblk0 "unit s" "mkpart primary ${usrdatasec} ${usrdtndssec}"
    parted -s /dev/block/mmcblk0 "name 37 userdata"
    e2fsck -pf /dev/block/mmcblk0p37
    resize2fs /dev/block/mmcblk0p37
    uuidnew=`blkid /dev/block/mmcblk0p37 | awk '{print $2}' | cut -d "\"" -f2`
    guidnew=`sgdisk -p /dev/block/mmcblk0p37 | grep GUID | awk '{print $NF}'`
    if [ ${uuidold} != ${uuidnew} ]; then 
    	tune2fs -U ${uuidold} /dev/block/mmcblk0p37
    fi
    if [ ${guidold} != ${guidnew} ]; then 
    	sgdisk -u 37:${guidold} /dev/block/mmcblk0p37
    fi
    Should work as a recovery run script (installable in zip form with parted and sgdisk binaries added to /sbin). Obviously can't test as I don't have an Idol 3; and not 100% on the sgdisk command as I haven't used that before.
    1
    Link to a flashable zip for automatic repartitioning. It has been added to the first post too. Use it through TWRP (the version doesn't matter).