Translate

Archives

Methods to UEFI Install Fedora 14

Fedora 14 ( codename Laughlin) is probably the first version of Fedora which is likely to be installed on a significant number of UEFI-enabled hardware platforms. However, you cannot do a UEFI-install from the standard Fedora 14 distribution media such a DVD as you would on a legacy BIOS-based platform. You have use one of a number of alternative installation procedures.

In this post I will describe three ways to do an UEFI install of 64-bit Fedora 14 on a 64-bit Intel-based UEFI-enabled platform. There is no technical reason that an UEFI install should not work on 64-bit AMD platforms but I have not tested such a configuration. Since Fedora 14 is not yet officially released as I write this post, I used the Fedora 14 RC1 candidate images for testing purposes but I do not think anything major relating to UEFI-installs will change prior to the formal release of Fedora 14 in a few days.

Although Fedora had rudimentary support for EFI/UEFI since at least Fedora 9, no mention of such support was included in the associated Installation Guides. With Fedora 14, this has changed. The Fedora 14 Installation Guide describes how to make a minimal UEFI boot image in section 3.3.1 and discusses UEFI installs in section 7.1. You should read these sections of the Installation Guide before attempting your own install. Note however that UEFI installation of 32-bit Fedora 14 is not supported. There is no technical reason why this could not be done; it would appear to be simply a business decision as was the decision not to make the standard Fedora 14 distribution media dual bootable like Red Hat Enterprise Linux 6 and some other GNU/Linux distributions.

Method 1

This method uses the 64-bit Fedora 14 netinst.iso image. The output of the dumpet utility shows that this image has two bootable entries.

# dumpet -i Fedora-14-x86_64-netinst.iso
Validation Entry:
	Header Indicator: 0x01 (Validation Entry)
	PlatformId: 0x00 (80x86)
	ID: ""
	Checksum: 0x55aa
	Key bytes: 0x55aa
Boot Catalog Default Entry:
	Entry is bootable
	Boot Media emulation type: no emulation
	Media load segment: 0x0 (0000:7c00)
	System type: 0 (0x00)
	Load Sectors: 4 (0x0004)
	Load LBA: 15693 (0x00003d4d)
Section Header Entry:
	Header Indicator: 0x91 (Final Section Header Entry)
	PlatformId: 0xef (EFI)
	Section Entries: 1
	ID: ""
Boot Catalog Section Entry:
	Entry is bootable
	Boot Media emulation type: no emulation
	Media load address: 0 (0x0000)
	System type: 0 (0x00)
	Load Sectors: 864 (0x0360)
	Load LBA: 18202 (0x0000471a)


Platform ID 0x00 is for legacy BIOS platforms and platform ID 0xEF is for EFI/UEFI platforms.

This image is a complete installation media which uses the Internet to retrieve the various packages it needs to perform the user-specified installation of the Fedora 14 distribution. The contents of this image are:

# cd /media/Fedora14
# ls -Ral 
.:
total 12
dr-xr-xr-x. 5 fpm  fpm  2048 Oct 12 19:35 .
drwxr-xr-x. 3 root root 4096 Oct 29 14:42 ..
dr-xr-xr-x. 3 fpm  fpm  2048 Oct 12 19:35 EFI
drwxr-sr-x. 3 fpm  fpm  2048 Oct 12 19:34 images
drwxr-sr-x. 2 fpm  fpm  2048 Oct 12 19:34 isolinux

./EFI:
total 6
dr-xr-xr-x. 3 fpm fpm 2048 Oct 12 19:35 .
dr-xr-xr-x. 5 fpm fpm 2048 Oct 12 19:35 ..
drwxr-xr-x. 2 fpm fpm 2048 Oct 12 19:34 BOOT

./EFI/BOOT:
total 72
drwxr-xr-x. 2 fpm fpm  2048 Oct 12 19:34 .
dr-xr-xr-x. 3 fpm fpm  2048 Oct 12 19:35 ..
-r--r--r--. 1 fpm fpm   168 Oct 12 19:34 BOOTX64.conf
-rw-r--r--. 1 fpm fpm 68392 Sep 13 12:05 splash.xpm.gz
-r--r--r--. 1 fpm fpm   449 Oct 12 19:35 TRANS.TBL

