Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question is an exact duplicate of:

I had Win 8 and Ubuntu 12.04 peacefully coexisting on a Toshiba Portege Z935. EFI mode, Grub2, secure boot off, had to use "recommended repair" on Boot-Repair tool to get the boot working after original Ubuntu install. All happy for about 10 months until....

I foolishly accepted MS's suggestion to update Windows to 8.1. After the upgrade, each boot brought me to a "grub rescue>" prompt. Was able to do a lengthy workaround to get back to grub menu on each boot, but wanted it fixed.

So, I started messing around with Boot-Repair, repeatedly, until the box wouldn't boot at all (just get blacks screen with "Insert disk with command files" or some such).

Tried reinstalling Win 8, upgrade to 8.1, then reinstalling Ubuntu. Same result - wouldn't boot at all. Tried reinstalling 8 without upgrade to 8.1, same result. Tried installing JUST Ubuntu. Same result.

Finally, set box from UEFI to CSM, installed Ubuntu again. Now it boots! So, I'm guessing the UEFI is somehow hosed in the "firmware" by one or more of the actions above.

How to fix? I'm out of ideas, and I want EFI back. THANKS!!!

share|improve this question

marked as duplicate by bain, Eric Carvalho, Warren Hill, nux, LnxSlck Jul 8 at 16:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
You should try to boot from the live media with uefi enabled (what you already did when reinstalling Ubuntu). Paste the output of efibootmgr and also the boot-repair log. –  LiveWireBT Dec 1 '13 at 20:51
    
May try a clean install of Windows patch it with the upgrade and install ubuntu. I have never been able to install ubuntu on a Windows formatted drive, but I have done it on a jump drive as well, you could add a harddrive to your machine and install Ubuntu there. Your machine would recognize the second drive and this would not entail using grub nor the windows boot mgr. –  Diogenes Lantern Jan 4 at 1:41

3 Answers 3

Update: I've updated the script now

I've created a script to help users boot Windows 8.1 and Linux. I'm afraid it's not a Linux script, but I'm sure you could do a similar thing in linux...

This script will alter some things in your S:\ partition. You need to run it as administrator.

Note in this example, I'm using SuSE 12.1 and I'm using two separate HDD with Windows 8.1 on the "Primary" HDD. This is also designed for HP machines, however the HP directory isn't that important, so you can just change 'HP' to whatever other directory you have in your S:\ partition. All I currently have in mine is

S:\EFI S:\Boot.old

You will need to download and extract REFind and make sure you've set REFINDSOURCEPATH with where it's located.

Please do not do this unless you know what you're doing!

::Setup Refind script version 04/01
echo off
CHOICE /C YN /M "Have you already attempted copy of files since last losing the boot manager? Y/N"
IF %ERRORLEVEL% EQU 1 SET _FIRSTRUN=Yes
IF %ERRORLEVEL% EQU 2 SET _FIRSTRUN=No
echo on
::Mount partition
mountvol S: /S
::Set paths
::You might want to modify these for your system?
set REFINDSOURCEPATH=C:\refind-bin-0.7.4\refind
set REFINDSPATH=S:\EFI\refind
set SBOOTPATH=S:\EFI\Boot
set REFINDCONFIG=C:\refind.conf
::Rename refind directory if it's already present
rename %REFINDSPATH% refind.old
::Copy to S:\ assuming refind is located at %REFINDSOURCEPATH%
IF "%_FIRSTRUN%" == "Yes" (
echo a | xcopy /E %REFINDSOURCEPATH% %REFINDSPATH%
)
IF "%_FIRSTRUN%" == "No" (
echo d | xcopy /E %REFINDSOURCEPATH% %REFINDSPATH%
)
::Rename old boot HP files - we don't need the HP directory!
rename S:\EFI\HP HP.old
::Rename boot directory - we will recreate this ourselves below
rename  %SBOOTPATH% Boot.old
::Stop this file from being detected/set as default boot - this can still be detected by Windows otherwise.
rename S:\EFI\Boot.old\bootx64.efi bootx64.efi.old

::Recreate the boot directory
mkdir %SBOOTPATH%
::Put refind into the boot directory
IF "%_FIRSTRUN%" == "Yes" (
echo a | xcopy /E %REFINDSOURCEPATH%  %SBOOTPATH%
)
IF "%_FIRSTRUN%" == "No" (
echo d | xcopy /E %REFINDSOURCEPATH%  %SBOOTPATH%
)

