0

I recently installed Linux intending to be able to double boot, however, I had to install it in UEFI mode because of some weird BIOS settings, although Windows 7 is not installed in UEFI mode. After this I haven't been able to boot Windows at all. What I want to do is to make Windows 7 UEFI bootable so that I can add it to my UEFI GRUB. Unfortunately, I am unable to boot Windows, and I don't have access to an installation CD or anything like that for Windows. Are there any way to enable UEFI booting of Windows from Linux? A program or package or something like that?


Edit:

I read this guide on how to convert a Windows installation to UEFI mode, and from what I understand, the necessary steps is to convert the hard disk from MBR to GPT and then use a Windows system repair disc to create a partition with an UEFI boot loader.

So my question boils down to this: can I use gptgen on Linux to safely convert my hard disk to GPT and then use a system repair disc created with a different Windows computer?

8
  • What you need to boot Windows is simply change it back to Legacy/CSM mode. You won't be able to boot Ubuntu this way, obviously. Change it again to UEFI for UBuntu. When OSes are installed in different modes this is the only way.
    – user589808
    Jan 22, 2017 at 22:33
  • @CelticWarrior But when I installed Linux in Legacy/CSM mode I was unable to boot it. The computer said "No OS found" and I couldn't boot either windows or Linux. That's why I installed it in UEFI mode in the first place.
    – tjespe
    Jan 22, 2017 at 22:35
  • This has been discussed already. askubuntu.com/questions/874590/refind-cant-find-windows Again no other way, rEFInd was the last hope but no need to repeat myself askubuntu.com/questions/874590/… .
    – user589808
    Jan 22, 2017 at 22:36
  • Clearly your C is one of those that really benefit from and recommend UEFI mode. I would install Windows first in UEFI mode (USB required for Windows 7) then Ubuntu the same way.
    – user589808
    Jan 22, 2017 at 22:39
  • @CelticWarrior Ok, but as mentioned I don't have any installation disk, and windows was installed by my organization with certain settings and a user system which I would very much like to keep.
    – tjespe
    Jan 22, 2017 at 22:41

1 Answer 1

1

You have several options:

  • Re-install Ubuntu in BIOS/CSM/legacy mode -- This is almost certainly possible, but will require preparing your boot medium correctly and/or controlling your computer's CSM, which can be a confusing challenge. See this page of mine for more on the CSM.
  • Install a BIOS-mode boot loader for Linux -- You can install a BIOS-mode version of GRUB 2 (or some other BIOS-mode boot loader) from your current installation. This should get things working in BIOS mode. Installing the grub-pc package and then running sudo grub-install /dev/sda will probably do the trick; however, a lot depends on configuration details, such as how many disks you've got and how they're partitioned.
  • Convert Windows to boot in EFI mode -- This can be done, but is a bit of a pain. See this page for one procedure. I'm vaguely familiar with the gptgen utility to which you refer, but I'm much more familiar with GPT fdisk (gdisk), which can also do the job, since I wrote GPT fdisk. Note that converting from MBR to GPT is only part of the job; the more important task is installing an EFI-mode boot loader for Windows.
  • Use rEFInd -- rEFInd can switch from its native EFI-mode boot to a BIOS-mode boot on most (but not all) EFIs. This feature is disabled by default on UEFI-based PCs, though, because it's more likely to cause problems than solve them on most systems. In your case, though, it may be a desirable option. See this question and my answer to it for details on this approach.
  • Re-install Windows in EFI mode -- This option may be a reasonable one, particularly if you've accidentally wiped out your Windows installation when you installed Ubuntu.

It's hard for me to say which approach is best for you because I have inadequate information. Critically, I don't know how your disk is partitioned. Some people who find themselves in your situation discover, to their horror, that they've accidentally wiped out their Windows installations. If you're in this situation, re-installing Windows in EFI mode is likely the easiest solution -- but you may need to take extreme recovery steps if you had important personal data on the disk. If you've already done an MBR-to-GPT conversion but have left the Windows partitions otherwise intact, then converting Windows to boot in EFI mode is almost certainly the best approach. If you have two disks (a GPT disk for Ubuntu and an MBR disk for Windows), then using rEFInd to boot Windows in BIOS mode or installing a BIOS-mode boot loader for Linux are likely the best options. If you've got one MBR disk that's still in MBR mode, then installing a BIOS-mode boot loader for Linux is likely the best approach. (Note that re-installing Ubuntu in BIOS mode is simply an "overkill" way to install a BIOS-mode boot loader for Linux. Despite being overkill, it may be easier than doing a technically simpler installation of the BIOS-mode boot loader only, since the installer is designed for newbies to use whereas manual GRUB installation is not.)

4
  • I know for sure that my windows installation is not gone (the loader is on /dev/sda1 and the OS is on /dev/sda2), but it is possible that it has been broken in some way, since I am not able to boot it at all in any way, anyway, the files are there. I only have one hard disk and I think it is in MBR mode. I have previously read your answer and tried the steps, but rEFInd still can't detect windows. I don't want to reinstall windows since I don't want to loose my system administrator settings. Given this I think converting windows to EFI mode is the best alternative, what do you think?
    – tjespe
    Jan 23, 2017 at 20:12
  • Converting Windows to boot in EFI mode is reasonable, but it's a riskier approach than installing a BIOS-mode boot loader for Ubuntu and booting both in BIOS mode. (The extra risk comes in the form of the MBR-to-GPT conversion and in mucking with the Windows boot loader, which can be persnickety.) In the end, it's hard to make a solid recommendation, since each approach has its advantages. I recommend you back up as best you can, though. The ntfsclone tool can be helpful for this.
    – Rod Smith
    Jan 24, 2017 at 1:14
  • What's the worst thing that can happen? I am already unable to boot Windows (at least the ways I have tried) so I don't feel like I have much to loose. However, I don't know how I can create an EFI Windows loader. Is it possible to use a system repair disc created with an other Windows computer?
    – tjespe
    Jan 24, 2017 at 15:32
  • Please see the links in my answer to detailed instructions. The worst that can happen is that you'll lose all the data on your computer. (Just because you can't boot Windows doesn't mean that your personal data is gone; you can probably access it from Ubuntu or after you restore Windows to bootability in one way or another.)
    – Rod Smith
    Feb 1, 2017 at 0:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .