0

I have a Surface Pro. I have moved my recovery partition off of the Surface Pro onto a USB flash drive. I have also installed GRUB2 on the flash drive with Ubuntu Live/Persistent (I backed up the Surface Pro recovery stuff first!!). I am trying to get a GRUB2 config that will let me boot from the harddrive, boot into the Windows 8 Recovery for the Surface Pro, and all the Ubuntu stuff.

I have the all the Linux grub stuff working, I am just having trouble getting the Windows 8 grub stuff working. I have tried using chainloader, but I am not exactly sure how. It seems EFI changed everything I thought I knew about Grub. Also, I do not know how to get proper names of the USB and Surface SSD for grub.

Here is a screencap of the file structure on the USB

Here is a screencap of the output of 'ls' in the grub commandline (sorry, taken with my phone).

Here is my GRUB2 config so far:

if loadfont /boot/grub/font.pf2 ; then
    set gfxmode=auto
    insmod efi_gop
    insmod efi_uga
insmod gfxterm
    terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

menuentry "Boot from Harddrive" { // this one does not work
  set root=(hd0,1)
  chainloader (hd0,1)
}
menuentry "Ubuntu 13.04 Persistent" {
  set gfxpayload=keep
  linux /casper/vmlinuz.efi  persistent file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
  initrd    /casper/initrd.lz
}
menuentry "Ubuntu 13.04 Live" {
  set gfxpayload=keep
  linux /casper/vmlinuz.efi  file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
  initrd    /casper/initrd.lz
}
menuentry "Install Ubuntu 13.04" {
  set gfxpayload=keep
  linux /casper/vmlinuz.efi  file=/cdrom/preseed/ubuntu.seed boot=casper only-ubiquity quiet splash --
  initrd    /casper/initrd.lz
}
menuentry "File Integrity Check" {
  set gfxpayload=keep
  linux /casper/vmlinuz.efi  boot=casper integrity-check quiet splash --
  initrd    /casper/initrd.lz
}
menuentry "Memory Test" {
  set gfxpayload=keep
  linux /casper/mt86plus
}

Now if you ask why the hell am I doing this, mostly it is for trying to learn more about GRUB and understanding it, but also, if I get it working, I will have a USB that i can use for Ubuntu whenever I want and it still doubles as my recovery for my Surface. If all goes well, I am thinking about even installing Ubuntu on my Surface for a dual boot.

1
  • Here is a screencap of my storage config of my Surface. Commented Sep 18, 2013 at 16:35

1 Answer 1

1

The Boot Repair tool may be able to fix the problem. If you want to do it manually, you'll need to create an entry in /etc/grub.d/40_custom to boot Windows. Something like the following often works, but you'll need to tweak details like the partition number:

menuentry "Windows" {
    insmod part_gpt
    insmod chain
    set root='(hd0,gpt1)'
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Also, be aware that GRUB is very finicky to configure; what works fine on one computer often fails miserably on another. Thus, I can't promise that the above entry will work for you.

Another option is to switch from GRUB to another EFI boot manager. For dual-booting with Linux and Windows, rEFInd and gummiboot are the easiest to configure. Note that if you're booting with Secure Boot enabled, gummiboot can't work with shim, and the version of shim that Ubuntu uses won't work with either of those boot managers, so you'll need to either upgrade to shim 0.2 or later or replace shim with PreLoader.

You must log in to answer this question.

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