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 recently purchased a Dell Inspiron 3521 with Windows 8 pre-installed. I then installed Ubuntu 12.04.2 on it. Both OS's are running fine for now but the problem is that I have to manually go into BIOS on startup and switch between Legacy and UEFI mode to boot into Ubuntu and Windows respectively. Is there anyway that I can just get GRUB to ask me on startup which OS I want to boot?

In case it is important, here's what I did to install Ubuntu -

  • I shrank the Windows partition and then disabled SecureBoot and switched to Legacy mode.
  • While installing Ubuntu from the Live CD, it did not detect that my system already had Windows 8 installed.
  • I chose to manually allot partitions to /, /home, swap, /boot during installation.
  • It also told me that there needs to be a Reserved BIOS setup partition, so I let it create that.

Any help would be much appreciated.

share|improve this question

3 Answers 3

Try boot-repair to reinstall and configure grub.

Boot to live cd desktop and open terminal then type

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

Wait for it to finish then type

sudo apt-get install -y boot-repair && (boot-repair &)

Now you can launch from dash and follow the instructions.

Heres a link to detaild documentation https://help.ubuntu.com/community/Boot-Repair

share|improve this answer

If the installer asked for a bios_grub partition, you installed in BIOS/Legacy/cSM mode not UEFI. How you boot installer is how it installs. And only if you get grub menu on installer have you booted in UEFI mode.

Boot-Repair simplifies the BIOS repair. Without it you either have to reinstall or chroot into your install and uninstall grub-pc and install grub-efi and edit fstab. Boot-Repair does all that automatically.

Also Boot-Repair will add correct Windows chain load entries that grub2's os-prober does not create. os-prober creates the old BIOS entries that do not work with UEFI. Fix just released, but not in any live installers except maybe 13.10, but I have not checked that, yet.

Many UEFI have been modified to only boot Windows. This is where a hack or work around is required. Since grub2's shim has the Microsoft signing key, it can become the Windows boot file (that UEFI thinks is the real file) and you actully boot grub. Then from grub menu you chainload to boot the renamed actual Windows file. For some systems that is the only way to boot. But Boot-Repair automatically does that rename and it is not required for some systems.

share|improve this answer
    
This is the URL I got from Boot Repair - paste.ubuntu.com/5922166 Can anyone tell me from this what the issue is? And whether it is advisable to run the Recommended Repair? What are the risks I'm looking at? –  user178834 Jul 28 '13 at 16:07

As Mark Kirby says, Boot Repair may fix the problem; however, Boot Repair applies certain hackish "fixes" in all cases, and this can sometimes cause subsequent problems. Furthermore, what Boot Repair does sometimes doesn't work at all, which leads to further complications. Personally, I prefer doing this repair using finer-grained tools. One method is:

  1. In Windows, download and install my rEFInd boot manager. The Web page includes Windows installation instructions.
  2. Install the EFI driver (in the rEFInd package) for whatever filesystem you're using on your Ubuntu /boot partition.
  3. Reboot into Ubuntu using your legacy boot method.
  4. In Ubuntu, run the mkrlconf.sh script that comes with rEFInd. (Change to the directory that holds the script and then type sudo bash mkrlconf.sh.)

When you reboot in EFI mode, rEFInd should appear, and it should enable you to run either Linux or Windows. If rEFInd does not appear when you reboot, then chances are you've got a buggy firmware, and it may be that the type of hackish fixes applied by Boot Repair are necessary. You can either run Boot Repair to make GRUB the default or reboot into Linux (in legacy mode) and use the mvrefind.sh script that comes with rEFInd to make rEFInd the default:

sudo mkdir -p /boot/efi
sudo mount /dev/sda1 /boot/efi
sudo bash /path/to/mvrefind.sh /boot/efi/EFI/refind /boot/efi/EFI/Microsoft/Boot

Change /dev/sda in the second command to your EFI System Partition (ESP). This partition shows up in parted's output as having its "boot flag" set. Also change /path/to to the path to where mvrefind.sh resides.

share|improve this answer
    
This is intresting I had no idea boot-repair used a hack to repair grub –  mark kirby Jul 27 '13 at 14:14
    
Boot-Repair does several fixes and some "hacks" or work arounds. –  oldfred Jul 27 '13 at 19:03
    
One thing that Boot Repair does is to rename the Microsoft boot loader from EFI/Microsoft/Boot/bootmgfw.efi to EFI/Microsoft/Boot/bkpbootmgfw.efi and install a copy of GRUB in place of the original file. It does something similar with the EFI/BOOT/bootx64.efi file. This can be effective if your firmware stubbornly refuses to boot anything but the Microsoft boot loader, but only a minority of EFIs are broken in this way. On the majority of EFIs, this renaming creates the potential for future problems -- say, if Windows restores its original file (as it has a perfect right to do). –  Rod Smith Jul 27 '13 at 19:44
    
Rod, if Windows restores its original file then it makes no difference if the file had been renamed or not. Furthermore, as kindly requested various times before, please create a bug report if you really think there is a problem in B-R. –  LovinBuntu Jul 28 '13 at 17:05
    
Renaming and replacing boot files makes it unclear what any given file is. Suppose another tool (say, gummiboot, rEFIt, rEFInd, or even a GRUB that's not configured to detect Boot Repair's changes) is fed the changed setup. That tool will label bootmgfw.efi as "Windows," even though it will be Ubuntu's GRUB. If Windows restores its original file and the computer had been booting via that file, then it will boot straight to Windows rather than to GRUB. These aren't bugs per se, but they are design flaws. The repair is hackish, and I stand by that statement. –  Rod Smith Jul 28 '13 at 23:15

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.