Jump to content
documentation.suse.com / Performing Major Version Upgrades of SUSE Linux Enterprise

Performing Major Version Upgrades of SUSE Linux Enterprise

When Standard Boot Options Are Unavailable

SUSE Best Practices

Systems Management

Author
Jiri Srain, Project Manager Engineering (SUSE)
Image
SUSE Linux Enterprise 11 and newer

This guide shows how to perform an upgrade of a SUSE Linux Enterprise system to a new major version in environments which do not allow for standard booting of the installation, neither via the local boot media, nor via PXE boot.

Disclaimer: Documents published as part of the SUSE Best Practices series have been contributed voluntarily by SUSE employees and third parties. They are meant to serve as examples of how particular actions can be performed. They have been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. SUSE cannot verify that actions described in these documents do what is claimed or whether actions described have unintended consequences. SUSE LLC, its affiliates, the authors, and the translators may not be held liable for possible errors or the consequences thereof.

1 Introduction

To upgrade your SUSE Linux Enterprise system to a newer service pack, there are tools available which allow for an online upgrade of the system. This means that new packages are installed while the system is running. After the installation of the packages, a reboot is necessary.

This process has the advantage that you only need access to the system, be it a local console or an SSH session. You do not need to configure the firmware to boot a different media.

However, upgrading a system to a new major version cannot be performed online. To perform an upgrade, you need to boot the system from the installation media (DVD, USB stick), or start it via PXE boot.

In some environments, it is not possible to insert a new media to the server, configure the firmware to boot from a different or even a virtual disk, or prepare the PXE boot environment for starting the upgrade process. This can be the case for example in clouds or in remote server rooms.

This document describes how the existing boot loader can be used in such environments to perform an upgrade from SUSE Linux Enterprise 11 to SUSE Linux Enterprise 12, or from SUSE Linux Enterprise 12 to SUSE Linux Enterprise 15.

While the examples below focus on the AMD64 or Intel 64 system architecture, a similar approach can be applied to other architectures too.

2 Terminology

The Installation Media is the media you use to boot the installation. It can be either a physical DVD or USB stick, an ISO image attached to a virtual machine, or the content on such media available via a network share.

For SUSE Linux Enterprise 12 products, the installation medium is the first DVD of the respective product. For SUSE Linux Enterprise 15 products, it is the unified installer DVD.

The Installation Repository contains packages for installation and metadata. It is included in the installation media. Online repositories, which are for example mirrored on the Subscription Management Tool (SMT), can serve the same purpose.

The Installation System is the environment which contains all tools that are needed to perform the installation (including for example YaST). It is also available from the installation media.

3 Requirements

To perform an upgrade, you need to have prepared the following components:

  • The installation repository and installation system

  • The installation kernel and initrd

The installation repository should be either copied to a local disk, or made available via the network. The installer supports all common transfer protocols, like HTTP(S), FTP, NFS, SMB. For local media, it supports a local disk or a CD/DVD drive. It is recommended to copy the entire content of the installation media, so that the installation system is included. The required disk space is approximately 5 GB for upgrading to SUSE Linux Enterprise 12, and approximately 1 GB for upgrading to SUSE Linux Enterprise 15, on top of the disk space needed for the upgrade itself.

The installation kernel and initrd must be made available in the boot area of the respective hardware architecture. For example, for legacy booting of AMD64 or Intel 64 systems, this is the /boot directory. The required disk space is approximately 100 MB.

4 Preparing the Installation Repository

Preparing the installation repository is an easy task. Extract the content of the installation media to the respective location either on your local system or on a network share. Use the content of DVD1 of any SUSE Linux Enterprise 12 product, or the Installer DVD of the unified SUSE Linux Enterprise 15 installer.

If you intend to put the installation media to a local storage, either use a second disk or a stand-alone partition, which is not mounted by your system by default. The reason behind is that YaST mounts all partitions during the upgrade process. This would result in the partition being mounted twice at the same time.

If you use a network share, make sure that it is accessible from the host you aim to upgrade. You can test this for example via a Web browser.

If you use the installation media, copy its entire content to ensure it includes the installation system.

If you have a local Subscription Management Tool (SMT) or Repository Mirroring Tool (RMT) server available, the repository may already be mirrored on that server. If this is the case, point the installer to the POOL repository of the product you want to upgrade to. Ensure that the installation system is available too.

