Back to the main page

UEFI PXE boot and installation via Cobbler

UEFI (Unified Extensible Firmware Interface) is a standard firmware interface for PC, designed to replace BIOS (basic input/output system). It has many advantages, like supporting drives larger then 2.2TB, etc.
The UEFI specification includes support for booting over network via PXE. Here is example of such boot and installation of OL7.2 via Cobbler 2.6.9.

Add a system in Cobbler, select a UEFI Profile (it has associated kickstart file that works for UEFI), also make sure to have filled Kernel Options which is http location of ks file.


Here is exmaple of ks file.
install
text
url --url=http://x.x.x.x/cobbler/links/OL-R7-U2-x86_64
lang en_US.UTF-8
keyboard us
#rootpw moja-lozinka
rootpw --iscrypted $1$zw2wh8P1$zZMsVBx4.HbZNxM8p1uPX1
firewall --disabled
authconfig --enableshadow --enablemd5
selinux --disabled
timezone --utc America/Los_Angeles
reboot
bootloader --location=mbr # for OL7.2
#bootloader --location=partition # for OL6.7
clearpart --all --initlabel
# --- LVM
part /boot/efi --fstype vfat --size=200 --asprimary
part /boot --fstype ext4 --size=500 --asprimary
part pv.1 --size=1024 --grow --ondisk=sda
volgroup vg00 pv.1
logvol / --fstype ext4 --name=lvol_root --vgname=vg00 --size=20480
logvol /var --fstype ext4 --name=lvol_var --vgname=vg00 --size=8192
logvol swap --fstype swap --name=lvol_swap --vgname=vg00 --size=8192
# --- ext4
#part /boot/efi --fstype=vfat --size=200 --asprimary --ondisk=sda
#part /boot --fstype=ext4 --size=500 --label=/boot --asprimary --ondisk=sda
#part / --fstype=ext4 --size=20480 --grow --maxsize=51200 --label=/ --ondisk=sda
#part /var --fstype=ext4 --size=8192 --label=/var --ondisk=sda
#part swap --size=8192 --label=swap --ondisk=sda
#
# Install default packages
%packages
@base
@core
device-mapper-multipath
kexec-tools
net-tools
pciutils
sysfsutils
system-config-kickstart
wget
lsscsi
nfs-utils
ntp
%end

The system is also defined in DHCP config file, something like:
host my-hostname.domain.com {
       hardware ethernet 00:10:e0:aa:aa:aa;
       fixed-address 10.xx.xx.xx;
       next-server 10.y.y.y;    # my cobbler server
       filename "/grub/BOOTX64-ol7u2.efi";
       }

UEFI-based PXE clients can use the BOOTX64.efi boot loader, which is available as EFI/BOOT/BOOTX64.efi from OL7.2 ISO.
NOTE: The file BOOTX64.efi is different for OL6 and OL7, so I usually rename it to BOOTX64-ol6u7.efi and BOOTX64-ol7u2.efi and these are used in the DHCP configuration.

Also have the file splash.xpm.gz in <cobbler-server>:/var/lib/tftpboot/grub/
Ref URL: https://gist.github.com/cwacek/5910195

The file /var/lib/tftpboot/grub/<mac-address> will look like
timeout=10
splashimage=(nd)/splash.xpm.gz
title OL-R7-U2-x86_64-UEFI
  root (nd)
  kernel /images/OL-R7-U2-x86_64/vmlinuz ksdevice=bootif lang= text ks=http://cobblerserver/cblr/svc/op/ks/system/host_name
     initrd /images/OL-R7-U2-x86_64/initrd.img

After powering on a server, go to Setup, most likely by pressing F2 and select UEFI Boot Mode.


Press F8 to see the list of boot devices and select network interface for PXE boot.




You see that network cable is present and NBP file is downloading. A network boot program (NBP) is the first file downloaded and executed as part of PXE boot process.


Then you see the Profile from Cobbler, select it.


And installation continues.




Some commands to verify newly installed system.
# cat /etc/oracle-release
Oracle Linux Server release 7.2

# cat /etc/fstab
/dev/mapper/vg00-lvol_root                 /          ext4    defaults        1 1
UUID=8fc27341-75fd-44c6-8a5f-a461c34bf717 /boot       ext4    defaults        1 2
UUID=0233-7EEA                            /boot/efi   vfat    defaults,uid=0,gid=0,umask=0077,shortname=winnt 0 0
/dev/mapper/vg00-lvol_var                 /var        ext4    defaults        1 2
/dev/mapper/vg00-lvol_swap                swap        swap    defaults        0 0

# df -h
Filesystem                  Size  Used Avail Use% Mounted on
/dev/mapper/vg00-lvol_root   20G  1.3G   18G   7% /
devtmpfs                    126G     0  126G   0% /dev
tmpfs                       126G     0  126G   0% /dev/shm
tmpfs                       126G  9.0M  126G   1% /run
tmpfs                       126G     0  126G   0% /sys/fs/cgroup
/dev/sda2                   477M  125M  323M  28% /boot
/dev/sda1                   200M  9.5M  191M   5% /boot/efi
/dev/mapper/vg00-lvol_var   7.8G   87M  7.3G   2% /var
tmpfs                        26G     0   26G   0% /run/user/0

# pvs
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda3  vg00 lvm2 a--  836.57g 800.57g

# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  vg00   1   3   0 wz--n- 836.57g 800.57g

# lvs
  LV        VG   Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvol_root vg00 -wi-ao---- 20.00g
  lvol_swap vg00 -wi-ao----  8.00g
  lvol_var  vg00 -wi-ao----  8.00g

# efibootmgr
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0005,0001,0002,0003,0004
Boot0001* [UEFI]PXE:NET0:Intel(R) Ethernet Controller X540-AT2
Boot0002* [UEFI]PXE:NET1:Intel(R) Ethernet Controller X540-AT2
Boot0003* [UEFI]PXE:NET2:Intel(R) Ethernet Controller X540-AT2
Boot0004* [UEFI]PXE:NET3:Intel(R) Ethernet Controller X540-AT2
Boot0005* Oracle Linux

# parted
GNU Parted 3.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: LSI MR9261-8i (scsi)
Disk /dev/sda: 899GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  211MB  210MB  fat16        EFI System Partition  boot
 2      211MB   735MB  524MB  ext4
 3      735MB   899GB  898GB                                     lvm

(parted) quit



Back to the main page