Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Oracle Linux Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Oracle Linux Cookbook

Oracle Linux Cookbook

By : Erik Benner, Erik B. Thomsen, Jonathan Spindel
5 (4)
close
close
Oracle Linux Cookbook

Oracle Linux Cookbook

5 (4)
By: Erik Benner, Erik B. Thomsen, Jonathan Spindel

Overview of this book

Discover the power of Oracle Linux 8, the free and enterprise-grade Linux distribution designed for use in any environment, with this recipe-style book. Starting with instructions on how to obtain Oracle Linux for both X86 and ARM-based platforms, this book walks you through various installation methods, from running it as a Windows service to installing it on a Raspberry Pi. It unravels advanced topics such as system upgrades using Leapp for major version transitions and using a PXE server and kickstart files for more advanced installations. The book then delves into swapping kernels to take advantage of Oracle’s UEK, exploring boot options, managing software with DNF, and achieving high availability. Detailed recipes involving security topics will assist with tasks such as data encryption, both at rest and in motion. For developers, it offers guidance on building RPM files, using Docker and Podman in a containerized environment, working with AppStreams, and more. For large-scale deployments, the book introduces Oracle Linux Automation Manager for enterprise-level Ansible utilization, from setting up the Ansible server to basic playbook writing. Finally, you’ll discover strategies for cloud migration. By the end of this book, you’ll possess a comprehensive toolkit that will elevate your skills as a Linux administrator.
Table of Contents (16 chapters)
close
close

Serving up the boot – TFTPD

TFTP is used for simple file transfers over the network. This is most often used to load the initial bootloader for an OS, or some firmware updates for embedded devices and older hardware. In the context of the PXE server, the TFTP system is used for the initial bootloader.

Getting ready

To set up a TFTP server, you will need an Oracle Linux 8 VM running in your environment. The server should be on the same network subnet that the systems being built are using. Ideally, you should also have enough space for several boot files. Normally, 5 GB is enough data space.

How to do it…

Installing TFTP is simple. Run the dnf install -y tftp-server command, as seen in Figure 2.12.

Figure 2.12 – TFTP installation

Figure 2.12 – TFTP installation

Once the installation is complete, we need to open up the firewall for TFTP and reload it:

firewall-cmd --add-service=tftp --permanent
firewall-cmd --reload

The output of these commands is as shown in the following screenshot:

Figure 2.13 – TFTP firewall

Figure 2.13 – TFTP firewall

After installation and the firewall has opened, we need to prepare the system by installing the bootloaders, preparing an Oracle Linux 8 TFTP location, and creating a boot menu.

Note

This example is using a BIOS-based host. If you want to use a UEFI host, you will need to install grub2-efi and configure UEFI-specific parameters. The Oracle docs for this can be found at https://docs.oracle.com/en/operating-systems/oracle-linux/8/install/install-CreatingaNetworkInstallationSetup.html#uefi-clients.

To install the bootloaders for BIOS-based installs, we will install the syslinux package. The syslinux package includes bootloaders for network booting (PXELINUX), Linux (ext2/ext3/ext4) or btrfs filesystems (EXTLINUX), MS-DOS FAT filesystems (SYSLINUX), and bootable El Torito CD-ROMs (ISOLINUX). For network booting, we will be using PXELINUX:

Figure 2.14 – Syslinux installation

Figure 2.14 – Syslinux installation

Next, we will copy the boot image file, pxelinux.0, and copy the file into /var/lib/tftpboot:

cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

Then, we will create an Oracle Linux 8 boot directory under tftpboot:

mkdir /var/lib/tftpboot/ol8

Now, we need to copy over the PXE boot files from the ISO we previously mounted when installing the HTTP server to the new Oracle Linux 8 boot directory:

cp /var/www/html/OL8/images/pxeboot/* /var/lib/tftpboot/ol8/

Next, we need a boot menu. Luckily, we can copy over the samples and get things moving quickly. We only need the menu files, so using the following command to copy things works just fine:

cp -v /usr/share/syslinux/{ldlinux.c32,libcom32.c32,libutil.c32,menu.c32,vesamenu.c32} /var/lib/tftpboot/

Almost done here. To make a directory for the PXS config files and build the default menu, use the following:

mkdir /var/lib/tftpboot/pxelinux.cfg

We can finally install a config file. Copy this sample configuration file into /var/lib/tftpboot/pxelinux.cfg/default:

default linux-auto
prompt 1
timeout 60
display boot.msg
label linux-auto
  menu label ^Install OL8 in Graphical Mode using the kickstart file
  menu default
  kernel ol8/vmlinuz
  append initrd=ol8/initrd.img ip=dhcp inst.repo=http://pxe.lab.m57.local/ol8 ks=http://pxe.lab.m57.local/ks_files/ol8ks.cfg
label linux-manual
  menu label ^Install OL8 in Graphical Mode with manual input
  menu default
  kernel ol8/vmlinuz
  append initrd=ol8/initrd.img ip=dhcp inst.repo=http://pxe.lab.m57.local/ol8
label rescue
  menu label ^Rescue installed system
  kernel ol8/vmlinuz
  append initrd=ol8/initrd.img rescue
label local
  menu label Boot from ^local drive
  localboot 0xffff

In this sample, the default install will be linux-auto, and that will start in 60 seconds unless the user manually selects one of the following options:

  • linux-auto: This is the default and will install Oracle Linux using the kickstart parameters
  • linux-manual: This will kick off a traditional install or Oracle Linux, prompting the user to select all the options from Anaconda manually
  • rescue: This will boot in rescue mode
  • local: This will boot from the existing local disk

You can easily modify the menus as needed to meet your specific needs. PXE booting, while daunting at first, provides a powerful tool to manage your Linux installations.

How it works…

When systems boot, they will load the bootloader based on the DHCP server config. This will then have the system boot from the TFTP server, starting the PXE process.

bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY