Code: adb reboot-bootloader

Code: fastboot -i 0x1bbb boot twrp-2.8.7.0-idol3-6039y-with-gdisk.img

Code: adb shell

Code: ~ # umount /cache ~ # umount /sdcard ~ # umount /and-sec

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)

Code: ~ # gdisk /dev/block/mmcblk0

Code: 37 5000400 15269853 4.9 GiB FFFF userdata 38 15269854 30535646 7.3 GiB 0700 userdatabak

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'

Code: Command (? for help): b Enter backup filename to save: /external_sd/gpt_partitions_table.backup The operation has completed successfully.

Code: Command (? for help): d Partition number (1-38): 38 Command (? for help): d Partition number (1-37): 37

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'

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'

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

Code: 37 5000400 30535546 12.2 GiB FFFF userdata 38 30535548 30535646 49.5 KiB 0700 userdatabak

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.

Code: ~ # resize2fs -p /dev/block/mmcblk0p37 resize2fs 1.42.9 (28-Dec-2013) Please run 'e2fsck -f /dev/block/mmcblk0p37' first.

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.

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.

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



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.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:- start the recovery- go to the device- unmount all partitions of the internal memory- ensure that there are no mounted partitions from mmcblk0. The output from the mount command should looks like this:- start gdiskall partitions can be listed by pressing 'p' but we are interested by the last two:and their information which will be shown by pressing 'i' and entering the partition number: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):- delete partitions 37 and 38:- create a new partition 37, bigger in size with the same (as before) Partition GUID code, and the same (as before) start sector: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: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:- if you list the partitions again (with 'p') the end of the table should looks like this:- now it is safe to write the changes by pressing 'w':- resize the file system:... hmm ... let's run it:... well the resize2fs have some checks and refuses to resize the file system therefore we must force the execution: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