5 Preparing the Installation Kernel and Initrd

To boot the installer, you need to extract the installation kernel and initrd from the media and put it to the location where the boot loader can load it from. There are two ways to obtain the installation kernel and initrd:

  • From the DVD1 of the SUSE Linux Enterprise 12-based product, respective the SUSE Linux Enterprise 15 unified installer

  • From packages shipped with a new product for network booting

The examples below require as system architecture AMD64 or Intel 64 with legacy booting, and as product SUSE Linux Enterprise Server. For other products or architectures, the paths or package names may differ.

5.1 Extracting the Installation Kernel from the Media

The examples and explanations in this section require that the installation media is mounted under /mnt.

Copy the kernel and initrd from the installation media to the same location where your system stores its kernel and initrd:

# cp /mnt/boot/x86_64/loader/initrd /boot/initrd.install
# cp /mnt/boot/x86_64/loader/linux /boot/linux.install

5.2 Extracting the Installation Kernel from a Package

SUSE Linux Enterprise 12 SP4-based products and newer product versions include a package which contains all files needed for setting up a PXE boot server for installation of the respective product. The name of the package looks like the following example: tftpboot-installation-<product>-<version>-<architecture>.noarch.rpm. Download the package from the repositories of the product you install to. The package is architecture-independent and does not require any packages from the new product.

# rpm -i tftpboot-installation-SLES-12-SP4-x86_64-14.337.5-1.33.noarch.rpm
# cp /srv/tftpboot/SLES-12-SP4-x86_64/boot/x86_64/loader/linux /boot/linux.install
# cp /srv/tftpboot/SLES-12-SP4-x86_64/boot/x86_64/loader/initrd /boot/initrd.install
# rpm -e tftpboot-installation-SLES-12-SP4-x86_64

6 Configuring the Boot Loader

To perform the upgrade, you need to configure the boot loader of the old and still running system.

6.1 Configuring GRUB for an Upgrade from SUSE Linux Enterprise 11

The GRUB configuration is stored in /boot/grub/menu.lst. Open this file and append a section as shown below. This will start the upgrade:

title SUSE Linux Enterprise Server 12 Update
    root (hd0,1)
    kernel /boot/linux.install <options>
    initrd /boot/initrd.install

For <options>, find below the parameters which need to be included. Make sure that the root value matches the one of your other sections so that it points to the same partition. Optionally, you can configure GRUB to boot a different default section next time. To do so, adjust the number according to your menu, starting from 0:

# grubonce 2
Using entry #2: SUSE Linux Enterprise Server 12 Installer

6.2 Configuring GRUB2 for an Upgrade from SUSE Linux Enterprise 12

GRUB2 generates the boot menu based from kernels and other operating systems found in the system. However, it still allows you to add a custom section.

First, locate the menu entry for your system in /boot/grub2/grub.cfg. It should look like following:

menuentry 'SLES 12-SP4'  --class sles --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-cd77493e-f701-4624-8074-21f0061e0727' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos2'  cd77493e-f701-4624-8074-21f0061e0727
        else
          search --no-floppy --fs-uuid --set=root cd77493e-f701-4624-8074-21f0061e0727
        fi
        echo    'Loading Linux 4.12.14-94.41-default ...'
        linux   /boot/vmlinuz-4.12.14-94.41-default root=UUID=cd77493e-f701-4624-8074-21f0061e0727  resume=/dev/vda1 splash=silent quiet showopts
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd-4.12.14-94.41-default
}

Next, open the file /etc/grub.d/40_custom and create a custom entry in it. It will only differ from the one above in the title, path to kernel, and initrd and kernel parameters (see the lines menuentry, linux and initrd):

menuentry 'SLES 15 Upgrade' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='hd0,msdos2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint='hd0,msdos2'  cd77493e-f701-4624-8074-21f0061e0727
        else
          search --no-floppy --fs-uuid --set=root cd77493e-f701-4624-8074-21f0061e0727
        fi
        echo    'Loading Linux 4.12.14-94.41-default ...'
        linux   /boot/linux.install  <options>
        echo    'Loading initial ramdisk ...'
        initrd  /boot/initrd.install
}

Keep the lines you do not need to change unchanged. They ensure that the boot loader loads the right modules to load your installation kernel.

For <options>, find the parameters which need to be included below.

