Partitioning on Surface Duo 1

Edit This Page

Files/Tools Needed 📃

PLEASE READ AND BE SURE TO UNDERSTAND THE ENTIRE GUIDE BEFORE STARTING

What you will get 🛒

You will end up with both Android™ and Windows on your Surface Duo. Android™ and Windows will both split the internal storage (64GB and 64GB or 128GB and 128GB).

Android™ will boot normally, and you will have to use a PC to boot Windows when needed, unless you create a dual boot image (explained later).

Steps 🛠️

Going to the Bootloader menu

  • Start by turning on your Surface Duo into Android™, and unlock it

  • Open a command prompt on your PC

image

  • Go to the folder where you extracted the Google Android™ Platform tools using the CD command and the path of the folder, like so:

image

  • Run the following command to ensure your phone is detected by your PC
adb devices

image

  • Run the following command now
adb reboot bootloader

You will be rebooted to Surface Duo’s bootloader.

Surface Duo in Bootloader mode Image of what you should see right now: Surface Duo in Bootloader mode

Booting to TWRP

  • Plug your phone to your PC, open a command prompt and start by typing the following text, but do not press enter just yet
fastboot boot

image

  • Go find the surfaceduo1-twrp.img file you downloaded earlier, right click it, click “Copy as path”

image

  • Then go back to the Command Prompt window we started writing text in previously, and simply, right click on it with your mouse (or long press if you’re on a touch device), you should now see this:

image

  • Now you can press enter

image

You will now boot to TWRP. Touch will not be working and the device will say it is locked. This is completely normal. Keep the phone plugged to your PC and continue along.

Preparing TWRP

  • Once booted into TWRP, start by running the following command to make sure everything we do is accepted by the device:
adb shell "setenforce 0"

image

  • Now, let’s copy parted onto the device, first, start by typing the following text, but do not press enter just yet
adb push

image

  • Go find the parted file you downloaded earlier, right click it, click “Copy as path”

image

  • Then go back to the Command Prompt window we started writing text in previously, and simply, right click on it with your mouse (or long press if you’re on a touch device), you should now see this:

image

  • And now, continue to write the rest of the command, like so:
 /sdcard/

image

  • Now you can press enter

image

  • Now let’s install parted correctly onto the TWRP image, by running the following command
adb shell "mv /sdcard/parted /sbin/parted && chmod 755 /sbin/parted"

image

  • Now, let’s open a shell onto the device, by running the following command
adb shell

image

  • Now we are issuing commands directly from inside Surface Duo using the PC.

Making the partitions

Dangerous section

  • Let’s now run parted:
parted /dev/block/sda

image

  • Let’s now run a specific unit command:
unit s

image

  • And let’s execute parted’s print command:
print

image

You’ll get a list of partitions.

Make sure that the last partition listed is numbered 6. If it is not, below’s commands may damage your phone. Contact us if that’s your case

Take note of original sizing value of the userdata, we highlighted the given for you below, you will need it shortly.

image

  • Now run the Partition Offsets Helper Tool you downloaded earlier (PartitionOffsetsHelperTool.exe) by double clicking on it

image

  • Answer whenever or not your device is a 128GB model or 256GB model (Y = 128GB, N = 256GB)

image

  • Answer which total storage capacity you want to give to Android

image

  • Now select with your mouse all 3 commands

image

  • Right click on the command prompt, the selection will vanish and no menu will show, this is expected

image

  • Open Notepad

image

  • Paste all of them here

image

  • Edit the highlighted value below with the one you noted earlier, replacing it fully, here’s a before for us:

image

  • And here’s after the edit:

image

It is possible both values are the same, do not worry about it if that’s the case, above, we intentionally showed different values as well to illustrate

  • Go back to the Partition Offsets Helper Tool window/command prompt

image

  • Press enter, the window will exit.

  • Go back to the parted window/command prompt

image

  • Run the following command first

This command removes the userdata partition

rm 6

image

  • Now come back to Notepad

image

  • Copy the first command

image

  • Paste it with right click onto the parted window, and press enter

image

