What is UEFI?
BIOS[Legacy] and UEFI are two firmware interfaces for computers which work as an interpreter between the operating system and the computer firmware. Both of these interfaces are used at the startup of the computer to initialize the hardware components and start the operating system which is stored on the hard drive.
BIOS works by reading the first sector of the hard drive which has the next device’s address to initialize or code to execute. BIOS also selects the boot device that needs to be initialized for starting the operating system. Since BIOS has been in use since the very beginning, it still works in 16-bit mode, limiting the amount of code that can be read and executed from the firmware ROM.
UEFI does the same task a little differently. It stores all the information about initialization and startup in an .efi file instead of the firmware. This file is stored on the hard drive inside a special partition called EFI System Partition (ESP). The ESP partition will also contain the boot loader programs for the Operating System installed on the computer.
UEFI is meant to completely replace BIOS in the future and bring in many new features and enhancements that can’t be implemented through BIOS.
Some of the Advantages of UEFI include:
- Improved boot time.
- Enhanced Security
- Supports large storage Devices.
As of 2016, windows PCs are shipped only in UEFI mode. But if you are a person like me who tries different operating systems, or installs windows by your own, chances are, your windows installation is running in Legacy Mode.
If you are running windows in Legacy and would like to switch to UEFI without loosing data, follow these steps.
- Make sure your system supports UEFI. (Almost all boards post 2010 supports UEFI)
- To Check the type of your windows installation, Go to System Information you can find it there.
- Download gpt-fdisk (gdisk) for Windows. (We need this to make a EFI partition).
- Extract the files to a drive (You will access it via command prompt later) .
- Use a Windows Boot USB/ DISK (Any version of windows will do) to boot and while in the installation menu, press shift+F10 to access command prompt or navigate to it
- while in the command prompt, Go to diskpart and find out the disk identifier for your Windows installation.
sel disk X
- Navigate to the location where gdisk binary is kept and type:
gdisk -l X:
(Replace X with the disk number)
This will list out the partitions available in the disk. Make sure this is the one your want to convert.
- Now, convert the partition table from MBR to GPT.
Type w to write changes. Press Y whenever prompted.
- Type the following commands:
sel disk X (Replace X with the disk number)
- # Now we make some space for our EFI partition
# Note the partition number of the partition which you want to shrink
sel par X (Replace X with the partition number)
- # You may delete the System Reserved partition and replace it with the EFI partition. To do that, type:
# sel par X (Replace X with the System Reserved Partition)
# del par override
- # The shrink command is not required if you do the above two commands.
shrink desired = 200 minimum = 200
- # The following commands are common:
create par efi
format fs = fat32 quick # Format this with fat32 file system
assign letter = Z:
- Copying boot files.
Find out the partition in which Windows is installed. Note, the partition letter here might be different than the partition letter you see in Windows. Perform dir X: on each partition letter you think can have the Windows installation and confirm X. Then type:
bcdboot X:\Windows /l en-us /s Z: /f ALL
- Done. Now reboot in UEFI mode.