::Rename/overwrite the file so it will always boot refind
rename %SBOOTPATH%\refind_x64.efi bootx64.efi
::This is a dirty hack to stop Microsoft finding their EFI file and setting as default boot
IF "%_FIRSTRUN%" == "Yes" (
copy S:\EFI\Microsoft\boot\bootmgfw.efi S:\EFI\Microsoft\boot\bootmgfw.efiold
rename S:\EFI\Microsoft\boot\bootmgfw.efi bootmgfw_.efi
)
::This is a dirty hack to stop Microsoft finding their EFI file and setting as default boot
IF "%_FIRSTRUN%" == "No" (
::I'm assuming we don't have to do anything different at this point. Error may be thrown but should not cause issues.
copy S:\EFI\Microsoft\boot\bootmgfw.efi S:\EFI\Microsoft\boot\bootmgfw.efiold
rename S:\EFI\Microsoft\boot\bootmgfw.efi bootmgfw_.efi
)

::Copy the config file.
copy /Y %REFINDCONFIG%  %REFINDSPATH%\refind.conf
::Set the boot manager (doesn't always work)

bcdedit /set {bootmgr} path \EFI\refind\refind_x64.efi
echo off
pause

CHOICE /C YN /M "Press Y to destroy the S:\EFI\Boot.old directory"
IF %ERRORLEVEL% EQU 1 SET _BOOT=Yes
CHOICE /C YN /M "Press Y to destroy the S:\EFI\refind.old directory"
IF %ERRORLEVEL% EQU 1 SET SET _REFIND=Yes
CHOICE /C YN /M "Press Y to destroy the S:\EFI\HP.old directory"
IF %ERRORLEVEL% EQU 1  SET _HP=Yes

IF "%_BOOT%" == "Yes" (
::Remove the path below
rmdir /s S:\EFI\Boot.old
echo "Removing path"
)

IF "%_REFIND%" == "Yes" (
::Remove the path below
rmdir /s S:\EFI\refind.old
echo "Removing path"
)

IF "%_HP%" == "Yes" (
::Remove the path below
rmdir /s S:\EFI\HP.old
echo "Removing path"
)

pause
echo "Pressing a key will restart immediately"
pause

::Restart
shutdown /r /t 0

I get an warning message when EFI is enabled so all you need to do is remove the word "hdbios" out of the configuration file if you have EFI enabled.

The other part which is important is your config file. As you can see mine is located at C:\refind.conf - that's probably not the most sensible place to put it, but at least you know it won't get erased if you trash anything else by mistake.

Mine is as follows, but I would suggest that you follow the documentation above to configure yours properly. You can see I use the renamed EFI/Microsoft/boot/bootmgfw_.efi in the configuration file.

timeout 20
hideui singleuser
#hideui all
#icons_dir myicons
use_graphics_for windows
showtools reboot, exit
scanfor internal,external,optical,hdbios,manual
dont_scan_volumes ROOT BOOT
dont_scan_dirs EFI/Boot, Boot
#scan_all_linux_kernels
#also_scan_dirs EFI/Microsoft/boot, Microsoft/boot

menuentry Windows8 {

    loader EFI/Microsoft/boot/bootmgfw_.efi
    icon EFI/refind/icons/os_win.icns

}


menuentry SuSE {
    icon EFI/refind/icons/os_linux.icns
    volume BOOT
    loader \vmlinuz
    initrd \initrd
    options "video=1600x900 splash=silent quiet showopts vga=0x37f root=UUID=201bb438-10b4-49aa-ac1c-4c7d52ad66a0
    splash=silent quiet showopts"
}

menuentry SuSERoot {
    icon EFI/refind/icons/os_linux.icns
    volume ROOT
    loader /boot/vmlinuz-3.4.11-2.16-desktop
    initrd /boot/initrd-3.4.11-2.16-desktop 
    options "video=1600x900 splash=silent quiet showopts vga=0x37f root=UUID=201bb438-10b4-49aa-ac1c-4c7d52ad66a0
    splash=silent quiet showopts"
    disabled
}
share|improve this answer

Try this:

  1. Download the USB flash drive or CD-R version of rEFInd.
  2. Prepare a USB flash drive or CD-R with rEFInd.
  3. Boot from the rEFInd disk. (You may need to disable CSM support to do this.)
  4. If rEFInd comes up, test its ability to boot both Windows and Linux.
  5. If you can boot both Windows and Linux, check to be sure that your EFI System Partition (ESP) is mounted at /boot/efi and install the Debian-package version of rEFInd.

In theory, at this point your computer should boot to rEFInd, which should enable you to boot either Windows or Linux. If this does not work, then post the URL that Boot Repair provides; it will give us critical system-specific information.

In the future, be aware that OS upgrades often change the default EFI boot loader. You can change this in each OS using an OS-specific tool, such as bcdedit in Windows or efibootmgr in Linux; but you must know how to use these tools. The rEFInd installation documentation describes how to use these tools to register rEFInd. The procedure is similar for other boot loaders.

share|improve this answer

TRY THIS FIRST

In Win 8.1 hold down SHIFT while you click on Restart. It will bring up Advanced Startup Options. You should be able to select your Ubuntu startup partition from there and then boot into it.

Saves the trouble of re-installing, but you have to ask Windows to load Ubuntu...

share|improve this answer

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