Skip to content

Latest commit

 

History

History
201 lines (128 loc) · 4.55 KB

1-partition.md

File metadata and controls

201 lines (128 loc) · 4.55 KB

Partitioning your Xiaomi Mi 9

Files/Tools Needed

Modified Recovery:

File Name Android version
ofox.img Android 12/12.1/13/14

Notes

Warning

All your data will be erased! Back up now if needed.

Do not run the same command twice.

DO NOT REBOOT YOUR PHONE if you think you made a mistake, ask for help in the Telegram chat.

Do not run all commands at once, execute them in order!

Important

Make sure you use the MODDED Recovery throughout this whole tutorial as we provide tools to help aid this installation process and make it as easy as possible for you.

If you don't use it and you face any errors, consider it your fault and consider yourself alone if you try asking for support as you have deferred from the main guide.

Opening CMD as an admin

Download platform-tools and extract the folder somewhere, then open CMD as an administrator.

It is recommended to keep this window open and use it throughout the entire guide.

Replace path\to\platform-tools with the actual path to the platform-tools folder, for example C:\platform-tools.

cd path\to\platform-tools

Boot the modded recovery

Replace path\to\ofox.img with the actual path to the modded recovery image

fastboot boot path\to\ofox.img

Backing up your boot image

This will back up your boot image in the current directory

adb pull /dev/block/by-name/boot boot.img

Partitioning your device

There are two methods to partition your device. Please select the method you would like to use below.

Method 1: Manual partitioning

  Click here for method 1

Unmount data

Ignore any possible errors and continue

adb shell umount /dev/block/by-name/userdata

Resizing the partition table

adb shell sgdisk --resize-table 64 /dev/block/sda

Preparing for partitioning

adb shell parted /dev/block/sda

Printing the current partition table

Parted will print the list of partitions, userdata should be the last partition in the list

print

Removing userdata

Replace $ with the number of the userdata partition, which should be 31

rm $

Recreating userdata

Replace 2080MB with the former start value of userdata which we just deleted

Replace 64GB with the end value you want userdata to have. In this example your available usable space in Android will be 64GB-2080B = 62GB

mkpart userdata ext4 2080MB 64GB

Creating ESP partition

Replace 64GB with the end value of userdata

Replace 64.3GB with the value you used before, adding 0.3GB to it

mkpart esp fat32 64GB 64.3GB

Creating Windows partition

Replace 64.3GB with the end value of esp

mkpart win ntfs 64.3GB -0MB

Making ESP bootable

Use print to see all partitions. Replace "$" with your ESP partition number, which should be 32

set $ esp on

Exit parted

quit

Formatting data

  • Format all data in TWRP, or Android will not boot.
  • ( Go to Wipe > Format data > type yes )

Check if Android still starts

  • Just restart the phone, and see if Android still works

Formatting Windows and ESP drives

Reboot into the modded recovery, then run the below two commands

adb shell mkfs.ntfs -f /dev/block/by-name/win -L WINCEPHEUS
adb shell mkfs.fat -F32 -s1 /dev/block/by-name/esp -n ESPCEPHEUS

Method 2: Automatic partitioning

  Click here for method 2

Run the partitioning script

Replace $ with the amount of storage you want Windows to have (do not add GB, just write the number)

If it asks you to run it once again, do so

adb shell partition $

Check if Android still starts

  • Just restart the phone, and see if Android still works