About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Troubleshooting
Problem
Custom Linux Kernel boot configuration
Resolving The Problem
GRUB and GRUB2 Kernel Selection
Legacy GRUB (RHEL7 and previous, CentOS6 and previous)
- Temporary kernel selection
- Connect to the server’s IPMI-KVM console.
- Reboot the system. The GRUB bootloader starts.
- Move the highlight/selection up or down with your keyboard’s up and down keys before the timeout. The default is 5 seconds.
- Press enter for the kernel that you wish to boot.
- Connect to the server’s IPMI-KVM console.
- Changing the default boot kernel
In every Linux distribution, the newest kernel is automatically configured by the package manager scripts as the default boot option. In cases where you want to use an older kernel or a custom kernel that is not installed by the package manager, complete the following steps:
- Log in to the system using SSH. Alternatively, you can log in to the system using IPMI-KVM.
- From a shell session, open the /boot/grub/grub.cfg file with the text editor (vi, vim, nano, emacs) of your choice.
- Change the “default” parameter to the corresponding entry. In the following screenshot, 0 defines the “/vmlinuz-2.6.32-696.18.7.el6.x86_64” entry. Setting the default to 1 would define “/vmlinuz-2.6.32-696.el6..x86_64” as the default kernel.
- From your text editor, save and exit. The next time the system boots or is rebooted, it will boot to the newly defined default kernel.
- Log in to the system using SSH. Alternatively, you can log in to the system using IPMI-KVM.
GRUB 2 (CentOS7, Debian, Ubuntu Server 14.x and 16.x)
GRUB2 uses a less straightforward configuration method. Whereas Legacy GRUB will read from a single configuration file, GRUB2 utilizes a configuration file that is generated by built-in utilities. It is not expected to be read or edited directly by users or administrators. The true configuration file is created dynamically with variables and prerogatives that are configured in the human-readable /etc/default/grub file instead. Complete the following steps:
- Determine the running kernel:
[root@testhost ~]# uname -r
3.10.0-514.16.1.el7.x86_64 - Change the GRUB_DEFAULT variable to ‘saved’ in /etc/default/grub with your preferred text editor:
[root@testhost~]# cp /etc/default/grub /etc/default/grub.bak
[root@testhost~]# vim /etc/default/grub
GRUB_DEFAULT=saved - Back up the existing configuration file in case it is needed again. Sew the following command example:
[root@testhost ~]# cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg.bak - Issue a rebuild command for GRUB2:
[root@testhost ~]# grub2-mkconfig -o /boot/grub2/grub.cfg - Check and confirm all installed kernels and obtain the name of the one that you want to use:
[root@testhost~]# grep "^menuentry" /boot/grub2/grub.cfg | cut -d "';" -f2
CentOS Linux (3.10.0-514.16.1.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-327.36.3.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-327.22.2.el7.x86_64) 7 (Core) - Run the following command assuming 3.10.0-327.36.3 is desired:
[root@testhost ~]# grub2-set-default "CentOS Linux (3.10.0-327.36.3.el7.x86_64) 7 (Core)
Note: In the case of Ubuntu, prepend ‘Advanced options for Ubuntu’ (if listed) to the kernel name in this command, as sub-menu dependencies will break without it. - Verify the changes using the following example command:
[root@testhost ~]# grub2-editenv list
saved_entry=CentOS Linux (3.10.0-327.36.3.el7.x86_64) 7 (Core)
Document Location
Worldwide
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSCL81","label":"Network Tools"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"","label":""}}]
Was this topic helpful?
Document Information
More support for:
Network Tools
Software version:
All Versions
Document number:
963398
Modified date:
01 August 2019
UID
ibm1KB0010937
Manage My Notification Subscriptions