From 2f87afd61d3c2e32580db1b27248e838ca3ca565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20G=C3=B3nzalez=20Carbajo?= <76574534+ArturoGC06@users.noreply.github.com> Date: Thu, 6 Apr 2023 02:59:50 +0200 Subject: [PATCH 1/2] Add files via upload --- .../UninstallWindows10X-SurfaceDuo1.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 InstallWindows/UninstallWindows10X-SurfaceDuo1.md diff --git a/InstallWindows/UninstallWindows10X-SurfaceDuo1.md b/InstallWindows/UninstallWindows10X-SurfaceDuo1.md new file mode 100644 index 0000000..ba0aa4b --- /dev/null +++ b/InstallWindows/UninstallWindows10X-SurfaceDuo1.md @@ -0,0 +1,110 @@ +# Uninstall Windows and revert your Surface Duo to stock + +## Files/Tools Needed 📃 +- TWRP image: [twrp.img](https://github.com/WOA-Project/SurfaceDuo-Guides/raw/main/InstallWindows/Files/twrp.img) +- Parted: [parted](https://github.com/WOA-Project/SurfaceDuo-Guides/raw/main/InstallWindows/Files/parted) +- [Platform Tools from Google (ADB and Fastboot)](https://developer.android.com/studio/releases/platform-tools) +- A PC. + +## Warnings ⚠️ + +**THIS WILL WIPE ALL YOUR ANDROID™ AND WINDOWS DATA** + +We don't take any responsibility for any damage done to your phone. By following this guide, you agree to take full responsibility of your actions. +We have done some testing, but this is **AN EARLY PREVIEW** and things can go wrong. + +**PLEASE READ AND BE SURE TO UNDERSTAND THE ENTIRE GUIDE BEFORE STARTING** + +If you caused modifications to Android™ system partitions and are not knowingly using Custom Trusted Boot certificates or do not know what we're talking about here but flashed a dual boot image onto your device, you need to revert this. Please see the dual boot guide for assistance first and foremost. Otherwise below's steps will brick your device. + +## What you'll get 🛒 + +A normal Surface Duo, with Android™ only. Just like you had it before installing Windows. If you haven't broke anything else in the meantime. + +Android™ will have access to the whole memory back again. + +## Steps 🛠️ + +### Make sure you have not done any dual boot guide! + +If you have followed a guide to use dual boot, please first remove dual boot by following the uninstall section in the dual boot guide, this is important: [DualBoot](https://github.com/WOA-Project/SurfaceDuo-Guides/blob/main/InstallWindows/DualBoot-SurfaceDuo1.md) + +### Booting to TWRP + +- Reboot your phone to Surface Duo Bootloader: Press Volume Down + Power until the Microsoft Corporation logo appears on the left, then release the power + button and keep pressing the volume down button until the bootloader appears. +- Plug your phone to your PC, open a command prompt and run the following command: + +``` +fastboot boot twrp.img +``` + +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. + +### Restoring the original partitions + +- Let's copy and run parted: + +``` +adb push /sdcard/ +adb shell "cp /sdcard/parted /sbin/ && chmod 755 /sbin/parted" +adb shell +parted /dev/block/sda +print +``` + +You'll get a list of partitions. + +- Make sure that partitions 6, 7 and 8 are your ESP, Windows and userdata partitions. We'll assume they are for this guide. + If they aren't, take note of these numbers and use them in the next steps. Please make sure these are right, or you'll end up + bricking your Surface Duo. + +⚠️ The next command will wipe all your data. Please make sure that you have backed everything up. ⚠️ + +``` +rm 6 +rm 7 +rm 8 + +# FOR 128GB DEVICES ONLY: --- +mkpart userdata ext4 51.9MB 112GB + +# FOR 256GB DEVICES ONLY: --- +mkpart userdata ext4 51.9MB 240GB +``` + +__This command leaves parted.__ + +``` +quit +``` + +This will get you out of parted. + +Now let's make the userdata partition actually usable: + +``` +mke2fs -t ext4 /dev/block/sda6 +exit +``` + +- Once it is done, you can reboot your phone using ```adb reboot bootloader```. You will be able to boot to Android™ and your phone should work normally. In case it doesn't you likely messed up something above. + +- Once Android™ is confirmed booting, reboot back into the bootloader using ```adb reboot bootloader``` or by pressing Volume Down right at boot. + +You will be back into Surface Duo's bootloader. + +### Relocking the Bootloader + +⚠️⚠️⚠️ If you caused modifications to Android™ system partitions and are not knowingly using Custom Trusted Boot certificates or do not know what we're talking about here but flashed a dual boot image onto your device, you need to revert this. Please see the dual boot guide for assistance first and foremost. Otherwise below's steps will brick your device. ⚠️⚠️⚠️ + +- Reboot your Surface Duo to the Bootloader: Press Volume Down + Power until the Microsoft Corporation logo appears on the left, then release the power + button and keep pressing the volume down button until the bootloader appears. + +- Run this command: + +``` +fastboot flashing lock +``` + +- Reboot your Surface Duo, and Android™ should boot. From 45f5661a472b49921402a15a97bef6de68abcbc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20G=C3=B3nzalez=20Carbajo?= <76574534+ArturoGC06@users.noreply.github.com> Date: Thu, 6 Apr 2023 04:33:46 +0200 Subject: [PATCH 2/2] Created Windows 10X uninstall guide --- .../UninstallWindows10X-SurfaceDuo1.md | 100 ++++++++++-------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/InstallWindows/UninstallWindows10X-SurfaceDuo1.md b/InstallWindows/UninstallWindows10X-SurfaceDuo1.md index ba0aa4b..ae5ef79 100644 --- a/InstallWindows/UninstallWindows10X-SurfaceDuo1.md +++ b/InstallWindows/UninstallWindows10X-SurfaceDuo1.md @@ -1,4 +1,4 @@ -# Uninstall Windows and revert your Surface Duo to stock +# Uninstall Windows 10X ## Files/Tools Needed 📃 - TWRP image: [twrp.img](https://github.com/WOA-Project/SurfaceDuo-Guides/raw/main/InstallWindows/Files/twrp.img) @@ -8,26 +8,22 @@ ## Warnings ⚠️ -**THIS WILL WIPE ALL YOUR ANDROID™ AND WINDOWS DATA** +**THIS WILL WIPE WINDOWS 10X AND ITS DATA** We don't take any responsibility for any damage done to your phone. By following this guide, you agree to take full responsibility of your actions. We have done some testing, but this is **AN EARLY PREVIEW** and things can go wrong. **PLEASE READ AND BE SURE TO UNDERSTAND THE ENTIRE GUIDE BEFORE STARTING** -If you caused modifications to Android™ system partitions and are not knowingly using Custom Trusted Boot certificates or do not know what we're talking about here but flashed a dual boot image onto your device, you need to revert this. Please see the dual boot guide for assistance first and foremost. Otherwise below's steps will brick your device. - ## What you'll get 🛒 -A normal Surface Duo, with Android™ only. Just like you had it before installing Windows. If you haven't broke anything else in the meantime. - -Android™ will have access to the whole memory back again. +A Surface Duo with the partitions ready to install Windows 11/10, or ready to follow the unistall guide if you want to leave it stock. ## Steps 🛠️ -### Make sure you have not done any dual boot guide! +### Not needed but recommended: uninstall the dual boot image: -If you have followed a guide to use dual boot, please first remove dual boot by following the uninstall section in the dual boot guide, this is important: [DualBoot](https://github.com/WOA-Project/SurfaceDuo-Guides/blob/main/InstallWindows/DualBoot-SurfaceDuo1.md) +If you have followed a guide to use dual boot, please first remove dual boot by following the uninstall section in the dual boot guide, this is not necesary but is recommended in case you want update the UEFI image or Android™. ### Booting to TWRP @@ -41,7 +37,7 @@ fastboot boot twrp.img 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. -### Restoring the original partitions +### Removing the Windows partition - Let's copy and run parted: @@ -55,56 +51,72 @@ print You'll get a list of partitions. -- Make sure that partitions 6, 7 and 8 are your ESP, Windows and userdata partitions. We'll assume they are for this guide. - If they aren't, take note of these numbers and use them in the next steps. Please make sure these are right, or you'll end up +- Make sure that partition 7 is your Windows partition. We'll assume it is for this guide. + If it's not, take note of the number and use it in the next steps. Please make sure these are right, or you'll end up bricking your Surface Duo. -⚠️ The next command will wipe all your data. Please make sure that you have backed everything up. ⚠️ +⚠️ The next command will wipe and remove the Windows 10X partition. ⚠️ ``` -rm 6 rm 7 -rm 8 - -# FOR 128GB DEVICES ONLY: --- -mkpart userdata ext4 51.9MB 112GB - -# FOR 256GB DEVICES ONLY: --- -mkpart userdata ext4 51.9MB 240GB ``` -__This command leaves parted.__ +### Recreating the Windows partition +Now we need to create the Windows partition again. +
+ If you used the default splits to make the partitions you can just use this command, just be sure to check it correctly depending on your storage variant +

