Skip to main content
Home
The Baheyeldin Dynasty
The journey for wisdom starts with knowledge
  • Home
  • About
  • Site Map
  • Contact

Switching A Linux Drive From Legacy BIOS to UEFI

  1. Home

By Khalid on 2026/06/20 - 16:48, last updated 2026/06/20 - 17:05

Say you have an drive on a Linux computer that was created in the days before UEFI was widespread. And say, you want to move it to a more modern hardware. In this case, you may want to convert that drive from Legacy BIOS to UEFI.

This is not an easy process, but quite doable, though it is a multi-step one. There are several guides online, like this one, which details the process.

Overview

The cruical part is that the new disk must:

  • Be partitioned with GPT.
  • Have room for a new EFI partition.

Creating an EFI partition is the harder part. It has to be about 50MB (if you intend to run Linux only), or more if you want to dual boot certain other operating systems. The filesystem type must be vfat. You may need to resize the existing Linux partition to make room for the EFI partition.

After those two crucial requirements are met, you will need to:

  • Install GRUB in UEFI mode.
  • Update the /etc/fstab file.
  • Switch your BIOS to UEFI only mode.

I will not cover all the above steps in detail, since the above linked guide covers all of it.

However, it is missing a crucial piece when it comes to Ubuntu (and perhaps Debian): a new GRUB package needs to be installed!

Boot From A Rescue USB Drive

You need to boot from any rescue USB drive. I prefer Finnix, but you can use anyone that you are familiar with.

Make sure that you connect an Ethernet cable. Even though you may have WiFi on your laptop/desktop, it is easier to use Ethernet since you don't need to provide an SSID and password. That way, you can install the GRUB package over the internet.

Once you boot the rescue drive, you need to figure out which partition has your root filesystem for Linux, so you can mount it.

lsblk

Create a mount point for the root partiton:

mkdir /mnt/r

Mount Your Root Partition

Depending on your drive, replace FOOx with your real parition, e.g. nvme0n1p5, sda2, ...etc.

mount /dev/FOOx /mnt/r

Bind the mount points:

mount --bind /proc    /mnt/r/proc
mount --bind /sys     /mnt/r/sys
mount --bind /run     /mnt/r/run
mount --bind /dev     /mnt/r/dev
mount --bind /dev/pts /mnt/r/dev/pts

Create a mount point for the EFI partition:

mkdir -p /boot/efi

Mount the EFI partition (again replace FOOy by nvme0n1p1, sda1, ...etc.):

mount /dev/FOOy /boot/efi

Now change root, so you are in the root partition:

chroot /mnt/r

Install GRUB for EFI

Here is where things change for Ubuntu ...

On Ubuntu, if your root file system was configured with a Legacy BIOS, the operating system will install the package: grub-pc, while if you install with a UEFI BIOS, the operating system will install grub-efi.

As a result, when you try to switch from Legacy BIOS to UEFI, you will NOT have the necessary software!

Therefore, you have to install the grub-efi package before reconfiguring the system for UEFI.
And to do that, you need a network connection, so the easiest way is to connect an Ethernet cable before you boot the rescue Linux media.

apt install grub-efi

Check the /etc/default/grub to make sure it exists, and that there are no odd stuff in it.

Install the EFI GRUB:

install-grub

Then run the following command:

update-grub

Disable initramfs resume, in case you had it:

vi /etc/initramfs-tools/conf.d/resume

Add a single line to it, as follows:

RESUME=none

Save it, then run:

update-initramfs -u

Exit the chroot environment

exit

Unmount everything ...

umount /mnt/r/proc
umount /mnt/r/sys
umount /mnt/r/run
umount /mnt/r/dev/pts
umount /mnt/r/dev
umount /mnt/r

Shutdown Linux:

shutdown -h now

Now, change the BIOS from Legacy to UEFI.

Hopefully, if you have done everything correctly, you will be in EFI mode.

If you see a GRUB prompt after you reboot, please refer to our article: What to do when Linux boots into a GRUB prompt.

