Can't boot to windows after installing Ubuntu in UEFIDual boot Linux Mint in a GPT style hard drive along...

How can I deal with someone that wants to kill something that isn't supposed to be killed?

How can I make sure my players' decisions have consequences?

Historicity doubted by Romans

dos2unix is unable to convert typescript file to unix format

ExactlyOne extension method

How could an engineer advance human civilization by time traveling to the past?

Why is a dedicated QA team member necessary?

The 50,000 row query limit is not actually a "per APEX call" as widely believed

Idioms: Should it be " the internet is a seemingly infinite well of information" or "the internet is a seemingly infinite wealth of information"

Are gangsters hired to attack people at a train station classified as a terrorist attack?

Should i describe deeply a character before killing it?

Sometimes you are this word with three vowels

how to add 1 milliseconds on a datetime string?

What the purpose of the fuel shutoff valve?

Where is this photo of a group of hikers taken? Is it really in the Ural?

Is there a way to factor age into the mass-luminosity relationship for stars?

My current job follows "worst practices". How can I talk about my experience in an interview without giving off red flags?

Is it okay to paraphrase other authors' literature reviews?

Film where a boy turns into a princess

Using "Kollege" as "university friend"?

Other than a swing wing, what types of variable geometry have flown?

How do I run a game when my PCs have different approaches to combat?

What is "ass door"?

Are glider winch launches rarer in the USA than in the rest of the world? Why?



Can't boot to windows after installing Ubuntu in UEFI


Dual boot Linux Mint in a GPT style hard drive along with Windows 8Dual boot windows on second harddrive, UEFI/GPT systemUnable to shutdown Windows after installing GRUBDual-boot windows/debian, no boot menu?Grub screen not showing after installing kali?Mint UEFI partition suddenly not recognized by UEFI anymore - after booting Windows 7 onceReinstall Ubuntu in UEFI mode alongside ManjaroSystem skips grub and loads to Windows (UEFI)GRUB disappeared from Boot Menu after UEFI (BIOS) upgrade on Thinkpad X1 Carbon gen5Linux Windows dual boot UEFI BIOS confusion






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







0















I'm trying to install an Ubuntu dual boot on my windows 10 laptop. Windows 10 used the legacy BIOS setting.



When I start the Ubuntu installation I get a warning about BIOS and UEFI, other operating systems becoming unbootable, only proceed if sure, etc. But since no alternative is offered (other than simply giving up and not installing Linux) I decided to proceed, and found that after install, GRUB only offered a Linux option.



Is there a way for me to boot from Windows again?
I don't mind to uninstall ubuntu










share|improve this question
















bumped to the homepage by Community 39 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 3





    This is really a windows question.. But which Windows? Do you know if windows was booting from Legacy or UEFI? Under Linux do try sudo update-grub

    – Philip Couling
    Apr 2 at 9:02













  • Windows is booting from legacy and it's windows 10

    – Azhar
    Apr 4 at 8:00


















0















I'm trying to install an Ubuntu dual boot on my windows 10 laptop. Windows 10 used the legacy BIOS setting.



When I start the Ubuntu installation I get a warning about BIOS and UEFI, other operating systems becoming unbootable, only proceed if sure, etc. But since no alternative is offered (other than simply giving up and not installing Linux) I decided to proceed, and found that after install, GRUB only offered a Linux option.



Is there a way for me to boot from Windows again?
I don't mind to uninstall ubuntu










share|improve this question
















bumped to the homepage by Community 39 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.











  • 3





    This is really a windows question.. But which Windows? Do you know if windows was booting from Legacy or UEFI? Under Linux do try sudo update-grub

    – Philip Couling
    Apr 2 at 9:02













  • Windows is booting from legacy and it's windows 10

    – Azhar
    Apr 4 at 8:00














0












0








0


1






I'm trying to install an Ubuntu dual boot on my windows 10 laptop. Windows 10 used the legacy BIOS setting.



When I start the Ubuntu installation I get a warning about BIOS and UEFI, other operating systems becoming unbootable, only proceed if sure, etc. But since no alternative is offered (other than simply giving up and not installing Linux) I decided to proceed, and found that after install, GRUB only offered a Linux option.



Is there a way for me to boot from Windows again?
I don't mind to uninstall ubuntu










share|improve this question
















I'm trying to install an Ubuntu dual boot on my windows 10 laptop. Windows 10 used the legacy BIOS setting.



When I start the Ubuntu installation I get a warning about BIOS and UEFI, other operating systems becoming unbootable, only proceed if sure, etc. But since no alternative is offered (other than simply giving up and not installing Linux) I decided to proceed, and found that after install, GRUB only offered a Linux option.



Is there a way for me to boot from Windows again?
I don't mind to uninstall ubuntu







linux windows dual-boot uefi bios






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 2 at 7:15







