This post is about dual-booting Windows and Linux with newer firmware enabled with UEFI/EFI.

Normal Process for enabling Dual Boot (Windows and Linux) on a desktop/laptop

  • Install Windows (or pre-installed)
  • Install Linux distro
  • Reboot, grub gives you a menu to choose Windows or Linux, whichever you want to boot to

That is what I have done on many desktops and laptops in past. Linux distributions have matured over time, so installing them parallel to Windows has been a very simple task for many years.
But probably not with newer laptops. I recently encountered a Sony Vaio S Series Laptop SVS13112EN (Insyde H2O BIOS) with Windows pre-installed. The solution discussed here should be generic for other laptops with similar problem.
The laptop has UEFI/EFI enabled BIOS with Windows installed in UEFI mode, which means that older legacy mode (the MBR thing) did not recognise Windows.

UEFI/EFI is an effort towards secure booting, which in future might mean that if you buy a laptop with Windows pre-installed, you might not have an option to make it dual boot to Windows and Linux. UEFI/EFI tends to solve many problems too like booting for very large hard disks, driver independence.
More on UEFI/EFI can be read at:-

http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface

Following methods DID NOT WORK:-

  • Boot from CD did not work in UEFI mode, so I changed to Legacy mode. Boot from Linux CD and installed it. Linux installed and worked, but Windows was nowhere
  • I tried WUBI installer (to install Linux within Windows partition). Installation was successful, but the expected GRUB menu never appeared.

After bit of searching on Google and experimenting, following steps WORKED for few days

1. Download iso image for Linux distro
2. Download a utility to create a bootable image from usb
UNetBootin is one utility that can be used
http://unetbootin.sourceforge.net/
3. Format your USB drive to FAT32
4. Create the image on USB drive using the utility
5. Go to BIOS Boot Menu, and make the priority of external device or USB higher than Hard Drive
6. Boot with USB plugged in, Linux live-session should show up with an option to install
7. Choose proper partitions for swap area and root(/) and install
8. Change the standard boot file to one got from Linux installation
Reboot with USB plugged-in (live-session)
Use following commands to mount and change boot configuration
sudo mount /dev/sda3 /mnt/sda3
cd /dev/sda3
mv EFI/Boot/bootx64.efi to bootx64.efi.old
cp EFI/ubuntu/grubx64.efi to EFI/Boot/bootx64.efi
(In last step it can be linuxMint instead of ubuntu depending on your flavour)
9. Reboot, you should see grub menu (but without Windows option)
10. If when you reboot you still get Windows, rename EFI/Microsoft/Boot/bootmgfw.efi to EFI/Microsoft/bootmgfw.efi
11. Now, try and reboot, you should get a GRUB menu for booting into Linux but without Windows option. Add an entry into grub
Add the following lines in /etc/grub.d/40_custom
menuentry “Windows” {
set root=’(hd0,gpt3)’
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
Then update
sudo update-grub
Do not worry if “Windows” does not show up in the output of this command.
Reboot, you should be able to boot into both Windows and Linux now, from proper GRUB menu

The above method seemed to work a few times. After that, from GRUB menu, whenever I selected Windows, the partition was not recognized properly. I finally resolved the problem using rEFInd utility. Thanks to Rod Smith for sharing his immense knowledge and this utility. The utility is fairly easy to install and use.

  • I downloaded rEFInd package
  • Ran ./install.sh
  • It generated refind (with a version name) folder.
  • Moved /boot/efi/EFI/Boot to /boot/efi/EFI/Boot.old
  • Moved refind(followed with version number) to /boot/efi/EFI/Boot
  • Renamed  refined_x64.efi to bootx64.efi
  • Changes can be made to the config file for any customization
Tagged with →  
Share →

4 Responses to Linux and Windows dual boot : BIOS UEFI/EFI

  1. These are impressive articles. Keep up the sunny handiwork.
    http://www.CoolMobilePhone.net

  2. I get pleasure from, result in I found exactly what I used to be looking for. You have ended my 4 day lengthy hunt! God Bless you man. Have a nice day. Bye

  3. You don’t necessarily need to dual boot Windows and Linux on UEFI. Follow the guide http://www.youtube.com/watch?v=PEou2dIcMSE to convert your UEFI to MBR-BIOS without loss of data. Or read about it here: http://commandlinewani.blogspot.com/2012/09/how-to-install-ubuntu-1204-in-sony-vaio.html

  4. […] to Ashish Grover for pointing me in the right direction here. There is a problem when you reboot and try to select […]

Leave a Reply

Your email address will not be published. Required fields are marked *