It is possible that parted says the partition is not aligned for best performance, if that’s the case for you, ignore such warning by answering “i” like so:

image

  • Copy the second command

image

  • Paste it with right click onto the parted window, and press enter

image

  • Copy the third command

image

  • Paste it with right click onto the parted window, and press enter

image

It is possible that parted says the partition is not aligned for best performance, if that’s the case for you, ignore such warning by answering “i” again

  • Run the following command

This command sets the ESP partition created earlier as an EFI system partition type.

set 7 esp on

image

  • Run the following command to sanity check what you did:
print

image

If this looks good, proceed to below’s step, if something looks horribly wrong, contact us.

  • Run the following command

This command leaves parted.

quit

image

This will get you out of parted.

We have deleted partition 6, which was the Android™ userdata partition, and created 3 partitions: the new userdata partition for Android™, just smaller; an esp partition which will contain the Windows boot files; and the last one, a win partition that will have Windows.

Now let’s make these partitions actually usable:

  • Start with this command:
mke2fs -t ext4 /dev/block/sda6

image

  • Then continue with this command:
mkfs.fat -F32 -s1 /dev/block/sda7

image

  • Then finish with this command:
mkfs.ntfs -f /dev/block/sda8

image

  • And let’s exit the device shell
exit

image

End of the Dangerous section

Rebooting into Android

Now, reboot into Android again:

adb reboot

image

  • You should now be seeing the Android™ Out of Box Experience (OOBE). Setup your phone to confirm it works correctly.

Android™ - OOBE

Congratulations, you successfully partitioned your device.

  • Assuming your Surface Duo is booted to Android™, plugged to your PC

  • Using the Microsoft Launcher, find the settings app

A1 Android™ - Open Settings

  • Open the Android™ Settings app

A2 Android™ - Settings Opened

  • Scroll down to the about section, and open it

A3 Android™ - Settings About

  • Scroll all the way down til you see the Build Number field

A4 Android™ - Settings About Down

  • Press the Build number field 7 times consecutively, you should first start to see a popup after 3 taps

A5 Android™ - Settings About Down Tap Dev

  • Once done tapping 7 times, you should be seeing this popup instead

A6 Android™ - Settings About Down Tap Dev Done

  • Now go to the System section, you should see a new Developer options section like shown below

A7 Android™ - Settings System with Dev

  • Go to the Developer options section

Android™ Settings System Dev Options

  • Scroll all the way down til you see the “USB debugging” option

Android™ Settings - Dev - Debugging Option

  • And turn on the “USB debugging” option

Android™ Settings - Dev - Debugging Option Confirmation

The End

And we’re done, please continue with the previous guide that made you land here :)


Additional Context and Notes If you somehow break entirely your partition table, you might be interested in the original offsets of each partition in order to fix it.
mkpart ssd 6s 7s
mkpart persist ext4 8s 8199s
mkpart metadata ext4 8200s 12295s
mkpart frp 12296s 12423s
mkpart misc 12424s 12679s

The offsets are valid for both the Surface Duo (1st Gen) 128GB model, and the Surface Duo (1st Gen) 256GB model. They do not include userdata. You will have to recreate this yourself.

(NEVER RUN THESE COMMANDS IF YOU DO NOT NEED TO OR YOU ALREADY PARTITIONS IN PLACE, ADVANCED USERS ONLY, YOU MAY KILL YOUR PHONE HERE)


Š 2020-2024 The Duo WOA Authors

Snapdragon is a registered trademark of Qualcomm Incorporated. Microsoft, the Microsoft Corporate Logo, Windows, Surface, Surface Duo, Windows Hello, Continuum, Hyper-V, and DirectX are registered trademarks of Microsoft Corporation in the United States. Android is a registered trademark of Google LLC. Miracast is a registered trademark of the Wi-Fi Alliance. Other binaries may be copyright Qualcomm Incorporated and Microsoft Surface.

Limited emergency calling

Running Windows on your Surface Duo is not a replacement for a proper phone operating system and does not have emergency calling capabilities.

Hello from Seattle (US), France, Italy.