Fix broken ESP

Edit This Page

Files/Tools Needed 📃

For Surface Duo (1st Gen)

For Surface Duo 2

Steps 🛠️

Getting to TWRP

  • Reboot into the Bootloader mode by running this command while inside Android™:
adb reboot bootloader

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

Start by booting 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. Reminder that touch doesn’t work on TWRP for now, so you’ll have to work through your PC.

  • Once inside TWRP, touch will not be working and the device will say it is locked. This is completely normal.

Format the Windows EFI System Partition in TWRP

  • Format the esp partition again with the mkfs.fat tool in TWRP:

For Surface Duo (1st Gen)

adb shell "setenforce 0"
adb shell "mkfs.fat -F32 -s1 /dev/block/sda6"

For Surface Duo 2

adb shell "setenforce 0"
adb push <path to downloaded surfaceduo2-twrp-fssupport.tar> /sdcard/
adb shell "tar -xf /sdcard/surfaceduo2-twrp-fssupport.tar -C /sdcard/fssupport --no-same-owner"
adb shell "chmod 755 /sdcard/fssupport/*"
adb shell "mv /sdcard/fssupport/* /sbin/"
adb shell "mkfs.fat -F32 -s1 /dev/block/sda8"

Going to Mass Storage

  • Let’s load the mass storage shell script in order to boot into Mass Storage from TWRP
adb shell "setenforce 0"
adb push <path to downloaded msc.tar> /sdcard/
adb shell "tar -xf /sdcard/msc.tar -C /sdcard --no-same-owner"
adb shell "sh /sdcard/msc.sh"

Surface Duo should now be in USB 3 SuperSpeed (or what the USB-IF currently calls it) Mass Storage Mode.

Rebuilding Windows EFI System Partition

  • Assign only one drive letter to the esp partition (can be anything from A to Z as long as it’s free)
⚠️ THESE ARE NOT ALL COMMANDS. DISKPART COMMANDS VARY A LOT, SO THESE ARE SOME ROUGH INSTRUCTIONS.
ACTUAL COMMANDS START WITH AN HASHTAG (which you will need to remove)
YOU DO NOT HAVE TO USE THE LETTERS WE USE AT ALL!!!, THEY ONLY NEED TO BE FREE LETTERS. IF LETTERS DONT ASSIGN FINE, USE ANOTHER ONE.
IF ONE PARTITION IS ALREADY ASSIGNED, YOU ALSO DO NOT NEED TO ASSIGN IT AGAIN IF YOU DONT WANT TO.

# list disk
Find the Surface Duo Disk, and take note of the number.
# select disk <number>
# list partition
You will be able to recognize the partitions we made earlier by their size. take note of the ESP and WIN partition numbers.
# select partition <esp-partition-number>
# assign letter=<the drive letter you chose>:
  • Rerun the bcdboot command:
bcdboot <Windows Partition drive letter>:Windows /s <ESP DRIVE LETTER>: /f UEFI
  • Once it is done, you can reboot your phone using adb reboot bootloader. You will be able to boot to Android™ and your phone will work normally. Set it up if you need it.

You will be back into Surface Duo’s bootloader.

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


Š 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.