Azhar

















asked Apr 2 at 7:06









AzharAzhar

111 bronze badge




111 bronze badge





bumped to the homepage by Community 39 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 39 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 3





    This is really a windows question.. But which Windows? Do you know if windows was booting from Legacy or UEFI? Under Linux do try sudo update-grub

    – Philip Couling
    Apr 2 at 9:02













  • Windows is booting from legacy and it's windows 10

    – Azhar
    Apr 4 at 8:00














  • 3





    This is really a windows question.. But which Windows? Do you know if windows was booting from Legacy or UEFI? Under Linux do try sudo update-grub

    – Philip Couling
    Apr 2 at 9:02













  • Windows is booting from legacy and it's windows 10

    – Azhar
    Apr 4 at 8:00








3




3





This is really a windows question.. But which Windows? Do you know if windows was booting from Legacy or UEFI? Under Linux do try sudo update-grub

– Philip Couling
Apr 2 at 9:02







This is really a windows question.. But which Windows? Do you know if windows was booting from Legacy or UEFI? Under Linux do try sudo update-grub

– Philip Couling
Apr 2 at 9:02















Windows is booting from legacy and it's windows 10

– Azhar
Apr 4 at 8:00





Windows is booting from legacy and it's windows 10

– Azhar
Apr 4 at 8:00










2 Answers
2






active

oldest

votes


















0














Okay so this definitely remains a windows question and really belongs on superuser.com or similar.



However in the interests of being helpful: from what you've written it sounds like the installer has changed the system of recording partitions on your hard disk. Your Windows boot loader was stored in the MBR (the first sector on the hard drive) along with the size and positions of your partitions.



In order to install as UEFI, the installer has rewritten the size and position of your partitions in GPT format completely overwritten the MBR in the process. This wasn't an accident. The two partition tables cannot co-exist and this was a necessary step. IE: this is what you were warned about.



I am not a windows expert, this is a linux forum. But I guess from here you basically have two options:




  1. Fix forward (try to install a windows EFI boot loader)


    • In theory, this might be possible as UEFI just needs the Windos boot loader installed in your (new) EFI partition

    • I have personally had problems getting windows to boot from an Ubuntu-created EFI partition so no guarantees here.



  2. Try to reverse out (try to revert back to MBR)


    • This is tricky and dangerous and still requires you to seek help from windows forums

    • In theory you could note down the details of your partitions and try to replace GPT with MBR containing the same partitions

    • Get this wrong and you could lose all your data so think very carefully before you try this.

    • Once you've replaced the partition table you would then need to re-install the windows bootloader to your MBR (out of scope for this forum and I don't know how)




As I say. From here try searching the web and asking on Superuser.com for windows specific instructions.






share|improve this answer
























  • Thank you for your information

    – Azhar
    Apr 5 at 11:19



















0














Depending on exactly what the warnings said, and what exact choices you made when installing Ubuntu, the installation process may have done one of a few things:




  • It may have converted the partitioning from MBR to GPT style to install UEFI-style, keeping (or resizing) the existing partitions. This is the best option: you'll just need to install a UEFI-style bootloader and you can then get back to Windows. Once the Windows UEFI bootloader is on the disk, Ubuntu might even detect it automatically the next time you run sudo update-grub and add it to the GRUB boot menu for you.


  • It may have just set up a UEFI-style bootloader on a MBR-partitioned disk. This is a problem, since while Linux can do this, Microsoft says Windows won't support this combination. However, returning to legacy-style Windows-only boot should be fairly easily doable in this case.


  • It may have taken the entire disk for Ubuntu, so your Windows installation was overwritten and no longer exists. This is the worst-case scenario: if you want Windows back, you'll need to fully reinstall it and your existing Windows files will be gone.



Identifying your situation



In Linux, run sudo fdisk -l /dev/sda. If your system disk is something other than /dev/sda, replace that with the appropriate device name. For example, on a new system with a NVMe SSD, it might be /dev/nvme0n1 instead.



The output should look similar to this:



$ sudo fdisk -l /dev/sda
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 2B05CCE8-92BC-4308-B770-174CE63D044F

Device Start End Sectors Size Type
/dev/sda1 2048 1050623 1048576 512M EFI System
/dev/sda2 1050624 1550335 499712 244M Linux filesystem
<... other partitions listed here...>


If your version of Linux fdisk isn't too old, the output should include a line that says either



Disklabel type: gpt


or



Disklabel type: mbr


This identifies the partitioning style that is currently in use on your system disk.



GPT-partitioned system disk - installing a Windows UEFI bootloader



