Ubuntu – Need Help Fixing Grub after Installing Ubuntu 13.04 x64 Alongside Windows 8 on a Lenovo IdeaPad Y400 with UEFI

13.04dual-bootgrub2uefiwindows 8

I have a Lenovo IdeaPad Y400 that came pre-installed with Windows 8. I would like to run Ubuntu alongside it in a dual-boot configuration. I've spent the past week fiddling around, re-installing both Windows and Linux in various configurations, and I've come awfully close to success, but seem to have hit a snag with Grub.

For my most recent attempt, I took the following steps:

  • Disabled Secure Boot
  • Re-imaged Windows 8 from a hidden recovery partition, effectively restoring the machine to factory state
  • Activated an option called Legacy Support in the BIOS (or is it UEFI
    now?)
  • Booted Ubuntu 13.04 x64 from a USB stick, chose "install alongside Windows" and accepted all default options
  • After a restart, found that I could boot Ubuntu, but could not boot Windows
  • Once into Ubuntu, I ran Boot Repair with recommended settings and accepted all defaults.
  • When Boot Repair finished, I was presented with the following message:

The boot files of [The OS now in use – Ubuntu 13.04] are far from the
start of the disk. Your BIOS may not detect them. You may want to
retry after creating a /boot partition (EXT4, >200MB, start of the
disk). This can be performed via tools such as gParted. Then select
this partition via the [Separate /boot partition:] option of [Boot
Repair]. (https://help.ubuntu.com/community/BootPartition)

  • I followed the instructions at the url in the message, creating a 1GB EXT 4 partition near the start of the drive
  • when I tried to run Boot Repair again, the "Separate /boot partition" option on the "Grub Location" tab was disabled.
  • The new partition is /dev/sda11 and has the label GRUB.
  • On restart, I get the following error message:

error: file '/boot/grub/i386-pc/normal.mod' not found.
grub rescue>

  • However, if I manually choose the boot partition by hitting F12, I can boot into Windows no problems. Selecting Ubuntu from the boot device menu gives me a Grub menu with the following options:

Ubuntu

Advanced options for Ubuntu

Windows UEFI recovery bootmgfw.efi

Windows Boot UEFI recovery

Windows UEFI recovery LrsBootmgr.efi

Windows Boot UEFI recovery bkpbootx64.efi

Windows Recovery Environment (loader) (on /dev/sda3)

Windows 8 (loader) (on /dev/sda5) System setup

  • Selecting Ubuntu from this menu allows me to get to my Ubuntu desktop. I haven't tried the other options yet for fear of losing the progress that I've made.

So it looks like I have successfully dual-booted the machine, but that Grub is broken for some reason or another.

My current partition scheme can be seen at:
http://paste.ubuntu.com/5948753/

Thanks in advance – Jonathan

Best Answer

First, activating "legacy support" was the wrong thing to do. On a computer with Windows 8 pre-installed, activating legacy support in the firmware makes it possible to go down paths that will create new problems, and in fact that's precisely what you've done. (That said, sometimes it really is necessary to activate this support, but it's more likely to cause problems than to solve them.)

Second, the "boot files... are far from the start of the disk" message is almost certainly a red herring. This can be a factor with certain disk sizes and certain BIOSes, but you've got an EFI implementation, not a BIOS. An EFI should be able to boot from kernels located anywhere on any disk currently available. Certainly your 1TB disk should pose no problems. Thus, everything you did from that point on was unnecessary at best and problem-producing at worst.

Despite your activation of legacy support in the firmware, it's conceivable that your system would have booted Windows after you ran Boot Repair. You don't say whether you tried to do so at that point, though, so it's unclear if it would have worked or if you just tried to fix the "far from the start of the disk" non-problem without testing it.

Somewhere along the line you seem to have installed the BIOS (legacy) version of GRUB, which may be what you're booting by default (to get the grub rescue> prompt). It's conceivable that disabling legacy support in your firmware will cause the system to boot straight to Windows or straight to GRUB's EFI-mode installation. If it boots to Windows, you should still be able to get to GRUB by hitting F12. If it boots to GRUB, then you should be able to boot Linux, and possibly Windows. (I recommend trying the first two Windows options. The final three Windows options are unlikely to do anything useful.)

If you try this and get GRUB working as the default, you can try using GRUB Customizer to clean up the GRUB menu a bit. I'm not very familiar with this software, though, so I can't be more specific about how to use it.

Another thing you could try is to install my rEFInd boot manager. If you install the Debian package and if everything works perfectly, this will give you a menu with options for Windows, for Ubuntu via GRUB, and for Ubuntu directly. You can then remove extra boot entries by deleting unnecessary .efi files in the /boot/efi/EFI directory tree or by editing /boot/efi/EFI/refind/refind.conf and uncommenting and adjusting the dont_scan_files or dont_scan_dirs options.

You may also want to review your partitions. Your Boot Repair output indicates that you've got four NTFS partitions, and I suspect at least one of those is unwanted/unnecessary, but I can't really be sure of that. You also shouldn't need /dev/sda6 or /dev/sda11 once you've fixed everything.