./images:
total 187525
drwxr-sr-x. 3 fpm fpm      2048 Oct 12 19:34 .
dr-xr-xr-x. 5 fpm fpm      2048 Oct 12 19:35 ..
-rw-r--r--. 1 fpm fpm    442368 Oct 12 19:34 efiboot.img
-rw-r--r--. 1 fpm fpm  36349952 Oct 12 19:34 efidisk.img
-rw-r--r--. 1 fpm fpm 155226112 Oct 12 19:35 install.img
drwxr-sr-x. 2 fpm fpm      2048 Oct 12 19:34 pxeboot
-r--r--r--. 1 fpm fpm       888 Oct 12 19:35 TRANS.TBL

./images/pxeboot:
total 34991
drwxr-sr-x. 2 fpm fpm     2048 Oct 12 19:34 .
drwxr-sr-x. 3 fpm fpm     2048 Oct 12 19:34 ..
-rw-r--r--. 2 fpm fpm 32043809 Oct 12 19:34 initrd.img
-r--r--r--. 1 fpm fpm      441 Oct 12 19:35 TRANS.TBL
-rwxr-xr-x. 2 fpm fpm  3781792 Oct 12 19:34 vmlinuz

./isolinux:
total 36246
drwxr-sr-x. 2 fpm fpm     2048 Oct 12 19:34 .
dr-xr-xr-x. 5 fpm fpm     2048 Oct 12 19:35 ..
-r--r--r--. 1 fpm fpm     2048 Oct 12 19:35 boot.cat
-rw-r--r--. 1 fpm fpm       84 Oct 12 19:34 boot.msg
-r--r--r--. 1 fpm fpm      142 Oct 12 19:34 grub.conf
-rw-r--r--. 2 fpm fpm 32043809 Oct 12 19:34 initrd.img
-r--r--r--. 1 fpm fpm    24576 Oct 12 19:34 isolinux.bin
-r--r--r--. 1 fpm fpm     1023 Oct 12 19:34 isolinux.cfg
-r--r--r--. 1 fpm fpm   165080 Oct 12 19:34 memtest
-r--r--r--. 1 fpm fpm   462737 Oct 12 19:34 splash.jpg
-r--r--r--. 1 fpm fpm   462737 Oct 12 19:34 syslinux-vesa-splash.jpg
-r--r--r--. 1 fpm fpm     2451 Oct 12 19:35 TRANS.TBL
-r--r--r--. 1 fpm fpm   162860 Oct 12 19:34 vesamenu.c32
-rwxr-xr-x. 2 fpm fpm  3781792 Oct 12 19:34 vmlinuz
# 

The size of the image is only approximately 220Mb. Either create a bootable DVD or USB stick. I recommend the USB stick option as it is the faster of the two to do.

Here is how to use the dd utility to create a bootable USB stick (disk) assuming that /dev/sdb points to the USB stick and netinst.iso is in the current directory. By the way, assume that anything previously on the USB stick will be overwritten and lost – so back up anything valuable on the USB stick.

# dd if=./Fedora-14-x86_64-netinst.iso  of=/dev/sdb

Insert this USB stick into your UEFI platform and select the USB stick to boot from using your UEFI boot manager. The installation will proceed as normal. During the installation you will need to configure a network interface so that the required RPMs for the Fedora 14 distribution can be downloaded over the Internet.

Method 2

This method requires you to download the entire 64-bit Fedora 14 release and burn the ISO onto a (bootable) DVD. Next mount the DVD and cd to the images subdirectory. Plug in a suitable USB stick and use the dd utility to write efidisk.img to the USB stick. As before, assume that anything previously on the USB stick will be overwritten and lost.

# cd /media/Fedora\ 14\ x86_64\ DVD/images
# ls -al efidisk.img
-rw-r--r--. 1 fpm fpm 36349952 Oct 21 14:29 efidisk.img

# dd if=./efidisk.img of=/dev/sdb
70996+0 records in
70996+0 records out
36349952 bytes (36 MB) copied, 11.8982 s, 3.1 MB/s

# gdisk /dev/sdb
GPT fdisk (gdisk) version 0.6.8

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/sdb: 70996 sectors, 34.7 MiB
Logical sector size: 512 bytes
Disk identifier (GUID): 99DEEF6A-E513-488B-99A4-142A5EAED065
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 70962
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34           70962   34.6 MiB    EF00  EFI System Partition

# mount /dev/sdb /mnt
# cd /mnt
# ls -alR 
.:
total 22
drwxr-xr-x.  3 root root 16384 Dec 31  1969 .
dr-xr-xr-x. 24 root root  4096 Oct 29 10:02 ..
drwxr-xr-x.  3 root root  2048 Oct 21 18:29 EFI

