27

So, I've successfully dual-booted my Windows 8 machine with Ubuntu 12.04 . However, I still don't have a convenient method of choosing what OS to load at boot time.

After installing Ubuntu, my computer still loads Windows 8 directly. I then added grubx64.efi to the white list of my boot loader. But after that, my machine loads Ubuntu directly without even a shadow of GRUB showing up!

I used boot-repair and I got this paste.ubuntu URL: paste.ubuntu.com/1326074. After running boot-repair (and re-white listing the grubx64.efi file), GRUB now shows up but without any Windows 8 option!

Lastly, I ran sudo fdisk -l and it gave me this:

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x6396389f

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1465149167   732574583+  ee  GPT
Partition 1 does not start on physical sector boundary.

I'm guessing my problem has something to do with the warning from fdisk above but I don't know what to do with it. How do I proceed now?

Edit

My etc/default/grub is as follows:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

Also, just for the record, this is what I followed in installing my dual-boot. The tutorial (which uses, 11.10, I must note), doesn't mention anything about this problem. Is there anything there I shouldn't have done?

2

7 Answers 7

18

First, your fdisk -l output is not a problem; that simply identifies your disk as using the GUID Partition Table (GPT) partitioning system. To view your partitions, you must instead use a GPT-enabled tool, such as gdisk or parted, rather than fdisk, which doesn't understand GPT.

Second, you may be able to get GRUB to chainload Windows by adding a suitable entry to /etc/grub.d/40_custom and then doing a sudo update-grub. An entry might look something like this:

menuentry "Windows 8" {
    set root='(hd0,gpt1)'
    chainloader /EFI/microsoft/BOOT/bootmgfw.efi
}

The details might depend on your installation, though.

Third, if you consider rEFInd to be ugly, you can always try another rEFInd theme or create your own, as described in the rEFInd documentation. Alternatively, if you prefer a text-mode boot loader, you can set the textonly option in refind.conf. You can achieve a similar end by switching to gummiboot.

Fourth, if rEFInd is periodically reporting errors, please write those down or take a picture of the screen with a digital camera and report them to me. (I'm rEFInd's maintainer.) Bugs can't get fixed if nobody reports them; or if they aren't bugs in rEFInd, the messages may provide clues about how to resolve the problem.

Finally, it's possible to boot Linux via rEFInd (or gummiboot) without using GRUB; you just need a different EFI boot loader. My personal preference is the Linux kernel's EFI stub loader. This is available only in 3.3.0 and later kernels, though. Since Ubuntu 12.04 ships with a 3.2.0 kernel, you'll need to either find a pre-built 3.3.0 for Ubuntu 12.04 (I've heard of such things, but I don't have any links handy) or build your own from source code. (You could also install Ubuntu 12.10, which ships with a suitable kernel, but presumably you want an LTS release, so this may not be optimal.) See the rEFInd documentation's page on booting Linux for additional details on how to set this up. You could also use ELILO or GRUB Legacy. If you simply object to the delay, you could reduce the GRUB 2 timeout value and set it to not display the menu by default.

