UEFI, GPT, ESP, GRUB2-EFI, (dual)-booting, fixing things
This is a how-to guide to using UEFI on your Kubuntu system.
=====
NEW:
Dual booting two (or more) *ubuntu operating systems in UEFI mode -- 1 drive or 2 drives, 1 ESP or 2 ESPs
https://www.kubuntuforums.net/forum/...-esp-or-2-esps
=====
Making Comments:
Please post comments/questions in the regular kubuntuforums.net Forums. This thread is locked for now (to make way for possible additions later).
Actually, the components of this how-to guide have been placed already in a very long thread I wrote called
GRUB 2 A Guide for Users
https://www.kubuntuforums.net/showth...uide-for-Users
The problem--I feel--with this is that the GRUB 2 Guide has become too long, containing 148 posts (as of 4-2-18), it started out specifically as simply a guide on using GRUB2, NOT GRUB2-EFI, and there isn't a concise table of contents to individual UEFI topics in that thread. I'm posting this present how-to specifically as a how-to on UEFI and related topics for Kubuntu users. If that makes any sense.
Following is a list of topics for Kubuntu users and links to how-to's I have written at kubuntuforums.net, along with brief comments on each topic.
----------
GPT, UEFI -- Study Guide
https://www.kubuntuforums.net/showth...l=1#post346604
Introduces the subject of UEFI and GPT; how the older BIOS-MBR works compared to how the new UEFI-GPT works; the structure of the older MBR; structure of new GPT. Details of the GPT layout. Discussion of sector sizes. BIOS Boot Partition. Specs of the ESP. Details of Kubuntu forum discussions started by Steve Riley. And all the links you will ever need on UEFI and GPT and ESPs.
----------
UEFI for Kubuntu--simplified. And ... some dual-booting tips for Kubuntu
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page13?p=373198&viewfull=1#post373198
For a quicker version of this link, see below: UEFI Simplified, a quicker version.
This article starts from scratch and explains UEFI and GPT, covering the following topics:
Sections 1 and 2: GPT structure, the ESP, BIOS Boot Partition, installing Kubuntu in UEFI mode and partitioning, are you booting in UEFI mode?, do you have a GPT?.
Section 3 covers everything about GRUB: where its files are located, how it places its files into the UEFI-ESP setup; [re-]installing GRUB; two important commands: grub-install and update-grub; the general form of the GRUB2-EFI commands:
sudo grub-install --efi-directory=DIR --bootloader-id=some_name [--no-uefi-secure-boot] [--no-nvram]
and, finally: Re-install GRUB2-EFI from Live DVD/USB flash drive.
Section 4 covers rEFInd.
Section 5: How your UEFI firmware works, the UEFI boot process, and the main tools you need: efibootmgr, gdisk, changing boot order, exploring your ESP, finding GUIDs and UUIDs, how do NVRAM variables get created?, default boot loader, and many more details about using UEFI--see the table of contents to Section 5 (in the link).
Section 6: All about dual-booting, 5 ways to do it, how to fix it; creating separate EFI subdirectories for your (K)Ubuntu OSs (using --no-uefi-secure-boot option).; creating and using more than one ESP, changing labels on UEFI boot entries (useful for multiple "ubuntu" entries).
Dual-Booting: A summary of Your Options
Cheat Sheet
----------
UEFI Simplified, a quicker version
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=379977&viewfull=1#post379977
A quicker version of the above how-to "UEFI for Kubuntu--simplified.And ... some dual-booting tips for Kubuntu." This may include a few more advanced tips. Includes the Cheat Sheet at the end.
----------
Dual-booting: How to Use Multiple ESPs
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users?p=376040&viewfull=1#post376040
This material is incorporated into the above two how-to's: "UEFI for Kubuntu--simplified.And ... some dual-booting tips for Kubuntu" and "UEFI Simplified, a quicker version."
----------
Labels on UEFI Boot Entries -- using efibootmgr -L
How to "change" an "ubuntu" label (/EFI/ubuntu)
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users?p=378229&viewfull=1#post378229
Detailed treatment of using/changing labels you see in your UEFI firmware boot entires (in NVRAM and in output listing from efibootmgr). This is also the method used to create and register boot entires in your UEFI firmware.
----------
A new PC build and Kubuntu-only UEFI installation
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page12?p=368216&viewfull=1#post368216
A fairly detailed example of starting from scratch: building a PC, getting your Kubuntu installed in UEFI mode, and how to explore your UEFI setup (commands to use, places to look on your system, etc.).
----------
Installing Kubuntu -- Using the "Manual" Installation Type, with your own partitioning
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page14?p=377688#post377688
Contents:
Installing GParted (gparted)
Setting up your partitions using GParted
Special steps for UEFI: ESP; creating GPT
Ways to use your live Kubuntu DVD/USB
Using the Manual installation method when installing Kubuntu
----------
Building a Kubuntu live USB flash drive installer using dd
https://www.kubuntuforums.net/showth...712#post378712
This shows you an almost sure-fire way to build your live Kubuntu USB installer using the dd command, with references. And, related:
dd: Showing the progress as dd executes
https://www.kubuntuforums.net/showthread.php/27726-The-dd-Command/page2?p=395805#post395805
----------
Using Your Live Kubuntu DVD/USB to Fix Things
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users?p=379485&viewfull=1#post379485
Part 1:
How can you use your live Kubuntu DVD or USB flash drive to fix things? Here are some tasks you can perform.
Part 2:
"Comments, Tips, some Details" are given next, including some links.
Part 3:
If you need some basics of using Kubuntu, see the section at the end called "Basic Tasks in Kubuntu."
----------
Re-install GRUB2 from Live DVD/USB flash drive
https://www.kubuntuforums.net/showth...l=1#post374017
For UEFI systems, but notes also for BIOS-MBR systems.
Re-install GRUB2-EFI from live DVD/USB using chroot.
----------
Fix UEFI+GPT with Testdisk & gdisk -- Deleted partitions & damaged GPT structure
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page12?p=372417#post372417
Summary
For a UEFI+GPT setup, if you damaged your GPT structure, or if you accidentally lost/damaged your partitions, you may be able to use TestDisk and gdisk to recover. One goal here is to see how TestDisk worked on GPT. Good news: It recovers deleted partitions. But: I could not use TestDisk to repair either the Partition Header or the Partition Table entries. For those two tasks, I used gdisk. I did five experiments. There are references included along the way for everything.
----------
Remove GRUB from UEFI -- Instead, use rEFInd and/or UEFI firmware boot menus
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=378317#post378317
If you have not yet installed Kubuntu, see Case 1 (install without GRUB).
If you have already installed Kubuntu the normal way (installing GRUB with it), see Case 2.
Then after doing either Case 1 or Case 2, read the section "After you remove GRUB".
----------
Boot Kubuntu Using UEFI Only -- no GRUB, no bootloader, no rEFInd, no other boot manager/loader
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=396271#post396271
f you have a newer computer, say 2010 or later, and the computer's firmware is the newer UEFI (not the older BIOS), and your kernel is 3.3.0 or later, your EFI firmware may be able to boot the kernel directly using the stub-loader method.
----------
rEFInd
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page12?p=372221&viewfull=1#post372221
How to install rEFInd -- a boot manager and loader for booting Kubuntu and for managing the booting on your computer.
----------
rEFInd: Make a live CD to boot into your system
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page14?p=376838&viewfull=1#post376838
----------
rEFInd: Make a live USB flash drive to boot into your system
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=379352&viewfull=1#post379352
----------
GRUB and GPT partitioned disks
https://www.kubuntuforums.net/showth...l=1#post403281
This how-to, by oshunluvr, shows you how to do this:
On a system that is not UEFI,
use the GPT partition table,
and install GRUB (using a BIOS Boot Partition) to your GPT.
----------
Dual Boot Your Existing Windows 8/10 with Kubuntu
See Post #4 below in this thread -->
--------------------
--------------------
--------------------
... and if you'd like to read my old GRUB 2 Guide in Greek, here it is:
https://forum.ubuntu-gr.org/viewtopic.php?f=9&t=7278
... or if you need my original GRUB Legacy Toolkit (2007):
https://www.kubuntuforums.net/showthread.php/18855-HOW-TO-GRUB-Methods-Toolkit
This is a how-to guide to using UEFI on your Kubuntu system.
=====
NEW:
Dual booting two (or more) *ubuntu operating systems in UEFI mode -- 1 drive or 2 drives, 1 ESP or 2 ESPs
https://www.kubuntuforums.net/forum/...-esp-or-2-esps
=====
Making Comments:
Please post comments/questions in the regular kubuntuforums.net Forums. This thread is locked for now (to make way for possible additions later).
Actually, the components of this how-to guide have been placed already in a very long thread I wrote called
GRUB 2 A Guide for Users
https://www.kubuntuforums.net/showth...uide-for-Users
The problem--I feel--with this is that the GRUB 2 Guide has become too long, containing 148 posts (as of 4-2-18), it started out specifically as simply a guide on using GRUB2, NOT GRUB2-EFI, and there isn't a concise table of contents to individual UEFI topics in that thread. I'm posting this present how-to specifically as a how-to on UEFI and related topics for Kubuntu users. If that makes any sense.
Following is a list of topics for Kubuntu users and links to how-to's I have written at kubuntuforums.net, along with brief comments on each topic.
----------
GPT, UEFI -- Study Guide
https://www.kubuntuforums.net/showth...l=1#post346604
Introduces the subject of UEFI and GPT; how the older BIOS-MBR works compared to how the new UEFI-GPT works; the structure of the older MBR; structure of new GPT. Details of the GPT layout. Discussion of sector sizes. BIOS Boot Partition. Specs of the ESP. Details of Kubuntu forum discussions started by Steve Riley. And all the links you will ever need on UEFI and GPT and ESPs.
----------
UEFI for Kubuntu--simplified. And ... some dual-booting tips for Kubuntu
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page13?p=373198&viewfull=1#post373198
For a quicker version of this link, see below: UEFI Simplified, a quicker version.
This article starts from scratch and explains UEFI and GPT, covering the following topics:
Sections 1 and 2: GPT structure, the ESP, BIOS Boot Partition, installing Kubuntu in UEFI mode and partitioning, are you booting in UEFI mode?, do you have a GPT?.
Section 3 covers everything about GRUB: where its files are located, how it places its files into the UEFI-ESP setup; [re-]installing GRUB; two important commands: grub-install and update-grub; the general form of the GRUB2-EFI commands:
sudo grub-install --efi-directory=DIR --bootloader-id=some_name [--no-uefi-secure-boot] [--no-nvram]
and, finally: Re-install GRUB2-EFI from Live DVD/USB flash drive.
Section 4 covers rEFInd.
Section 5: How your UEFI firmware works, the UEFI boot process, and the main tools you need: efibootmgr, gdisk, changing boot order, exploring your ESP, finding GUIDs and UUIDs, how do NVRAM variables get created?, default boot loader, and many more details about using UEFI--see the table of contents to Section 5 (in the link).
Section 6: All about dual-booting, 5 ways to do it, how to fix it; creating separate EFI subdirectories for your (K)Ubuntu OSs (using --no-uefi-secure-boot option).; creating and using more than one ESP, changing labels on UEFI boot entries (useful for multiple "ubuntu" entries).
Dual-Booting: A summary of Your Options
Cheat Sheet
----------
UEFI Simplified, a quicker version
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=379977&viewfull=1#post379977
A quicker version of the above how-to "UEFI for Kubuntu--simplified.And ... some dual-booting tips for Kubuntu." This may include a few more advanced tips. Includes the Cheat Sheet at the end.
----------
Dual-booting: How to Use Multiple ESPs
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users?p=376040&viewfull=1#post376040
This material is incorporated into the above two how-to's: "UEFI for Kubuntu--simplified.And ... some dual-booting tips for Kubuntu" and "UEFI Simplified, a quicker version."
----------
Labels on UEFI Boot Entries -- using efibootmgr -L
How to "change" an "ubuntu" label (/EFI/ubuntu)
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users?p=378229&viewfull=1#post378229
Detailed treatment of using/changing labels you see in your UEFI firmware boot entires (in NVRAM and in output listing from efibootmgr). This is also the method used to create and register boot entires in your UEFI firmware.
----------
A new PC build and Kubuntu-only UEFI installation
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page12?p=368216&viewfull=1#post368216
A fairly detailed example of starting from scratch: building a PC, getting your Kubuntu installed in UEFI mode, and how to explore your UEFI setup (commands to use, places to look on your system, etc.).
----------
Installing Kubuntu -- Using the "Manual" Installation Type, with your own partitioning
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page14?p=377688#post377688
Contents:
Installing GParted (gparted)
Setting up your partitions using GParted
Special steps for UEFI: ESP; creating GPT
Ways to use your live Kubuntu DVD/USB
Using the Manual installation method when installing Kubuntu
----------
Building a Kubuntu live USB flash drive installer using dd
https://www.kubuntuforums.net/showth...712#post378712
This shows you an almost sure-fire way to build your live Kubuntu USB installer using the dd command, with references. And, related:
dd: Showing the progress as dd executes
https://www.kubuntuforums.net/showthread.php/27726-The-dd-Command/page2?p=395805#post395805
----------
Using Your Live Kubuntu DVD/USB to Fix Things
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users?p=379485&viewfull=1#post379485
Part 1:
How can you use your live Kubuntu DVD or USB flash drive to fix things? Here are some tasks you can perform.
Part 2:
"Comments, Tips, some Details" are given next, including some links.
Part 3:
If you need some basics of using Kubuntu, see the section at the end called "Basic Tasks in Kubuntu."
----------
Re-install GRUB2 from Live DVD/USB flash drive
https://www.kubuntuforums.net/showth...l=1#post374017
For UEFI systems, but notes also for BIOS-MBR systems.
Re-install GRUB2-EFI from live DVD/USB using chroot.
----------
Fix UEFI+GPT with Testdisk & gdisk -- Deleted partitions & damaged GPT structure
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page12?p=372417#post372417
Summary
For a UEFI+GPT setup, if you damaged your GPT structure, or if you accidentally lost/damaged your partitions, you may be able to use TestDisk and gdisk to recover. One goal here is to see how TestDisk worked on GPT. Good news: It recovers deleted partitions. But: I could not use TestDisk to repair either the Partition Header or the Partition Table entries. For those two tasks, I used gdisk. I did five experiments. There are references included along the way for everything.
----------
Remove GRUB from UEFI -- Instead, use rEFInd and/or UEFI firmware boot menus
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=378317#post378317
If you have not yet installed Kubuntu, see Case 1 (install without GRUB).
If you have already installed Kubuntu the normal way (installing GRUB with it), see Case 2.
Then after doing either Case 1 or Case 2, read the section "After you remove GRUB".
----------
Boot Kubuntu Using UEFI Only -- no GRUB, no bootloader, no rEFInd, no other boot manager/loader
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=396271#post396271
f you have a newer computer, say 2010 or later, and the computer's firmware is the newer UEFI (not the older BIOS), and your kernel is 3.3.0 or later, your EFI firmware may be able to boot the kernel directly using the stub-loader method.
----------
rEFInd
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page12?p=372221&viewfull=1#post372221
How to install rEFInd -- a boot manager and loader for booting Kubuntu and for managing the booting on your computer.
----------
rEFInd: Make a live CD to boot into your system
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page14?p=376838&viewfull=1#post376838
----------
rEFInd: Make a live USB flash drive to boot into your system
https://www.kubuntuforums.net/showthread.php/43221-GRUB-2-A-Guide-for-Users/page15?p=379352&viewfull=1#post379352
----------
GRUB and GPT partitioned disks
https://www.kubuntuforums.net/showth...l=1#post403281
This how-to, by oshunluvr, shows you how to do this:
On a system that is not UEFI,
use the GPT partition table,
and install GRUB (using a BIOS Boot Partition) to your GPT.
----------
Dual Boot Your Existing Windows 8/10 with Kubuntu
See Post #4 below in this thread -->
--------------------
--------------------
--------------------
... and if you'd like to read my old GRUB 2 Guide in Greek, here it is:
https://forum.ubuntu-gr.org/viewtopic.php?f=9&t=7278
... or if you need my original GRUB Legacy Toolkit (2007):
https://www.kubuntuforums.net/showthread.php/18855-HOW-TO-GRUB-Methods-Toolkit
Comment