./EFI:
total 20
drwxr-xr-x. 3 root root  2048 Oct 21 18:29 .
drwxr-xr-x. 3 root root 16384 Dec 31  1969 ..
drwxr-xr-x. 2 root root  2048 Oct 21 18:29 BOOT

./EFI/BOOT:
total 35302
drwxr-xr-x. 2 root root     2048 Oct 21 18:29 .
drwxr-xr-x. 3 root root     2048 Oct 21 18:29 ..
-rwxr-xr-x. 1 root root      156 Oct 21 18:29 BOOTX64.conf
-rwxr-xr-x. 1 root root   242985 Oct 21 18:29 BOOTX64.efi
-rwxr-xr-x. 1 root root 32045806 Oct 21 18:29 initrd.img
-rwxr-xr-x. 1 root root    68392 Oct 21 18:29 splash.xpm.gz
-rwxr-xr-x. 1 root root  3782016 Oct 21 18:29 vmlinuz


As you can see from the above a small ESP named EFI System Partition is created on the USB stick. It contains the absolute minimum number of files to UEFI-boot a Fedora 14 image. Well, it could be slightly smaller if they skipped the Legacy GRUB graphic image, i.e. spash.xpm.gz. Because it is removable media, UEFI understands that BOOTX64.efi is the image to load.

Insert this USB stick into your UEFI platform and select the USB stick to boot from using your UEFI boot manager. The installation will proceed as normal. As before you will need to configure a network interface so that the required RPMs for the Fedora 14 distribution can be downloaded over the Internet.

Method 3

If you have a Fedora 14 distribution DVD but poor Internet connectivity, you can still UEFI install Fedora 14. Make a minimal install on a USB stick as described in Method 2. On your UEFI platform, place the DVD in your DVD drive and insert/attach the USB stick. From your UEFI boot manager, select the USB stick and boot from it. During installation do not configure a network interface or select any additional software repositories. A “Found local Installation Media” will be displayed and Anaconda will retrieve the required RPMs from the what it calls the “Installation Repo” i.e the Fedora 14 DVD.

uefi-fedora14-1

Now that I have described the above methods for UEFI installing Fedora 14, let us examine the UEFI-specific artifacts created by the Fedora 14 install process. When UEFI-installed, Fedora 14 partitions a disk using GPT (GUID Partition Table) rather than using a MBR. For example, here is the default GPT created by Fedora 14 when the distribution was installed on a single 500Gb disk.

# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_ultra-lv_root
                      51606140   3420032  45564668   7% /
tmpfs                  1027392       432   1026960   1% /dev/shm
/dev/sda2               495844     29534    440710   7% /boot
/dev/sda1               204580       996    203584   1% /boot/efi
/dev/mapper/vg_ultra-lv_home
                     424395160    233064 402604032   1% /home
# parted /dev/sda
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA ST3500418AS (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End    Size   File system  Name  Flags
 1      1049kB  211MB  210MB  fat16              boot
 2      211MB   735MB  524MB  ext4
 3      735MB   500GB  499GB

# gdisk /dev/sda
GPT fdisk (gdisk) version 0.6.8

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: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2C5062C9-CFE9-4395-AB01-ED5FB78A9FFD
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          411647   200.0 MiB   EF00  
   2          411648         1435647   500.0 MiB   0700  
   3         1435648       976773119   465.1 GiB   0700 

Command (? for help): c
Partition number (1-3): 1
Enter name: ESP

Command (? for help): x

Expert command (? for help): i
Partition number (1-3): 1
Partition GUID code: C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI System)
Partition unique GUID: 8CCDE8E2-30A0-4C5A-A1AE-EB2056F04627
First sector: 2048 (at 1024.0 KiB)
Last sector: 411647 (at 201.0 MiB)
Partition size: 409600 sectors (200.0 MiB)
Attribute flags: 0000000000000000
Partition name: ESP

Expert command (? for help): o
MBR disk identifier: 0x00000000
MBR partitions:
Number	 Boot	 Start (sector)	 Length (sectors)	Type
   1	    	            1	      976773167 	0xEE

Disk size is 976773168 sectors (465.8 GiB)


The GPT protective partition starts at sector 0, i.e. it precedes partition number 1, and covers the entire area of the disk used by three GPT partitions. Partition 1 is the EFI System Partition (ESP).

The ESP is mounted on /boot/efi. Here is listing of the contents of the ESP.