2
  • 1
    First, wow, I didn't realize that you are the maintainer of rEFInd. Next, regarding the GRUB menuentry...I've tried that but it doesn't work. Among other shots-in-the-dark I've tried setting my ESP partition but to no avail. Even tried using one of those graphical GRUB editors (forgot the name). Lastly, regarding rEFInd, the errors it is reporting isn't critical (will edit my post to note that)---at start-up it just tells me that it can't find certain .efi's. I've no idea where they came from.
    – skytreader
    Nov 3, 2012 at 2:29
  • Check for the presence of the specified file on the ESP. Also be sure that the case of the filename is correct. (It shouldn't matter, but I know of one buggy EFI where it does!) If that doesn't help, what error message (if any) does GRUB return when you try launching Windows via this entry?
    – Rod Smith
    Nov 3, 2012 at 3:14
8

Both answers with /EFI/Microsoft/Boot/bootmgfw.efi would do. However I hacked like hell to get the right settings for set root='(hd0,gpt1)'. If you know it's very simple

When GRUB starts: press c give the command ls on the prompt.
You get a list of partitions on harddisks like (hd0,gpt1) etc.
Type ls (hd0,gpt1) and try the others.
Look at the label and if it states EFI you know you've got a hit.

Warning: there could be more partitions labelled with EFI, depending how you installed Ubuntu. Try all of them.

0
8

Boot into Ubuntu using CD,
Choose "Try Ubuntu",
Connect to internet,
Open up a terminal window using Ctrl-Alt-t and then run: boot-repair

If boot-repair is not found, then install it :

sudo add-apt-repository ppa:yannubuntu/boot-repair &&
sudo apt-get update &&
sudo apt-get install -y boot-repair &&
boot-repair

Click Recommended Repair. Write on a paper the new URL that will appear. Reboot the pc, you should get a GRUB menu with access to both Ubuntu and Windows. If any problem, indicate the new URL.

6

Try running sudo update-grub. This should hopefully recognize Windows 8 automatically and add it to the GRUB and reconfigure the menu.

If that fails, please share your /etc/default/grub file here, we'll have a look.

1
  • 1
    Hi. sudo update-grub did not do the trick. I edited my question to include my /etc/default/grub. Meanwhile, I'm studying the answer NikTh linked.
    – skytreader
    Nov 2, 2012 at 13:53
4

Try making a file called /etc/grub.d/30_windows that contains this:

#! /bin/bash
cat << EOF
menuentry "Windows 8" {
    insmod part_gpt
    insmod chain
    set root='(hd0,gpt1)'
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
EOF
Then run sudo update-grub and reboot.

Full tutorial

0
1

My Ultimate Workaround

(*Because Tom's didn't work and NikTh's link is too complicated. But hey, thanks for bothering!)

Install rEFInd.


I'm accepting my own answer until someone points out a possible flaw and a fix to it or addresses my issues (which, unfortunately, just asks the question "How do I put Windows 8 in GRUB easily?").

(Edit 8/6/17: I ultimately used rEFInd to solve this problem (see accepted answer above).)

Far from a perfect solution, using rEFInd seems like a very hack job. For one, it looks ugly (sorry rEFInd) and tells me access was denied on certain .efi's ({ext2_x64, hfs_x64, iso9660_x64, reiserfs_x64}.efi) at start-up---nothing critical though, and goes away with a button press*. And, lastly, choosing the Ubuntu efi still loads GRUB which is an entirely unnecessary step, at least since I won't bother keeping multiple kernel versions around.

In summary...

Pros: my system now more-or-less works like my pre-UEFI dual-boots. Cons: it looks ugly plus a longer boot time.

*I must note that this rEFInd was installed via install.sh at my Ubuntu partition. Previous experiences with rEFInd (set-up through Windows) didn't have this problem.

6
  • If a previous rEFInd installation via Windows doesn't yield errors about files that couldn't be found but your current installation from Linux does, then my hunch is that one of two things is going on: 1) You've got a motherboard with a case-sensitivity bug, in which case mucking with the case of files or directories may improve matters; or 2) There's something odd about your ESP (FAT16 vs. FAT32 or some minor filesystem damage, for instance). Some EFIs seem to be very fussy about the filesystems on their ESPs. Exact filenames may be helpful in narrowing down the issue.
    – Rod Smith
    Nov 3, 2012 at 3:11
  • Ok. My bad. It wasn't saying it can't find certain efis, just that it's access was denied on certain efis (so I take it the said efis are there, just unaccessible?). I've noted these files now though I've still no idea where they came from.
    – skytreader
    Nov 3, 2012 at 14:20
  • "Access denied" is an unusual error on EFI, in my experience. AFAIK, EFI doesn't support ownership or permissions like Linux does, so it doesn't really make sense unless there were a disk read error. I have seen weird disk write errors under EFI that evaporated on the next reboot. If this problem persists, you might consider running a SMART test on your disk in case there's a hardware fault, and backup and re-write the ESP in case there's some weird filesystem damage that dosfsck can't fix. Other than that, reporting which files are giving problems might be useful.
    – Rod Smith
    Nov 3, 2012 at 18:40
  • 1
    The "access denied" message almost certainly relates to Secure Boot. Such a message occurs if rEFInd tries to load an unsigned EFI binary while in Secure Boot mode. What's puzzling about this is that you're able to launch rEFInd at all, since it's not signed itself. My hunch is you've got some sort of weird buggy half-activated Secure Boot setting in your firmware. The easiest solution at the moment is to completely disable Secure Boot, but there are others. See my Web page at rodsbooks.com/efi-bootloaders/secureboot.html for more information.
    – Rod Smith
    Nov 12, 2012 at 0:07
  • On my hp laptop I have to press f9 and then grub boots up, otherwise windows loads. Also there is an option to boot Windows from grub as well although I never use it. If I'm boring into Windows I just turn it on and wait for Windows. If I plan to boot ubuntu, I just press f9 as soon as I turn on.
    – geoffmcc
    Dec 31, 2014 at 5:54
0
  1. Please download super Grub and follow its directions. I never leave home without it. Very helpful when the grub menu does not show up.

  2. You'll have to load to a cd and boot it up. Just follow the instructions that come with it.

  3. It can also be used to fix windows as well. Since you can only boot into windows 8 you want to pick the linux fix.

Play around with this but do read over the instructions. You'll feel like an expert after a while. RS

You must log in to answer this question.

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