Contents: 
Linux
Tags: 
UEFI
Ubuntu
  • Add comment

Current

Talks

  • Presentations and Talks

Search

Site map

Contents

  • Family
    • Khalid
    • Ancestry
    • Extended
  • Friends
  • Nokat نكت
  • Writings
    • Cooking
    • Culture
    • Science
    • History
    • Linguistics
    • Media
    • Literature
    • Politics
    • Humor
    • Terrorism
    • Business
    • Philosophy
    • Religion
    • Children
  • Technology
    • Linux
    • Arabization
    • Drupal
      • Association
    • Software
    • Internet
    • Technology in Society
    • Digital Archeology
    • NCR History
    • MidEast Internet
    • Programming
    • Saudi ISPs
    • Miscellaneous
  • Places
    • Canada
      • Weather
    • Egypt
      • Cuisine
      • Alexandria
      • E.G.C.
    • USA
    • Saudi Arabia
  • Interests
    • Astronomy
    • Fishing
    • Photography
    • Snorkeling
    • Nature
    • Photomicroscopy
  • Miscellany

In Depth

  • al-Hakim bi Amr Allah: Fatimid Caliph of Egypt الحاكم بأمر الله
  • Alexandria, Egypt
  • Arabic on the Internet
  • Articles on the history of Muslims and Arabs in the Iberian Peninsula تاريخ المسلمين و العرب في الأند
  • DIY GOTO Telescope Controller With Autoguiding and Periodic Error Correction
  • E.G.C. English Girls College in Alexandria, Egypt
  • Egyptian Cuisine, Food and Recipes مأكولات مصرية
  • George Saliba: Seeking the Origins of Modern Science?
  • Internet Scams and Fraud
  • Mistaken for an Arab or Muslim: Absurdities of being a victim in the War on Terror
  • Mistaken Identity: How some people confuse my site for others
  • One People's Terrorist Is Another People's Freedom Fighter
  • Overview of Google's Technologies
  • Photomicroscopy
  • Pseudoscience: Lots of it around ...
  • Resources for using Google Adsense with Drupal
  • Rockwood Conservation Area, Southern Ontario
  • Selected Symbolic Novels And Movies
  • Snorkeling the Red Sea near Jeddah
  • Updates and Thoughts on the Egyptian Revolution of 2011

Recent Content

Most recent articles on the site.

  • Switching A Linux Drive From Legacy BIOS to UEFI
  • How to adjust the MTU for Wireguard VPN
  • What To Do When Linux Boots To A Grub Prompt?
  • Presentations and Talks
  • How Needrestart on Ubuntu Helps With Security
more

Most Comments

Most commented on articles ...

  • Another scam via Craigslist: offering more than asking price
  • Warning to female tourists thinking of marrying Egyptians
  • Craigslist classified for used car: Cheque fraud scam
  • Winning the lottery scam email: World Cup South African lottery
  • Email Scam: BMW 5 Series car and lottery winning
more

About Khalid

Various little bits of information ...

  • Khalid Baheyeldin: brief biography
  • Presentations and Talks
  • Youtube Videos
  • GitHub Projects
  • Drupal.org Profile
  • Astrophotography @ Flickr

Sponsored Links

Your Link Ad Here

Tags

419 Android App Arabic backup Balkanization Comet Conspiracy Coronavirus COVID-19 CPU DIY Ericsson Firefox GSM Home Assistant Kubuntu Laptop Mobile OnStep OpenWRT Python Rogers Router Scam Sony Spectrum tablet Telescope Ubuntu
More

© Copyright 1999-2026 The Baheyeldin Dynasty. All rights reserved.
You can use our content under the Terms of Use.
Please read our privacy policy before you post any information on this site.
All posted articles and comments are copyright by their owner, and reflect their own views and opinions, which may not necessarily be consistent with the views and opinions of the owners of The Baheyeldin Dynasty.

Web site developed by 2bits.com Inc.