Upgrading When Tuned Is Present

This article explains how to upgrade a Preseem system that has or has had RedHat's tuned service installed.

Tuned is RedHat's system tuning daemon. Prior to Preseem 1.8, tuned was often used to configure the performance related features of the underlying hardware. Unfortunately, when tuned is installed, the Grub configuration can become corrupted causing the system to become unbootable.

Determining if Tuned is Installed

To determine if tuned is installed run the following command:

dnf list installed | egrep tuned

If this command returns no output, then tuned is not installed and this guide does not apply.

Removing Tuned

Important Note: Perform these steps before updating the system (specifically the kernel) as the updates will cause the Grub configuration to be updated.

Execute the following steps to remove tuned:

systemctl stop tuned

systemctl disable tuned

dnf remove tuned

Edit /etc/default/grub to make sure tuned variables are no longer present

Check that tuned is no longer present in /etc/grub.d/*

Edit /boot/grub2/grub.cfg to make sure tuned parameters are not corrupted

Execute this step to ensure that the server reboots without an issue:

grubby --update-kernel=ALL

Reboot:

systemctl reboot

Upgrading the System

With tuned removed, you can now update the system, specifically the kernel package which will automatically generate a new Grub configuration.

dnf upgrade --refresh

Validating that Grub is not Broken

To validate that the Grub configuration is not broken, open up the Grub configuration file (/etc/default/grub and /boot/grub2/grub.cfg, typically) in your favorite editor and search for "tuned". If "tuned" is not found, then your Grub configuration is not affected.

Recovering From a Broken Grub Configuration

If your system is unbootable and fails with a grub error then it is necessary to boot using external media to fix the problem.

Step 1: Attach the serial cable to the appliance. If the hardware is not a Preseem appliance, then attach a monitor and keyboard.

Step 2: Download the latest Fedora Live USB image and create a bootable drive with the Fedora Media Writer program (available for Windows and Linux). The Fedora Live USB image is roughly 2GB.

Step 3: Insert the Live USB into the hardware running Preseem.

Step 4: Reboot. For those using the Preseem appliance, the boot output will appear on the serial console. For those with a keyboard and monitor setup, the output will appear there.

Step 5: When the Live USB menu shows, press escape.

Step 6: Boot the system from the Live USB image by typing "linux console=ttyS0,115200n8 3" and pressing enter.

Step 7: Mount the /boot partition so the Grub configuration file can be edited. For Preseem appliances the commands to run are:

mkdir /mnt/boot

mount /dev/sda1 /mnt/boot

Step 8: Edit the Grub configuration to fix the problem:

vi /mnt/boot/grub2/grub.cfg

Search for "tuned" and look for "skew_tick" and strings like "=1"=1". Remove all the extraneous =1" from the line and then save the file.

Step 9: Power off the hardware

Step 10: Remove the Live USB

Step 11: Power on to boot into the main OS

Now that the OS is booted, follow the steps at the start of this guide to remove tuned.