Since the Linux installer has set up a UEFI bootloader for us, there should also be an EFI system partition (ESP for short) on the disk. In the fdisk -l output, it is the partition that has its Type listed as EFI System and its size would typically be something in between 100M and 512M. In Linux, it might be mounted at /boot/efi. You might want to run sudo ls -l /boot/efi or take a peek at it with some GUI file manager so that you'll recognize the contents of this partition - you'll be seeing it at Windows command prompt for a bit. Typically, if ESP is mounted at /boot/efi, there should be a sub-directory like /boot/efi/EFI/ubuntu that contains the actual UEFI bootloader of Ubuntu.



Now, get yourself a Windows 10 installation media. You won't need the license code. Boot your computer from that installation media. Since your Ubuntu installed in UEFI mode, your computer will probably boot the Windows installer in UEFI mode automatically too, but in case you see two boot options for the installation media, only one of those options boots it in UEFI mode, and that's the one you should pick. (Hopefully the boot menu will say which is which - it depends on your system's UEFI firmware.)



When the Windows installer displays the initial screen with an "Install now" button in the middle of the screen, select instead "Repair your computer" near the bottom.



From the next menu, choose "Troubleshoot" and then "Command Prompt".



Now, type in these commands:



diskpart
list vol


This should display a list of partitions. Find the partition that has FAT32 in the "Fs" column - it should be your ESP you saw in Linux before. Note its volume number (Volume ### in the leftmost column) and assign an unused drive letter (like X:) for it. For example, if ESP is listed as Volume 2:



sel vol 2
assign letter=x:


It should say DiskPart successfully assigned the drive letter or mount point. at this time.
Then type exitto quit the DiskPart utility.



Switch to the EFI directory on the ESP:



cd /d x:EFI
dir


If you see the ubuntu directory, you're in the right place.



Now create a directory or two for the Windows UEFI bootloader:



mkdir Microsoft
cd Microsoft
mkdir Boot
cd Boot


Install the Windows UEFI bootloader to the ESP and re-create the Windows BCD registry:



bcdboot c:Windows /l en-us /s x: /f UEFI /addlast


If you want the Windows bootloader to use a language other than English, replace en-us in the command above with the appropriate Windows language code.



Now type exit, remove the Windows installation media and reboot your system. It should come up in Ubuntu just as before. Run sudo update-grub to update the GRUB boot menu. If all goes well, it should now auto-detect the presence of UEFI Windows bootloader and add it to the GRUB boot menu.



Also now in the BIOS boot order menu, there should be a item named "Windows Boot Manager". If you want to remove Ubuntu and go back to Windows-only system, just switch this one as the primary boot option, and the system should skip GRUB and boot into Windows by default. Then you can remove the Linux partitions using Windows Disk Management. Do not remove the EFI System partition, as now Windows also needs it for booting.



(Work in progress - I'll add the MBR restoration option later)






share|improve this answer


























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510013%2fcant-boot-to-windows-after-installing-ubuntu-in-uefi%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Okay so this definitely remains a windows question and really belongs on superuser.com or similar.



    However in the interests of being helpful: from what you've written it sounds like the installer has changed the system of recording partitions on your hard disk. Your Windows boot loader was stored in the MBR (the first sector on the hard drive) along with the size and positions of your partitions.



    In order to install as UEFI, the installer has rewritten the size and position of your partitions in GPT format completely overwritten the MBR in the process. This wasn't an accident. The two partition tables cannot co-exist and this was a necessary step. IE: this is what you were warned about.



    I am not a windows expert, this is a linux forum. But I guess from here you basically have two options:




    1. Fix forward (try to install a windows EFI boot loader)


      • In theory, this might be possible as UEFI just needs the Windos boot loader installed in your (new) EFI partition

      • I have personally had problems getting windows to boot from an Ubuntu-created EFI partition so no guarantees here.



    2. Try to reverse out (try to revert back to MBR)


      • This is tricky and dangerous and still requires you to seek help from windows forums

      • In theory you could note down the details of your partitions and try to replace GPT with MBR containing the same partitions

      • Get this wrong and you could lose all your data so think very carefully before you try this.

      • Once you've replaced the partition table you would then need to re-install the windows bootloader to your MBR (out of scope for this forum and I don't know how)




    As I say. From here try searching the web and asking on Superuser.com for windows specific instructions.






    share|improve this answer
























    • Thank you for your information

      – Azhar
      Apr 5 at 11:19
















    0














    Okay so this definitely remains a windows question and really belongs on superuser.com or similar.



    However in the interests of being helpful: from what you've written it sounds like the installer has changed the system of recording partitions on your hard disk. Your Windows boot loader was stored in the MBR (the first sector on the hard drive) along with the size and positions of your partitions.



    In order to install as UEFI, the installer has rewritten the size and position of your partitions in GPT format completely overwritten the MBR in the process. This wasn't an accident. The two partition tables cannot co-exist and this was a necessary step. IE: this is what you were warned about.



    I am not a windows expert, this is a linux forum. But I guess from here you basically have two options:




    1. Fix forward (try to install a windows EFI boot loader)


      • In theory, this might be possible as UEFI just needs the Windos boot loader installed in your (new) EFI partition

      • I have personally had problems getting windows to boot from an Ubuntu-created EFI partition so no guarantees here.



    2. Try to reverse out (try to revert back to MBR)


      • This is tricky and dangerous and still requires you to seek help from windows forums

      • In theory you could note down the details of your partitions and try to replace GPT with MBR containing the same partitions

      • Get this wrong and you could lose all your data so think very carefully before you try this.

      • Once you've replaced the partition table you would then need to re-install the windows bootloader to your MBR (out of scope for this forum and I don't know how)




    As I say. From here try searching the web and asking on Superuser.com for windows specific instructions.






    share|improve this answer
























    • Thank you for your information

      – Azhar
      Apr 5 at 11:19














    0












    0








    0







    Okay so this definitely remains a windows question and really belongs on superuser.com or similar.



    However in the interests of being helpful: from what you've written it sounds like the installer has changed the system of recording partitions on your hard disk. Your Windows boot loader was stored in the MBR (the first sector on the hard drive) along with the size and positions of your partitions.



    In order to install as UEFI, the installer has rewritten the size and position of your partitions in GPT format completely overwritten the MBR in the process. This wasn't an accident. The two partition tables cannot co-exist and this was a necessary step. IE: this is what you were warned about.



    I am not a windows expert, this is a linux forum. But I guess from here you basically have two options:




    1. Fix forward (try to install a windows EFI boot loader)


      • In theory, this might be possible as UEFI just needs the Windos boot loader installed in your (new) EFI partition

      • I have personally had problems getting windows to boot from an Ubuntu-created EFI partition so no guarantees here.



    2. Try to reverse out (try to revert back to MBR)


      • This is tricky and dangerous and still requires you to seek help from windows forums

      • In theory you could note down the details of your partitions and try to replace GPT with MBR containing the same partitions

      • Get this wrong and you could lose all your data so think very carefully before you try this.

      • Once you've replaced the partition table you would then need to re-install the windows bootloader to your MBR (out of scope for this forum and I don't know how)




    As I say. From here try searching the web and asking on Superuser.com for windows specific instructions.






    share|improve this answer













    Okay so this definitely remains a windows question and really belongs on superuser.com or similar.



    However in the interests of being helpful: from what you've written it sounds like the installer has changed the system of recording partitions on your hard disk. Your Windows boot loader was stored in the MBR (the first sector on the hard drive) along with the size and positions of your partitions.



    In order to install as UEFI, the installer has rewritten the size and position of your partitions in GPT format completely overwritten the MBR in the process. This wasn't an accident. The two partition tables cannot co-exist and this was a necessary step. IE: this is what you were warned about.



    I am not a windows expert, this is a linux forum. But I guess from here you basically have two options:




    1. Fix forward (try to install a windows EFI boot loader)


      • In theory, this might be possible as UEFI just needs the Windos boot loader installed in your (new) EFI partition

      • I have personally had problems getting windows to boot from an Ubuntu-created EFI partition so no guarantees here.



    2. Try to reverse out (try to revert back to MBR)


      • This is tricky and dangerous and still requires you to seek help from windows forums

      • In theory you could note down the details of your partitions and try to replace GPT with MBR containing the same partitions

      • Get this wrong and you could lose all your data so think very carefully before you try this.

      • Once you've replaced the partition table you would then need to re-install the windows bootloader to your MBR (out of scope for this forum and I don't know how)




    As I say. From here try searching the web and asking on Superuser.com for windows specific instructions.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Apr 4 at 9:30









    Philip CoulingPhilip Couling

    4,2071 gold badge16 silver badges27 bronze badges




    4,2071 gold badge16 silver badges27 bronze badges













    • Thank you for your information

      – Azhar
      Apr 5 at 11:19



















    • Thank you for your information

      – Azhar
      Apr 5 at 11:19

















    Thank you for your information

    – Azhar
    Apr 5 at 11:19





    Thank you for your information

    – Azhar
    Apr 5 at 11:19













    0














    Depending on exactly what the warnings said, and what exact choices you made when installing Ubuntu, the installation process may have done one of a few things:




    • It may have converted the partitioning from MBR to GPT style to install UEFI-style, keeping (or resizing) the existing partitions. This is the best option: you'll just need to install a UEFI-style bootloader and you can then get back to Windows. Once the Windows UEFI bootloader is on the disk, Ubuntu might even detect it automatically the next time you run sudo update-grub and add it to the GRUB boot menu for you.


    • It may have just set up a UEFI-style bootloader on a MBR-partitioned disk. This is a problem, since while Linux can do this, Microsoft says Windows won't support this combination. However, returning to legacy-style Windows-only boot should be fairly easily doable in this case.


    • It may have taken the entire disk for Ubuntu, so your Windows installation was overwritten and no longer exists. This is the worst-case scenario: if you want Windows back, you'll need to fully reinstall it and your existing Windows files will be gone.



    Identifying your situation



    In Linux, run sudo fdisk -l /dev/sda. If your system disk is something other than /dev/sda, replace that with the appropriate device name. For example, on a new system with a NVMe SSD, it might be /dev/nvme0n1 instead.



    The output should look similar to this:



    $ sudo fdisk -l /dev/sda
    Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: gpt
    Disk identifier: 2B05CCE8-92BC-4308-B770-174CE63D044F

    Device Start End Sectors Size Type
    /dev/sda1 2048 1050623 1048576 512M EFI System
    /dev/sda2 1050624 1550335 499712 244M Linux filesystem
    <... other partitions listed here...>


    If your version of Linux fdisk isn't too old, the output should include a line that says either



    Disklabel type: gpt


    or



    Disklabel type: mbr


    This identifies the partitioning style that is currently in use on your system disk.



    GPT-partitioned system disk - installing a Windows UEFI bootloader



    Since the Linux installer has set up a UEFI bootloader for us, there should also be an EFI system partition (ESP for short) on the disk. In the fdisk -l output, it is the partition that has its Type listed as EFI System and its size would typically be something in between 100M and 512M. In Linux, it might be mounted at /boot/efi. You might want to run sudo ls -l /boot/efi or take a peek at it with some GUI file manager so that you'll recognize the contents of this partition - you'll be seeing it at Windows command prompt for a bit. Typically, if ESP is mounted at /boot/efi, there should be a sub-directory like /boot/efi/EFI/ubuntu that contains the actual UEFI bootloader of Ubuntu.



    Now, get yourself a Windows 10 installation media. You won't need the license code. Boot your computer from that installation media. Since your Ubuntu installed in UEFI mode, your computer will probably boot the Windows installer in UEFI mode automatically too, but in case you see two boot options for the installation media, only one of those options boots it in UEFI mode, and that's the one you should pick. (Hopefully the boot menu will say which is which - it depends on your system's UEFI firmware.)



    When the Windows installer displays the initial screen with an "Install now" button in the middle of the screen, select instead "Repair your computer" near the bottom.



    From the next menu, choose "Troubleshoot" and then "Command Prompt".



    Now, type in these commands:



    diskpart
    list vol


    This should display a list of partitions. Find the partition that has FAT32 in the "Fs" column - it should be your ESP you saw in Linux before. Note its volume number (Volume ### in the leftmost column) and assign an unused drive letter (like X:) for it. For example, if ESP is listed as Volume 2:



    sel vol 2
    assign letter=x:


    It should say DiskPart successfully assigned the drive letter or mount point. at this time.
    Then type exitto quit the DiskPart utility.



    Switch to the EFI directory on the ESP:



    cd /d x:EFI
    dir


    If you see the ubuntu directory, you're in the right place.



    Now create a directory or two for the Windows UEFI bootloader:



    mkdir Microsoft
    cd Microsoft
    mkdir Boot
    cd Boot


    Install the Windows UEFI bootloader to the ESP and re-create the Windows BCD registry:



    bcdboot c:Windows /l en-us /s x: /f UEFI /addlast


    If you want the Windows bootloader to use a language other than English, replace en-us in the command above with the appropriate Windows language code.



    Now type exit, remove the Windows installation media and reboot your system. It should come up in Ubuntu just as before. Run sudo update-grub to update the GRUB boot menu. If all goes well, it should now auto-detect the presence of UEFI Windows bootloader and add it to the GRUB boot menu.



    Also now in the BIOS boot order menu, there should be a item named "Windows Boot Manager". If you want to remove Ubuntu and go back to Windows-only system, just switch this one as the primary boot option, and the system should skip GRUB and boot into Windows by default. Then you can remove the Linux partitions using Windows Disk Management. Do not remove the EFI System partition, as now Windows also needs it for booting.



    (Work in progress - I'll add the MBR restoration option later)






    share|improve this answer




























      0














      Depending on exactly what the warnings said, and what exact choices you made when installing Ubuntu, the installation process may have done one of a few things:




      • It may have converted the partitioning from MBR to GPT style to install UEFI-style, keeping (or resizing) the existing partitions. This is the best option: you'll just need to install a UEFI-style bootloader and you can then get back to Windows. Once the Windows UEFI bootloader is on the disk, Ubuntu might even detect it automatically the next time you run sudo update-grub and add it to the GRUB boot menu for you.


      • It may have just set up a UEFI-style bootloader on a MBR-partitioned disk. This is a problem, since while Linux can do this, Microsoft says Windows won't support this combination. However, returning to legacy-style Windows-only boot should be fairly easily doable in this case.


      • It may have taken the entire disk for Ubuntu, so your Windows installation was overwritten and no longer exists. This is the worst-case scenario: if you want Windows back, you'll need to fully reinstall it and your existing Windows files will be gone.



      Identifying your situation



      In Linux, run sudo fdisk -l /dev/sda. If your system disk is something other than /dev/sda, replace that with the appropriate device name. For example, on a new system with a NVMe SSD, it might be /dev/nvme0n1 instead.



      The output should look similar to this:



      $ sudo fdisk -l /dev/sda
      Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disklabel type: gpt
      Disk identifier: 2B05CCE8-92BC-4308-B770-174CE63D044F

      Device Start End Sectors Size Type
      /dev/sda1 2048 1050623 1048576 512M EFI System
      /dev/sda2 1050624 1550335 499712 244M Linux filesystem
      <... other partitions listed here...>


      If your version of Linux fdisk isn't too old, the output should include a line that says either



      Disklabel type: gpt


      or



      Disklabel type: mbr


      This identifies the partitioning style that is currently in use on your system disk.



      GPT-partitioned system disk - installing a Windows UEFI bootloader



      Since the Linux installer has set up a UEFI bootloader for us, there should also be an EFI system partition (ESP for short) on the disk. In the fdisk -l output, it is the partition that has its Type listed as EFI System and its size would typically be something in between 100M and 512M. In Linux, it might be mounted at /boot/efi. You might want to run sudo ls -l /boot/efi or take a peek at it with some GUI file manager so that you'll recognize the contents of this partition - you'll be seeing it at Windows command prompt for a bit. Typically, if ESP is mounted at /boot/efi, there should be a sub-directory like /boot/efi/EFI/ubuntu that contains the actual UEFI bootloader of Ubuntu.



      Now, get yourself a Windows 10 installation media. You won't need the license code. Boot your computer from that installation media. Since your Ubuntu installed in UEFI mode, your computer will probably boot the Windows installer in UEFI mode automatically too, but in case you see two boot options for the installation media, only one of those options boots it in UEFI mode, and that's the one you should pick. (Hopefully the boot menu will say which is which - it depends on your system's UEFI firmware.)



      When the Windows installer displays the initial screen with an "Install now" button in the middle of the screen, select instead "Repair your computer" near the bottom.



      From the next menu, choose "Troubleshoot" and then "Command Prompt".



      Now, type in these commands:



      diskpart
      list vol


      This should display a list of partitions. Find the partition that has FAT32 in the "Fs" column - it should be your ESP you saw in Linux before. Note its volume number (Volume ### in the leftmost column) and assign an unused drive letter (like X:) for it. For example, if ESP is listed as Volume 2:



      sel vol 2
      assign letter=x:


      It should say DiskPart successfully assigned the drive letter or mount point. at this time.
      Then type exitto quit the DiskPart utility.



      Switch to the EFI directory on the ESP:



      cd /d x:EFI
      dir


      If you see the ubuntu directory, you're in the right place.



      Now create a directory or two for the Windows UEFI bootloader:



      mkdir Microsoft
      cd Microsoft
      mkdir Boot
      cd Boot


      Install the Windows UEFI bootloader to the ESP and re-create the Windows BCD registry:



      bcdboot c:Windows /l en-us /s x: /f UEFI /addlast


      If you want the Windows bootloader to use a language other than English, replace en-us in the command above with the appropriate Windows language code.



      Now type exit, remove the Windows installation media and reboot your system. It should come up in Ubuntu just as before. Run sudo update-grub to update the GRUB boot menu. If all goes well, it should now auto-detect the presence of UEFI Windows bootloader and add it to the GRUB boot menu.



      Also now in the BIOS boot order menu, there should be a item named "Windows Boot Manager". If you want to remove Ubuntu and go back to Windows-only system, just switch this one as the primary boot option, and the system should skip GRUB and boot into Windows by default. Then you can remove the Linux partitions using Windows Disk Management. Do not remove the EFI System partition, as now Windows also needs it for booting.



      (Work in progress - I'll add the MBR restoration option later)






      share|improve this answer


























        0












        0








        0







        Depending on exactly what the warnings said, and what exact choices you made when installing Ubuntu, the installation process may have done one of a few things:




        • It may have converted the partitioning from MBR to GPT style to install UEFI-style, keeping (or resizing) the existing partitions. This is the best option: you'll just need to install a UEFI-style bootloader and you can then get back to Windows. Once the Windows UEFI bootloader is on the disk, Ubuntu might even detect it automatically the next time you run sudo update-grub and add it to the GRUB boot menu for you.


        • It may have just set up a UEFI-style bootloader on a MBR-partitioned disk. This is a problem, since while Linux can do this, Microsoft says Windows won't support this combination. However, returning to legacy-style Windows-only boot should be fairly easily doable in this case.


        • It may have taken the entire disk for Ubuntu, so your Windows installation was overwritten and no longer exists. This is the worst-case scenario: if you want Windows back, you'll need to fully reinstall it and your existing Windows files will be gone.



        Identifying your situation



        In Linux, run sudo fdisk -l /dev/sda. If your system disk is something other than /dev/sda, replace that with the appropriate device name. For example, on a new system with a NVMe SSD, it might be /dev/nvme0n1 instead.



        The output should look similar to this:



        $ sudo fdisk -l /dev/sda
        Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
        Units: sectors of 1 * 512 = 512 bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disklabel type: gpt
        Disk identifier: 2B05CCE8-92BC-4308-B770-174CE63D044F

        Device Start End Sectors Size Type
        /dev/sda1 2048 1050623 1048576 512M EFI System
        /dev/sda2 1050624 1550335 499712 244M Linux filesystem
        <... other partitions listed here...>


        If your version of Linux fdisk isn't too old, the output should include a line that says either



        Disklabel type: gpt


        or



        Disklabel type: mbr


        This identifies the partitioning style that is currently in use on your system disk.



        GPT-partitioned system disk - installing a Windows UEFI bootloader



        Since the Linux installer has set up a UEFI bootloader for us, there should also be an EFI system partition (ESP for short) on the disk. In the fdisk -l output, it is the partition that has its Type listed as EFI System and its size would typically be something in between 100M and 512M. In Linux, it might be mounted at /boot/efi. You might want to run sudo ls -l /boot/efi or take a peek at it with some GUI file manager so that you'll recognize the contents of this partition - you'll be seeing it at Windows command prompt for a bit. Typically, if ESP is mounted at /boot/efi, there should be a sub-directory like /boot/efi/EFI/ubuntu that contains the actual UEFI bootloader of Ubuntu.



        Now, get yourself a Windows 10 installation media. You won't need the license code. Boot your computer from that installation media. Since your Ubuntu installed in UEFI mode, your computer will probably boot the Windows installer in UEFI mode automatically too, but in case you see two boot options for the installation media, only one of those options boots it in UEFI mode, and that's the one you should pick. (Hopefully the boot menu will say which is which - it depends on your system's UEFI firmware.)



        When the Windows installer displays the initial screen with an "Install now" button in the middle of the screen, select instead "Repair your computer" near the bottom.



        From the next menu, choose "Troubleshoot" and then "Command Prompt".



        Now, type in these commands:



        diskpart
        list vol


        This should display a list of partitions. Find the partition that has FAT32 in the "Fs" column - it should be your ESP you saw in Linux before. Note its volume number (Volume ### in the leftmost column) and assign an unused drive letter (like X:) for it. For example, if ESP is listed as Volume 2:



        sel vol 2
        assign letter=x:


        It should say DiskPart successfully assigned the drive letter or mount point. at this time.
        Then type exitto quit the DiskPart utility.



        Switch to the EFI directory on the ESP:



        cd /d x:EFI
        dir


        If you see the ubuntu directory, you're in the right place.



        Now create a directory or two for the Windows UEFI bootloader:



        mkdir Microsoft
        cd Microsoft
        mkdir Boot
        cd Boot


        Install the Windows UEFI bootloader to the ESP and re-create the Windows BCD registry:



        bcdboot c:Windows /l en-us /s x: /f UEFI /addlast


        If you want the Windows bootloader to use a language other than English, replace en-us in the command above with the appropriate Windows language code.



        Now type exit, remove the Windows installation media and reboot your system. It should come up in Ubuntu just as before. Run sudo update-grub to update the GRUB boot menu. If all goes well, it should now auto-detect the presence of UEFI Windows bootloader and add it to the GRUB boot menu.



        Also now in the BIOS boot order menu, there should be a item named "Windows Boot Manager". If you want to remove Ubuntu and go back to Windows-only system, just switch this one as the primary boot option, and the system should skip GRUB and boot into Windows by default. Then you can remove the Linux partitions using Windows Disk Management. Do not remove the EFI System partition, as now Windows also needs it for booting.



        (Work in progress - I'll add the MBR restoration option later)






        share|improve this answer













        Depending on exactly what the warnings said, and what exact choices you made when installing Ubuntu, the installation process may have done one of a few things:




        • It may have converted the partitioning from MBR to GPT style to install UEFI-style, keeping (or resizing) the existing partitions. This is the best option: you'll just need to install a UEFI-style bootloader and you can then get back to Windows. Once the Windows UEFI bootloader is on the disk, Ubuntu might even detect it automatically the next time you run sudo update-grub and add it to the GRUB boot menu for you.


        • It may have just set up a UEFI-style bootloader on a MBR-partitioned disk. This is a problem, since while Linux can do this, Microsoft says Windows won't support this combination. However, returning to legacy-style Windows-only boot should be fairly easily doable in this case.


        • It may have taken the entire disk for Ubuntu, so your Windows installation was overwritten and no longer exists. This is the worst-case scenario: if you want Windows back, you'll need to fully reinstall it and your existing Windows files will be gone.



        Identifying your situation



        In Linux, run sudo fdisk -l /dev/sda. If your system disk is something other than /dev/sda, replace that with the appropriate device name. For example, on a new system with a NVMe SSD, it might be /dev/nvme0n1 instead.



        The output should look similar to this:



        $ sudo fdisk -l /dev/sda
        Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
        Units: sectors of 1 * 512 = 512 bytes
        Sector size (logical/physical): 512 bytes / 512 bytes
        I/O size (minimum/optimal): 512 bytes / 512 bytes
        Disklabel type: gpt
        Disk identifier: 2B05CCE8-92BC-4308-B770-174CE63D044F

        Device Start End Sectors Size Type
        /dev/sda1 2048 1050623 1048576 512M EFI System
        /dev/sda2 1050624 1550335 499712 244M Linux filesystem
        <... other partitions listed here...>


        If your version of Linux fdisk isn't too old, the output should include a line that says either



        Disklabel type: gpt


        or



        Disklabel type: mbr


        This identifies the partitioning style that is currently in use on your system disk.



        GPT-partitioned system disk - installing a Windows UEFI bootloader



        Since the Linux installer has set up a UEFI bootloader for us, there should also be an EFI system partition (ESP for short) on the disk. In the fdisk -l output, it is the partition that has its Type listed as EFI System and its size would typically be something in between 100M and 512M. In Linux, it might be mounted at /boot/efi. You might want to run sudo ls -l /boot/efi or take a peek at it with some GUI file manager so that you'll recognize the contents of this partition - you'll be seeing it at Windows command prompt for a bit. Typically, if ESP is mounted at /boot/efi, there should be a sub-directory like /boot/efi/EFI/ubuntu that contains the actual UEFI bootloader of Ubuntu.



        Now, get yourself a Windows 10 installation media. You won't need the license code. Boot your computer from that installation media. Since your Ubuntu installed in UEFI mode, your computer will probably boot the Windows installer in UEFI mode automatically too, but in case you see two boot options for the installation media, only one of those options boots it in UEFI mode, and that's the one you should pick. (Hopefully the boot menu will say which is which - it depends on your system's UEFI firmware.)



        When the Windows installer displays the initial screen with an "Install now" button in the middle of the screen, select instead "Repair your computer" near the bottom.



        From the next menu, choose "Troubleshoot" and then "Command Prompt".



        Now, type in these commands:



        diskpart
        list vol


        This should display a list of partitions. Find the partition that has FAT32 in the "Fs" column - it should be your ESP you saw in Linux before. Note its volume number (Volume ### in the leftmost column) and assign an unused drive letter (like X:) for it. For example, if ESP is listed as Volume 2:



        sel vol 2
        assign letter=x:


        It should say DiskPart successfully assigned the drive letter or mount point. at this time.
        Then type exitto quit the DiskPart utility.



        Switch to the EFI directory on the ESP:



        cd /d x:EFI
        dir


        If you see the ubuntu directory, you're in the right place.



        Now create a directory or two for the Windows UEFI bootloader:



        mkdir Microsoft
        cd Microsoft
        mkdir Boot
        cd Boot


        Install the Windows UEFI bootloader to the ESP and re-create the Windows BCD registry:



        bcdboot c:Windows /l en-us /s x: /f UEFI /addlast


        If you want the Windows bootloader to use a language other than English, replace en-us in the command above with the appropriate Windows language code.



        Now type exit, remove the Windows installation media and reboot your system. It should come up in Ubuntu just as before. Run sudo update-grub to update the GRUB boot menu. If all goes well, it should now auto-detect the presence of UEFI Windows bootloader and add it to the GRUB boot menu.



        Also now in the BIOS boot order menu, there should be a item named "Windows Boot Manager". If you want to remove Ubuntu and go back to Windows-only system, just switch this one as the primary boot option, and the system should skip GRUB and boot into Windows by default. Then you can remove the Linux partitions using Windows Disk Management. Do not remove the EFI System partition, as now Windows also needs it for booting.



        (Work in progress - I'll add the MBR restoration option later)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 5 at 22:12









        telcoMtelcoM

        25.2k1 gold badge29 silver badges67 bronze badges




        25.2k1 gold badge29 silver badges67 bronze badges






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510013%2fcant-boot-to-windows-after-installing-ubuntu-in-uefi%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

            Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

            Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...