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.

I'm trying to do a dual boot of Windows 8 and Ubuntu 12.10 on my Surface Pro and would like to use rEFInd for my boot manager.

I do not want to ever install GRUB, including during installation of Ubuntu, since my past experience with attempting to do that on this device has led to corruption of the windows boot loader, which can effectively brick the device since it seems to need these to boot from USB. I'm aware of the success of Dual boot Surface Pro with Ubuntu?, but want to stay away from GRUB completely.

So far I have tried the following:

  1. Install and test that rEFInd is working for just Windows 8 with no issues
  2. Install Ubuntu 12.10 from "ubiquity -b" to prevent GRUB from being installed
  3. Verify I can still properly boot into Windows 8

Unfortunately this doesn't seem to generate any .efi stubs for Ubuntu, so I'm not sure what to do at this point. What can I do to generate these without installing GRUB or any other boot loader? Keep in mind that at this stage I can't actually boot directly into Ubuntu, only a live installation, unless there is something else I should be doing during the actual installation.

To reiterate, what I want to do is: Install Ubuntu without GRUB, generate efi stubs for Ubuntu, never touch the efi firmware or the Windows boot directory, and then rely on rEFInd to find these stubs during bootup.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

First, I assume that by ".efi stubs" you mean files with .efi extensions on the EFI System Partition (ESP). Those are EFI program files -- most commonly boot loaders, but also sometimes programs and utilities.

If you want to boot Windows and Ubuntu via rEFInd without using GRUB, then the only EFI programs you need to have on the ESP are the Windows boot loader (installed by Windows), rEFInd (refind_x64.efi), and an EFI filesystem driver for whatever filesystem you used with Ubuntu (probably ext4_x64.efi, in the drivers or drivers_x64 subdirectory of the directory that holds refind_x64.efi). The ext4fs driver will enable the EFI, and therefore rEFInd, to read the Linux kernel on the main Linux partition. Linux kernels since version 3.3.0 have included an EFI stub loader, which is a way to turn the Linux kernel into its own boot loader. Thus, with rEFInd and an ext4fs driver on the ESP, rEFInd can launch the Linux kernel directly from a Linux partition. There is one other thing you'll need, though: a /boot/refind_linux.conf file to hold options for Linux. A minimal example looks like this:

"Boot with normal options"   "ro root=/dev/sda8"
"Boot into single-user mode" "ro root=/dev/sda8 single"

This example boots the installation on /dev/sda8. You can add more options to have it present a graphical startup display or for other reasons, but the above (with a modified root= value, in all probability) will work with most systems.

A variant on this approach is to copy your kernel(s) to the ESP (probably in the ESP's EFI/ubuntu directory) and not install a Linux filesystem driver. This has some advantages on some systems, but it requires copying the kernel every time the packaging system updates it. If you do it this way, you'd put refind_linux.conf in the directory on the ESP where you store your kernels.

share|improve this answer
    
Indeed I did mean efi program files! I had been missing the refind_linx.conf on my earlier attempts - working great now, thanks! –  Azoth Mar 28 '13 at 6:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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