I installed elementary os onto a usb using legacy settings, and I can boot it using legacy bios options. However, I would like to switch the boot to UEFI so that I dont have to change my PC's firmware setting everytime I want to boot windows from my hard drive, or switch it again when I want to boot elementary off the USB. Is this possible, and how would I go about doing it?
Ubuntu – How to convert the usb installation from legacy boot to uefi?
bootgrub-legacygrub2uefiusb
Related Solutions
I also have a Laptop whose motherboard BIOS supports both Legacy and UEFI Boot options.
I use RUFUS as a utility to create bootable media for both Linux and Windows platforms. It has options such as Partition scheme and target system type which creates the bootable media for below mentioned types.
- MBR Partition scheme for BIOS (Legacy) and UEFI
- MBR Partition scheme for UEFI
- GPT Partition scheme for UEFI
And also for specific type of ISO files supported with EFI-CSM , the utility is able to create bootable media accordingly.
To create a bootable USB that supports both Legacy and UEFI Boot options proceed as follows.
- Open Rufus utility.
- Select the USB drive onto which you want to create the live bootable media.
- In order to support both UEFI and Legacy boot select the first option i.e MBR Partition scheme for BIOS and UEFI under partition scheme and target system type.
- Select file system as FAT32 and Default Cluster size.
- Tick the box with Create a bootable disk using and browse for the ISO file.
- Click START and wait for it to complete.
After completion boot the USB on any PC and you will see that it provides option to boot through LEGACY and also through UEFI.
(NOTE: Ensure that your BIOS settings have been set to allow Legacy Boot options and not strictly UEFI.)
You can re-install Ubuntu, as Pilot6 suggests, and this may be acceptable if you haven't done much customization or created many user files in Ubuntu; however, it's pretty easy to install an EFI-mode boot loader for Linux. The two easiest methods are:
Method 1:
- Disable the Compatibility Support Module (CSM; aka "legacy mode" or "BIOS mode" support) in your firmware.
- Boot the Ubuntu installer in its "try before installing" mode.
- Double-check that you've booted in EFI mode by looking for a directory called
/sys/firmware/efi
. If it's present, you've booted in EFI mode and can continue; but if it's absent, you've booted in BIOS mode and should review your firmware settings and how you created the boot medium. - Download and run the Boot Repair program, as described here.
- Tell Boot Repair to repair your installation.
- Reboot. With any luck, GRUB will appear and give you the option of booting either Windows or Ubuntu. In some rare cases, the system may boot straight to Ubuntu in EFI mode and you'll need to tweak GRUB to get Windows to appear in the GRUB menu.
Method 2:
- Disable the Compatibility Support Module (CSM; aka "legacy mode" or "BIOS mode" support) in your firmware. You may also need to disable Secure Boot, as described on this page of mine, at least temporarily.
- Download the USB flash drive or CD-R version of my rEFInd boot manager. (Download links for both are on that page.)
- Prepare the rEFInd boot medium.
- Reboot into the rEFInd boot medium.
- Boot to Ubuntu.
- In Ubuntu, install an EFI-mode boot loader. Two options are easiest:
- You can run Boot Repair, as in steps #4 and #5 of Method 1
- You can install the Debian package or PPA of rEFInd.
- Reboot. GRUB or rEFInd, whichever you specified, should come up and enable you to boot either Windows or Ubuntu.
- If desired, you can re-enable Secure Boot; however, if you installed rEFInd, you may need to manually configure Shim and install a MOK key, as described in the rEFInd Secure Boot documentation.
EDIT:
I thought you were dual-booting with Windows, but when I re-read your question, I didn't see this explicitly stated. If you're dual-booting with Windows, the above procedures should both work as-is. If you do not have a dual-boot with Windows, though, your computer may lack an EFI System Partition (ESP) and it may even use the Master Boot Record (MBR) partitioning system rather than the GUID Partition Table (GPT). If so, I recommend that you convert from MBR to GPT (if necessary), as described here. You will also need to create an ESP, which you can do with GParted using an emergency disk. You'll need to shrink an existing partition by about 550 MiB, create a new FAT32 partition in the freed space, and mark it ask an ESP by giving it a "boot" or "esp" flag (in GParted) or assigning it a type code of EF00 (in gdisk
). Note that the MBR-to-GPT conversion will destroy the current BIOS-mode boot loader, so if something goes wrong and you have problems getting EFI-mode booting working, it will be harder to return to BIOS-mode booting.
Best Answer
If a live or persistent live system
@C.S.Cameron's comments are relevant.
Save the casper-rw file or the content of the casper-rw partition.
The method he is describing is explained with more details at the following link,
https://help.ubuntu.com/community/Installation/iso2usb
If you want a persistent live system with a casper-rw partition, you can use mkusb to create it from the same Ubuntu iso file as the previous one. Then the content of the old casper-rw partition will work.
If an installed system (installed like into an internal drive)
It is possible to convert the boot mode from BIOS (alias legacy) mode to UEFI according to this link (as suggested by @MichaelBay in the comment to your question),
Which commands to convert a Ubuntu BIOS install to EFI/UEFI without boot-repair on single boot hardware?
An alternative (for other users, who read this in the future) is to create an installed system (or modify your current system) such that it can boot both in UEFI mode and BIOS mode. See the following link,
help.ubuntu.com/community/Installation/UEFI-and-BIOS
This way you make a system, that is portable between newer and older computers.