# cd /boot/efi
# ls -alR
.:
total 26
drwx------. 3 root root 16384 Dec 31  1969 .
dr-xr-xr-x. 5 root root  1024 Oct 28 18:26 ..
drwx------. 4 root root  4096 Oct 28 22:36 EFI

./EFI:
total 28
drwx------. 4 root root  4096 Oct 28 22:36 .
drwx------. 3 root root 16384 Dec 31  1969 ..
drwx------. 2 root root  4096 Oct 28 18:27 redhat

./EFI/redhat:
total 252
drwx------. 2 root root   4096 Oct 28 18:27 .
drwx------. 4 root root   4096 Oct 28 22:36 ..
-rwx------. 1 root root    906 Oct 28 22:49 grub.conf
-rwx------. 1 root root 242985 Aug  5 15:06 grub.efi


The loadable image for the UEFI booting service is /EFI/redhat/grub.efi. This is a modified version of GRUB Legacy which a UEFI loader can load.

According to section 3.4.1.2 of the current version (2.3) of the UEFI specification:

It is expected that on a non-removable media device complete FilePath can be used which includes subdirectories and a file name for the boot target and the platform will boot using this FilePath according to normal system policy.

For Fedora 14, that FilePath is /EFI/redhat/grub.efi. It would be nice if this were mentioned somewhere in the Fedora 14 install documentation.

The current UEFI specification also states that:

If for whatever reason, all the Boot#### variables referenced in the BootOrder variable point to devices that are not present, the boot devices have timed out, the specific boot file does not exist, or there is no valid boot variable, default boot processing may optionally occur.

All the UEFI platforms I have encountered to date support such default boot processing. In the case of an X86_64 platform the system firmware will attempt to load the image /EFI/BOOT/BOOTX64.EFI. For this reason, as a backup boot mechanism, I usually create a …/EFI/BOOT directory and copy the …/EFI/redhat/grub.efi and …/EFI/redhat/grub.conf files into this directory renaming them as BOOTX64.EFI and BOOTX64.CONF respectively.

By the way the Fedora 14 install does not create an EFI volume label for the EFI System Partition. If you wish, you can easily add one from an EFI shell if one is available to you.

fs0:  vol fs0 -n EFI_SYS_PART

A number of utilities do not work after a UEFI install of Fedora 14. For example fdisk does not work with GPT disks. In fairness, it does display a message to that effect. Many people use parted which does understand GPT but I prefer to use the gdisk utility. Also System/Administration/Bootloader (/usr/share/system-config-boot/system-config-boot.py) fails with a /boot/grub/grub.conf not found error. This script needs to be modified so that it knows to edit /boot/efi/EFI/redhat/grub.conf when an ESP exists.

Please let me know if you discover other interesting methods of UEFI booting Fedora 14 or any other commands and utilities that exhibit failures due to a UEFI install.
 

5 comments to Methods to UEFI Install Fedora 14

  • For Fedora 14, that FilePath is /EFI/redhat/grub.efi. It would be nice if this were mentioned somewhere in the Fedora 14 install documentation.

    The tools will tell you this:[root@dhcp112 ~]# efibootmgr -v | grep Fedora
    Boot0004* Fedora ACPI(a0341d0,0)PCI(1,0)PCI(0,0)030a2c00b4dd87d48b00d911afdc001083ffca4d000000001585e00400c50050000000000000000000000100HD(1,100,c800,9d55853d-ba41-481a-a2e6-d6456d3e2ef5)File(\EFI\redhat\grub.efi)

    Also System/Administration/Bootloader (/usr/share/system-config-boot/system-config-boot.py) fails with a /boot/grub/grub.conf not found error. This script needs to be modified so that it knows to edit /boot/efi/EFI/redhat/grub.conf when an ESP exists.

    The proper behavior is to follow the symlink from /etc/grub.conf . Please file this as a bug.

  • Peter,

    It is fine to use either efibootmgr or my utility uefivars to access the EFI BOOT* variables when you running Fedora, but when you are installing Fedora, such utilities is not available to you. You have only whatever EFI tools are available to you from the EFI prompt.

    Say hello to Denise Dumas if you see her.

  • Yeah, I’ve been planning on writing an efibootmgr analog for the efi environment. It’s on my TODO list.

  • Kuehner Joseph

    Would this work also for Fedora 15??

    Regards

  • bed wedge

    A person essentially help to make severely posts I’d state. This is the very first time I frequented your website page and thus far? I surprised with the analysis you made to create this actual publish extraordinary. Magnificent task!