+ +- 128GB variant (use this only if you choosed 64GB for Android™ and 64GB for Windows when making the partitions!) ``` -quit +mkpart win ntfs 564MB 57344MB ``` -This will get you out of parted. - -Now let's make the userdata partition actually usable: - +- 256GB variant (use this only if you choosed 128GB for Android™ and 128GB for Windows when making the partitions!) ``` -mke2fs -t ext4 /dev/block/sda6 -exit +mkpart win ntfs 564MB 114688MB ``` + +

+
-- Once it is done, you can reboot your phone using ```adb reboot bootloader```. You will be able to boot to Android™ and your phone should work normally. In case it doesn't you likely messed up something above. - -- Once Android™ is confirmed booting, reboot back into the bootloader using ```adb reboot bootloader``` or by pressing Volume Down right at boot. - -You will be back into Surface Duo's bootloader. - -### Relocking the Bootloader - -⚠️⚠️⚠️ If you caused modifications to Android™ system partitions and are not knowingly using Custom Trusted Boot certificates or do not know what we're talking about here but flashed a dual boot image onto your device, you need to revert this. Please see the dual boot guide for assistance first and foremost. Otherwise below's steps will brick your device. ⚠️⚠️⚠️ - -- Reboot your Surface Duo to the Bootloader: Press Volume Down + Power until the Microsoft Corporation logo appears on the left, then release the power - button and keep pressing the volume down button until the bootloader appears. +If you used a different split between Android™ and Windows you'll need to check where the partition before the Windows one ends, and where the next one starts: +``` +mkpart win ntfs [END OF THE PARTITION BEFORE] [START OF THE NEXT PARTITION] +``` +To check where the partions ends and start you just need to take a look at the partition table, so type this to show it: +``` +print +``` +The partition before should be the ESP partition and the next one should be userdata, so we'll asume they are. Take note of the end of ESP, and of the start of userdata and put them in the command. -- Run this command: +
+ Example on how to use it +

+ +Using this partitions: +``` + 6 51.9MB 564MB 512MB fat16 esp boot, esp + 8 176GB 240GB 63.7GB userdata +``` +The command should be: +``` +# mkpart win ntfs 564MB 176GB +⚠️Don't use this command as it is, it won't probably fit your device and it can damage it. This is only meant to show how the command should be used. +``` +

+
+The Windows partition should have been recreated now, we only need to format it. To do so we first need to exit parted: +``` +quit +``` +And then format the partition 7 (that should be the Windows one) to NTFS: ``` -fastboot flashing lock +mkfs.ntfs -f /dev/block/sda7 ``` -- Reboot your Surface Duo, and Android™ should boot. +Finally, check that Android™ still boots and your data is still there. + +After this you will probably want to follow the [reinstall guide](https://github.com/WOA-Project/SurfaceDuo-Guides/blob/main/InstallWindows/ReinstallWindows-SurfaceDuo1.md) if you want to install Windows 11/10 or the [uninstall guide](https://github.com/WOA-Project/SurfaceDuo-Guides/blob/main/InstallWindows/Uninstall-SurfaceDuo1.md) if you want to leave the Duo to stock.