After the menu entry is created, re-create the GRUB menu and, optionally, set the default boot option for the next reboot:

# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found theme: /boot/grub2/themes/SLE/theme.txt
Found linux image: /boot/vmlinuz-4.12.14-94.41-default
Found initrd image: /boot/initrd-4.12.14-94.41-default
done
# grub2-once --list
0 SLES 12-SP4
1 Advanced options for SLES 12-SP4>SLES 12-SP4, with Linux 4.12.14-94.41-default
2 Advanced options for SLES 12-SP4>SLES 12-SP4, with Linux 4.12.14-94.41-default (recovery mode)
3 SLES 15 Upgrade
4 halt
# grub2-once 3

6.3 Setting the Boot Loader Options

You can insert into the boot loader any of the options you can use when performing a regular installation or upgrade. Those include options to start a remote installation or upgrade (via SSH or VNC), enforcing a text mode instead of the graphical User Interface (UI), or starting AutoYaST. These options are not covered by this document. For more details, refer to the documentation of the respective product.

There are, however, options which need to be present:

  • install=<URL> points the installer to the URL that hosts your installation repository. Set it according to where you prepared the installation media.

  • upgrade=1 is necessary to start the upgrade workflow instead of performing a new installation.

  • autoyast=<URL> is necessary if you choose to not upgrade manually, but via AutoYaST. Set the location of the AutoYaST profile to drive the upgrade process.

  • autoupgrade=1 is necessary to perform a system upgrade with AutoYaST. In this case, skip the upgrade=1 option. Use it together with the autoyast option.

  • instsys=<URL> is necessary if you want to perform an upgrade via SMT or RMT.

For more information about AutoYaST and how to use it for a system installation or upgrade, refer to the Deployment Guide of the respective product.

7 Preparing the Installation System for an Upgrade via SMT

SMT or RMT provide the repository mirrored from SUSE Customer Center (SCC). However, this repository does not include the installation system, which is necessary to start the upgrade. Since the release of SUSE Linux Enterprise 15, it is possible to get the installation system from a different location than the installation repository.

The installation system is located on the installation media under the path /boot/<architecture>/root. It is also located in the directory /srv/tftpboot/<product>-<version>-<architecture>/boot/<architecture>/root, which is shipped with the online repositories of the respective product (package tftpboot-installation-<product>-<version>-<architecture>.noarch.rpm). To use the installation environment from a different path, copy this patch from the installation media to another location, where the installer can fetch it (the same limitations as for the installation repository apply).

The full kernel parameters for booting usually look as follows:

upgrade=1
instsys=tftp://<server-IP>/SLE-15-x86_64/boot/x86_64/root
install=http://<server-IP>/repo/SUSE/Products/SLE-Product-SLES/15/x86_64/product/

The paths above are based on the standard path on the SMT server and on the location of the installation system provided by the package from the repository. Adjust them if necessary.

8 Performing the Upgrade

After having set the boot loader, reboot your system. Choose the custom boot loader entry to start the upgrade process. The upgrade itself looks the same as if you booted the installation media and selected Upgrade from its boot menu.

When the system is upgraded, remove the newly created boot loader section if it is still present. Next, set your default boot loader section as needed.

Finally, remove the kernel and initrd you copied to your system and used for the upgrade.

9 Legal notice

Copyright ©2006-2024 SUSE LLC and contributors. All rights reserved.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or (at your option) version 1.3; with the Invariant Section being this copyright notice and license. A copy of the license version 1.2 is included in the section entitled GNU Free Documentation License.

SUSE, the SUSE logo and YaST are registered trademarks of SUSE LLC in the United States and other countries. For SUSE trademarks, see http://www.suse.com/company/legal/. Linux is a registered trademark of Linus Torvalds. All other names or trademarks mentioned in this document may be trademarks or registered trademarks of their respective owners.

Documents published as part of the SUSE Best Practices series have been contributed voluntarily by SUSE employees and third parties. They are meant to serve as examples of how particular actions can be performed. They have been compiled with utmost attention to detail. However, this does not guarantee complete accuracy. SUSE cannot verify that actions described in these documents do what is claimed or whether actions described have unintended consequences. SUSE LLC, its affiliates, the authors, and the translators may not be held liable for possible errors or the consequences thereof.

Below we draw your attention to the license under which the articles are published.