[Mi 3 General] Dzol Cp:
#include
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices
* Do With Your Own Risk
* If you put blamed on me?
* I will laugh at you.
* YOU HAVE BEEN WARNED!
*/

Hello Guys, in order to make our Cancro successfully flash GSI Treble Rom, we need to do some of the modification to the internal memory and system space and also create a new partition for vendor image. As we all know there is bunch of guide and tutorial for system partition for MI3 and the very famous and easy is just using script to flash via recovery, and you done. So today im going to lead you to extend your system partition to 2GB, and creating new vendor partition. I tested it on MI3W 16GB and 64GB.

​

REQUIREMENTS

BACKUP ALL YOUR CURRENT DATA TO WINDOWS OR USB OTG

CWM v6.0.5.1 (R11) by furniel and donbot

ADB Install

Fastboot Install

TWRP TREBLE 3.2.3.0 Cancro

MIUI 10 EU ROM

LET'S BEGIN

Reboot to recovery and connect your phone to Window

Open a cmd window (or terminal, if you're using linux), and connect through adb by typing;

adb devices enter

adb shell enter

adb devices

adb shell

If everything is fine and you get a shell input (#), start parted by typing;

parted /dev/block/mmcblk0 enter

print enter

parted /dev/block/mmcblk0

print

Output of "print" should be something like this

Remove partition 23 24 25

rm 23 enter

rm 24 enter

rm 25 enter

rm 23

rm 24

rm 25

If you get an error message when rm 25 like this

name 25 cache

type quit enter

reboot recovery on phone

connect to adb again

repeat #2 , #3 command

type print enter

type rm 25

And now we are going to create 2GB system partition and vendor partition and rename it

mkpartfs primary ext2 403 2403 enter

mkpartfs primary ext2 2403 2453 enter

mkpartfs primary ext2 2453 2653 enter

mkpartfs primary ext2 2653 62.5G enter * for 64GB if * 16GB mkpartfs primary ext2 2653 15.8GB

name 23 system enter

name 24 cache enter

name 25 vendor enter

name 26 userdata enter

mkpartfs primary ext2 403 2403

mkpartfs primary ext2 2403 2453

mkpartfs primary ext2 2453 2653

mkpartfs primary ext2 2653 62.5G

name 23 system

name 24 cache

name 25 vendor

name 26 userdata

quit

After renaming and type quit and dont close the cmd and still on shell ~#

Now we are going to convert all newly partition 23 24 25 26 from ext2 to ext4

tune2fs -j /dev/block/mmcblk0p23 enter

e2fsck -fDp /dev/block/mmcblk0p23 enter

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p23 enter

e2fsck -fDp /dev/block/mmcblk0p23 enter

tune2fs -j /dev/block/mmcblk0p24 enter

e2fsck -fDp /dev/block/mmcblk0p24 enter

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p24 enter

e2fsck -fDp /dev/block/mmcblk0p24 enter

tune2fs -j /dev/block/mmcblk0p25 enter

e2fsck -fDp /dev/block/mmcblk0p25 enter

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25 enter

e2fsck -fDp /dev/block/mmcblk0p25 enter

tune2fs -j /dev/block/mmcblk0p26 enter

e2fsck -fDp /dev/block/mmcblk0p26 enter

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p26 enter

e2fsck -fDp /dev/block/mmcblk0p26 enter

tune2fs -j /dev/block/mmcblk0p23

e2fsck -fDp /dev/block/mmcblk0p23

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p23

e2fsck -fDp /dev/block/mmcblk0p23

tune2fs -j /dev/block/mmcblk0p24

e2fsck -fDp /dev/block/mmcblk0p24

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p24

e2fsck -fDp /dev/block/mmcblk0p24

tune2fs -j /dev/block/mmcblk0p25

e2fsck -fDp /dev/block/mmcblk0p25

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25

e2fsck -fDp /dev/block/mmcblk0p25

tune2fs -j /dev/block/mmcblk0p26

e2fsck -fDp /dev/block/mmcblk0p26

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p26

e2fsck -fDp /dev/block/mmcblk0p26

exit

Go back to parted to check whether it's applied;

parted /dev/block/mmcblk0 enter

print enter

parted /dev/block/mmcblk0

print

Your partition should be like this, if you follow my calculation.

Also can follow this calculation for 1.5 GB system partition.

CONGRATS!! You have success parted your system partition, now you can disable your MI3/MI4 connection from WINDOWS.

Make sure that you still on that CWM Recovery, copy MIUI 10 EU ROM to internal memory, flash it via CWM, wait till your MI3 load till startup wizard. Install MIUI 10 via CWM and reboot around 10 to 20 minutes, pls make sure that your battery is up to 50% above.

Reboot to fastboot and flash TWRP Treble 3.2.3.0 and now you can easily flash GSI ROM type Arm A Only.

Now you already have a system partition 2GB and vendor partition, that enough for flashing GSI Image, Thanks for following my guide.

​

Reference link

[GUIDE][ProjectTreble]Create a vendor partition for cancro to flash a PT GSI IMAGE

[HOWTO][GUIDE][Mi3][Mi4]Resize/extend system partition capacity

Cancro ROM Group

Group rules:

English only.(You can use the translator to communicate.

Respect developers and administrators.

Please do not send spam.

Do not send stickers continuously.

Channel: [MENTION=2709641]cancro[/MENTION] ROM

CN Group: [MENTION=2709641]cancro[/MENTION] Group

https://t.me/micancro

Contributor

gujiangjiang

biepurity