I'm using a HP Z620 workstation.

My main hard drive is Ubuntu, and it was working fine. I physically removed the hard disk with Ubuntu on and put in a brand new hard disk, and tried to install another OS (not Windows) and that failed. So I took the new hard disk out and put my Ubuntu hard disk back in and expected it to work as before. Instead, I get a Windows blue EFI error screen saying I need to repair my computer?

Now, when I want to boot into my old Ubuntu disk, I have to put in a rEFIt USB boot loader to manually select the hard drive otherwise it won't boot. I'm sure I can fix it somehow, I'm just wondering what exactly happened here?

Thank you!

  • Why? At one point you had Windows installed which installed the EFI drivers it needed. It sounds like however it was working before was barely working. – Ramhound May 1 '15 at 14:50
  • 1
    There is a bootable program that you can download from the Ubuntu website, called boot-repair. Keep the Ubuntu drive in the computer while this runs. – TheWanderer May 1 '15 at 15:28
  • @Ramhound: The question I have is where are these Windows files actually located if the hard drives were removed? Does Windows install files directly to the motherboard's EFI? I would be surprised if that were the case. – Matthew May 1 '15 at 17:25
  • @Zacharee1 thanks, I might try this. Booting isn't an issue though. I'm more confused how a Windows error message can appear without any hard drives actually connected to the system. Does HP hard-code a Windows EFI or something? – Matthew May 1 '15 at 17:27
  • @Matthew - No; EFI drivers are located on the HDD. The EFI certificates are located on the motherboard. Windows isn't going to touch those. – Ramhound May 1 '15 at 18:40

I have two hypotheses. The first is that the error message you report isn't actually a Windows message, but just something that's formatted in a style similar to what Microsoft uses. You haven't quoted it exactly or presented a screen shot, so it's impossible for us to judge precisely what it is.

My second hypothesis is that when you installed Ubuntu on the first disk, you did not completely wipe the Windows files from the EFI System Partition (ESP), which is where boot loaders reside on an EFI-based computer. This caused no immediate problems because your Ubuntu installation set EFI variables in NVRAM to point to the Ubuntu boot loader (GRUB) as the default, so the Windows boot loader was not activated. When you swapped your disks, though, your EFI noticed that the Ubuntu boot loader was not available and so deleted its entry from the NVRAM. When you swapped the disks back, the firmware relied on hard-coding of the Windows boot loader's location as a fallback, since it had no entries in NVRAM that worked, and the Windows boot loader sprang back to life.

The second hypothesis seems more likely to me. If it's correct, the solution is to re-create your Ubuntu/GRUB boot loader entry. This can be done in any number of ways. The simplest from a computer perspective is to boot an emergency system and use a tool like bcfg (in an EFI shell) or efibootmgr (in Linux) to re-create that missing entry. This requires a moderate amount of expertise, though; see this page for a summary. A simpler solution from a human perspective is to use Ubuntu's Boot Repair tool, which will re-install GRUB and set the new GRUB as the default. Another option is to install another EFI boot loader; several are available, and if you have problems with GRUB, getting another one to work may be easier than fixing GRUB, which is quite arcane and complex to set up manually.

| improve this answer | |
  • Thank you, that's very useful. I didn't realise the boot process depended on the NVRAM too. I'll try and post a screenshot if it comes up again, I'm 95% sure it's a genuine Microsoft message though. I think there was a Windows installation previously on the Ubuntu disk, so that would make sense. – Matthew May 1 '15 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.