I want to install Ubuntu beside Windows 8 following this post on Ask Ubuntu guide, but I don't know if my Windows installation is booting in UEFI mode or in legacy mode (and it's said to be important in the post under the "DUAL BOOT ISSUES" paragraph). How do I get to know it?
Ubuntu – Is the Windows installation booting in UEFI mode or legacy mode
bootgrub-legacyuefiwindows 8
Related Solutions
Yes, it is possible to boot Windows 8 in UEFI mode, even if you installed it on a legacy partitioned disk (MS-DOS/MBR). Of course you would need a UEFI compatible GRUB installation on another GPT partitioned disk.
In Windows, install a new boot configuration to volume C: by running the following command:
bcdboot C:\Windows /s C: /f uefi
When booted in UEFI mode this will not only create a new boot configuration in
C:\EFI\
but also register a new UEFI bootloader in NVRAM. You can remove the entry later withefibootmgr
in Ubuntu (for instructions see: How do I remove "Ubuntu" in the bios boot menu? (UEFI)).Of course you can also choose another location, but this method should be the easiest. For more details on
bcdboot
see the corresponding Microsoft Technet article.In Ubuntu, add a custom GRUB menu entry by adding the following lines to
/etc/grub.d/40_custom
:menuentry "Windows 8 (BCD-UEFI configuration on system drive /dev/sda2)" --class windows --class os { insmod part_msdos insmod ntfs insmod search_fs_uuid insmod chain set root='hd0,msdos2' if [ x$feature_platform_search_hint = xy ]; then search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos2 --hint-efi=hd0,msdos2 --hint-baremetal=ahci0,msdos2 2ACC7043CC700B79 else search --no-floppy --fs-uuid --set=root 2ACC7043CC700B79 fi chainloader /EFI/Microsoft/Boot/bootmgfw.efi }
Note that you will need to edit the following parameters if your configuration differs:
- This entry is configured to boot from the 2nd partition (
msdos2
) of the 1st hard drive (hd0
orahci0
). - You also need to replace the filesystem UUID (
2ACC7043CC700B79
) with yours. In this example you could runsudo blkid /dev/sda2
to get the UUID or start GParted. - Reminder: This example deals with a drive that has a legacy partition table. If yours is GPT, then replace
msdos
withgpt
.
- This entry is configured to boot from the 2nd partition (
Finally run
sudo update-grub
to generate the new configuration.
Answer moved from https://askubuntu.com/q/377807/40581 as it looked out of place there.
Enabling BIOS/CSM/legacy support was a mistake. You now have Windows installed in EFI mode and Linux installed in BIOS mode. Most computers make it difficult to switch from one boot mode to the other, so such mixed-mode installations are difficult to manage.
To fix it, install an EFI boot loader for Linux. As detailed on the page to which I've just linked, several are available; but as part of the normal process of EFI boot loader installation requires that you be booted in EFI mode, you can't do this from your current Ubuntu installation -- at least, not without jumping through some extra hoops. There are several ways around this, one of which is:
- Download the USB flash drive or CD-R version of my rEFInd boot manager.
- Prepare a USB flash drive or CD-R from the downloaded image.
- Boot the rEFInd medium you've just prepared. This may require using your firmware's built-in boot manager or going into the setup utility and disabling BIOS/CSM/legacy support. If you use the boot manager and see two entries for your boot medium, select the one with "UEFI" in the description string.
- In rEFInd, you should see an entry for Windows and one or more entries to boot Linux kernels. Select one of the latter and Ubuntu should start. Note, however, that if you used a separate
/boot
partition, you'll need to hit F2 or Insert twice, rather than Enter, to launch Ubuntu. When you do this, a simple line editor will open, in which you must enter aroot=
specification pointing your kernel to your root filesystem. - In Linux, install the boot loader of your choice. Two relatively easy ways to do this are:
- Install the rEFInd Debian package or PPA, as described on the rEFInd page. This will set up rEFInd as your default boot program.
- Run Boot Repair again. This should install the EFI version of GRUB. Note that this path leaves more to chance than the preceding one; at this point you really don't know that the way Boot Repair sets things up will work, whereas you know that rEFInd will boot Ubuntu.
Best Answer
If you would prefer to check from Ubuntu:
sudo parted -l
".