Skip to content

Latest commit

 

History

History
167 lines (119 loc) · 4.61 KB

1-partition.md

File metadata and controls

167 lines (119 loc) · 4.61 KB

Windows 11 running on hotdog/guacamole

Running Windows on the OnePlus 7 Pro / 7T Pro

Partitioning your device

Prerequisites

Notes

Warning

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!

YOU CAN BREAK YOUR DEVICE WITH THE COMMANDS BELOW IF YOU DO THEM WRONG!!!

Important

OOS12 and ROMs that use OOS12 firmware have extremely experimental Windows support and may not work at all.

It is highly recommended to downgrade to OOS11 if you want to use Windows.

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

Note

If your device is not detected in fastboot or recovery mode, you'll have to install USB drivers using this guide

Boot modified TWRP recovery

While your phone is in fastboot mode, replace path\to\moddedtwrp.img with the actual path of the image

fastboot boot path\to\moddedtwrp.img

Backing up important files

This will back up fsc, fsg, modemst1 and modemst2 to the current path your CMD is opened in (for example C:\platform-tools). Confirm these files are actually there before proceeding.

Keep these backups in a safe place. If your device's software ever gets destroyed, you might need these backups or your phone could lose cellular capabilities.

If you've got anything else you want to back up, do this now. Your Android data will be erased in the next steps.

cmd /c "for %i in (fsg,fsc,modemst1,modemst2) do (adb shell dd if=/dev/block/by-name/%i of=/tmp/%i.bin & adb pull /tmp/%i.bin)"

Backing up your boot image

This will back up your boot image in the current directory (which should be the platform-tools folder)

Replug the cable if it says "no devices/emulators found"

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

Fixing the GPT

If you do not do this, Windows may break your device

adb shell fixgpt

Unmount data

Ignore any possible errors and continue

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

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 19 or 22

rm $

Recreating userdata

Replace 7971MB 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-7971MB = 56GB

mkpart userdata ext4 7971MB 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 20 or 23

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
  • If it doesn't, boot into stock recovery and perform a factory reset there
  • Select Wipe data and cache > Erase everything > yes

Formatting Windows and ESP drives

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

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