Ubuntu 16.04 and later can handle UEFI boot.
You need
The main program to manipulate EFI booting is efibootmgr. It
can be used to verfy and adapt information in the EFI system
partition.
Display EFI boot information:
# efibootmgr -vTo create a new boot entry (this example was used to create 0005 above)
BootCurrent: 0005
Timeout: 10 seconds
BootOrder: 0000,0001,0002,0003,0004,0005,0007
Boot0000* Diskette Drive BBS(Floppy,,0x0)
Boot0001* P0: ST3250312AS BBS(HD,,0x0)P0: ST3250312AS .
Boot0002* USB Storage Device BBS(USB,,0x0)
Boot0003* CD/DVD/CD-RW Drive BBS(CDROM,,0x0)P2: TSSTcorp CD-RW/DVD-ROM TS-.
Boot0004 Onboard NIC BBS(Network,,0x0)
Boot0005* ubuntu HD(1,GPT,081dd417-d80f-40a1-a36d-f3a76d0c0db0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
# efibootmgr --create --disk /dev/sda --part 1 --label ubuntu --loader \\EFI\\ubuntu\\shimx64.efi
Boot loaders live on the \EFI\ubuntu EFI system partition (mounted on /boot/efi):
When replacing/ changing disk you should make sure every disk uses GPT and has a EFI system disk.
Even then there may be no bootable config.
I do use a UEFI bootable USB stick with EFInd to verify what is on disk and boot it.
For general information see http://www.rodsbooks.com/refind/
To find a USB flashdrive image file http://www.rodsbooks.com/refind/getting.html
Dell optiplex 790, running ubuntu 16.04, installed from a
USB stick.
The needed space for a EFI (= fat 32) partition. Gparted
or parted van be used:
BUT gparted refuses to work on mounted partitions, and since we
use /dev/sda1 as / it will not work.
Workaround is to boot a gparted-live (tested with
gparted-live-0.26.1-1-amd64.iso).
Use
of gparted is here.
After installing openssh-server.
root@emilia:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 1.9G 0 1.9G 0% /dev
tmpfs 384M 6.1M 377M 2% /run
/dev/sda2 225G 4.7G 209G 3% /
tmpfs 1.9G 212K 1.9G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 511M 3.6M 508M 1% /boot/efi
tmpfs 384M 92K 383M 1% /run/user/1000
root@emilia:~# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sda: 488397168 sectors, 232.9 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8F41788B-9F6D-45C0-8CC3-90EB9A49A234
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 488397134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2349 sectors (1.1 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 1050623 512.0 MiB EF00 EFI System Partition
2 1050624 480253951 228.5 GiB 8300
3 480253952 488396799 3.9 GiB 8200
Command (? for help): i
Partition number (1-3): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 081DD417-D80F-40A1-A36D-F3A76D0C0DB0
First sector: 2048 (at 1024.0 KiB)
Last sector: 1050623 (at 513.0 MiB)
Partition size: 1048576 sectors (512.0 MiB)
Attribute flags: 0000000000000000
Partition name: 'EFI System Partition'
Command (? for help): i
Partition number (1-3): 2
Partition GUID code: 0FC63DAF-8483-4772-8E79-3D69D8477DE4 (Linux filesystem)
Partition unique GUID: 6D5B45BF-A768-4460-92AF-3BF2BFA7DDA9
First sector: 1050624 (at 513.0 MiB)
Last sector: 480253951 (at 229.0 GiB)
Partition size: 479203328 sectors (228.5 GiB)
Attribute flags: 0000000000000000
Partition name: ''
Command (? for help): i 3
Partition number (1-3): 3
Partition GUID code: 0657FD6D-A4AB-43C4-84E5-0933C84B4F4F (Linux swap)
Partition unique GUID: DE30F507-E371-4727-BC49-389176174C7B
First sector: 480253952 (at 229.0 GiB)
Last sector: 488396799 (at 232.9 GiB)
Partition size: 8142848 sectors (3.9 GiB)
Attribute flags: 0000000000000000
Partition name: ''
root@emilia:~# efibootmgr -vBoot 0-4 seem to be legacy boot devices (4 NIC is not enabled in BIOS)
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0000,0001,0002,0003,0004,0006
Boot0000* Diskette Drive BBS(Floppy,,0x0)
Boot0001* P0: ST3250312AS BBS(HD,,0x0)P0: ST3250312AS .
Boot0002* USB Storage Device BBS(USB,,0x0)
Boot0003* CD/DVD/CD-RW Drive BBS(CDROM,,0x0)
Boot0004 Onboard NIC BBS(Network,,0x0)
Boot0006* ubuntu HD(1,GPT,081dd417-d80f-40a1-a36d-f3a76d0c0db0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
root@emilia:~#
root@emilia:~# cd /boot/efi
root@emilia:/boot/efi# ls -lR EFI
EFI:
total 4
drwx------ 3 root root 4096 Jun 20 13:33 ubuntu
EFI/ubuntu:
total 3620
drwx------ 2 root root 4096 Jun 20 13:31 fw
-rwx------ 1 root root 64352 Jun 20 13:31 fwupx64.efi
-rwx------ 1 root root 126 Jun 20 13:33 grub.cfg
-rwx------ 1 root root 1067896 Jun 20 13:33 grubx64.efi
-rwx------ 1 root root 1271672 Jun 20 13:33 MokManager.efi
-rwx------ 1 root root 1289424 Jun 20 13:33 shimx64.efi
EFI/ubuntu/fw:
total 0
Reboot and change bios to UEFI
The bios VIEW option now shows:
Boot Option Name:
ubuntu
File System List:
HD(1,GPT,081dd417-d80f-40a1-a36d-f3a76d0c0db0)
File Name:
\EFI\ubuntu\shimx64.efi
Apply and exit
Reboot (boots ubuntu)
Every thing is as in the first test.
efibootmgr still shows the legacy devices
0-4 ?
Added another boot entry:
root@emilia:~# efibootmgr -b 5 -c -d /dev/sda1 -L "ubuntu grub" -l "\EFI\ubuntu\grubx64.efi"Rebooted
BootCurrent: 0006
Timeout: 1 seconds
BootOrder: 0005,0000,0001,0002,0003,0004,0006
Boot0000* Diskette Drive
Boot0001* P0: ST3250312AS
Boot0002* USB Storage Device
Boot0003* CD/DVD/CD-RW Drive
Boot0004 Onboard NIC
Boot0006* ubuntu
Boot0005* ubuntu grub
root@emilia:~# root@emilia:~# efibootmgr -t 10
BootCurrent: 0006
Timeout: 10 seconds
BootOrder: 0005,0000,0001,0002,0003,0004,0006
Boot0000* Diskette Drive
Boot0001* P0: ST3250312AS
Boot0002* USB Storage Device
Boot0003* CD/DVD/CD-RW Drive
Boot0004 Onboard NIC
Boot0005* ubuntu grub
Boot0006* ubuntu
root@emilia:~# efibootmgr -v
BootCurrent: 0006
Timeout: 10 seconds
BootOrder: 0005,0000,0001,0002,0003,0004,0006
Boot0000* Diskette Drive BBS(Floppy,,0x0)
Boot0001* P0: ST3250312AS BBS(HD,,0x0)P0: ST3250312AS .
Boot0002* USB Storage Device BBS(USB,,0x0)
Boot0003* CD/DVD/CD-RW Drive BBS(CDROM,,0x0)
Boot0004 Onboard NIC BBS(Network,,0x0)
Boot0005* ubuntu grub HD(1,GPT,081dd417-d80f-40a1-a36d-f3a76d0c0db0,0x800,0x100000)/File(\EFI\ubuntu\grubx64.efi)
Boot0006* ubuntu HD(1,GPT,081dd417-d80f-40a1-a36d-f3a76d0c0db0,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Dell Optiplex 7020 running ubuntu 14.04
Then we did install fwts (ubuntu FirmWareTeSt) to test/view UEFI variables. The installation requests a passwordroot@dellzebub2:/root# efibootmgr -v
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0001,0012,0013
Boot0000* Windows Boot Manager HD(1,GPT,16fcb1e6-9e58-4aff-b2c4-104e15c46d9f,0x800,0xfa000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)\
WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}\
...d................
Boot0001* ubuntu HD(1,GPT,e84c57da-10a0-4f40-9ddc-4ba50686319b,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
Boot0012* Onboard NIC(IPV4) PciRoot(0x0)/Pci(0x19,0x0)/MAC(3417ebaab7b0,0)/IPv4(0.0.0.0:0<->0.0.0.0:0,0,0)AMBO
Boot0013* Onboard NIC(IPV6) PciRoot(0x0)/Pci(0x19,0x0)/MAC(3417ebaab7b0,0)/IPv6([::]:<->[::]:,0,0)AMBO
A disk with GPT partitioning contains a "backup" MBR at
the start.
This did give me hope that a GPT partitioned disk could be used
on a machine with only MBR firmaware=BIOS.
Test machines :
Started with PF12 :
No boot devices found !
When BIOS is switched to Legacy (was UEFI), the Disk can be
used to boot.
(PF12 shows boot devices and UEFI, but UEFI cannot be used and
freeze the system.
Started with PF12 :
Shows onboard SATA disk