[edit: problem solved at the bottom, although I'm still not sure why it happens this way]
Distro is Alma Linux 9.5 and kernel is 5.14.0-503.15.1.el9_5.x86_64. This is my first time making edits to the grub configuration so I can add two boot options: transparent_hugepage=never nvme_core.default_ps_max_latency_us=0.
I added them to /etc/defaults/grub:
GRUB_CMDLINE_LINUX="crashkernel=auto spectre_v2=retpoline rhgb quiet transparent_hugepage=never rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvme_core.default_ps_max_latency_us=0"
and then updated the config:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Adding boot menu entry for UEFI Firmware Settings ...
done
and double check the grub.cfg file, where I see these lines (looks good to me):
#
# The kernelopts variable in the grubenv file can be modified using the grubby tool or by
# executing the grub2-mkconfig tool. For the latter, the values of the GRUB_CMDLINE_LINUX
# and GRUB_CMDLINE_LINUX_DEFAULT options from /etc/default/grub file are used to set both
# the kernelopts variable in the grubenv file and the fallback kernelopts variable.
if [ -z "${kernelopts}" ]; then
set kernelopts="root=UUID=8ca827c0-7538-4f54-8acd-0a8306afb937 ro crashkernel=auto spectre_v2=retpoline rhgb quiet transparent_hugepage=never rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvme_core.default_ps_max_latency_us=0 "
fi
But after reboot, I see that transparent hugepages are still enabled (set to always):
# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
so I check the current boot command line and see that the new options were not passed:
# cat /proc/cmdline
BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.14.0-503.15.1.el9_5.x86_64 root=UUID=8ca827c0-7538-4f54-8acd-0a8306afb937 ro spectre_v2=retpoline rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M
The comment in the grub.cfg file above mentions that grub2-mkconfig will update the grubenv file, I assume it means /boot/grub2/grubenv, but it doesn't include my changes:
# cat /boot/grub2/grubenv
# GRUB Environment Block
kernelopts=root=UUID=8ca827c0-7538-4f54-8acd-0a8306afb937 ro crashkernel=auto spectre_v2=retpoline rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau
boot_success=1
boot_indeterminate=0
saved_entry=ee28a0c339ce4ee4b63e2afc3f9ce1ac-5.14.0-503.15.1.el9_5.x86_64
####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
So I tried adding the options with grub2-editenv (not sure if this is a good idea):
# grub2-editenv - set "kernelopts=root=UUID=8ca827c0-7538-4f54-8acd-0a8306afb937 ro crashkernel=auto spectre_v2=retpoline rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau transparent_hugepage=never nvme_core.default_ps_max_latency_us=0"
# grub2-editenv - list
kernelopts=root=UUID=8ca827c0-7538-4f54-8acd-0a8306afb937 ro crashkernel=auto spectre_v2=retpoline rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau transparent_hugepage=never nvme_core.default_ps_max_latency_us=0
boot_success=1
boot_indeterminate=0
saved_entry=ee28a0c339ce4ee4b63e2afc3f9ce1ac-5.14.0-503.15.1.el9_5.x86_64
But the contents of /proc/cmdline are the same as before.
The last thing I notice, but am not sure what to do about it, is the contents of the boot loader entry file is also missing the new options:
# cat /boot/loader/entries/ee28a0c339ce4ee4b63e2afc3f9ce1ac-5.14.0-503.15.1.el9_5.x86_64.conf
title AlmaLinux (5.14.0-503.15.1.el9_5.x86_64) 9.5 (Teal Serval)
version 5.14.0-503.15.1.el9_5.x86_64
linux /vmlinuz-5.14.0-503.15.1.el9_5.x86_64
initrd /initramfs-5.14.0-503.15.1.el9_5.x86_64.img $tuned_initrd
options root=UUID=8ca827c0-7538-4f54-8acd-0a8306afb937 ro spectre_v2=retpoline rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M $tuned_params
grub_users $grub_users
grub_arg --unrestricted
grub_class almalinux
So I'm out of ideas. Any advice on how to successfully update boot options or spotting a mistake I've made will be much appreciated.
Added later:
Well, I was so close. I updated the loader file with
# grubby --update-kernel=DEFAULT --args 'transparent_hugepage=never nvme_core.default_ps_max_latency_us=0'
rebooted, and everything seems to work. Still not sure why that final step was necessary though.
Asked by KevinJ
(11 rep)
Jan 31, 2025, 01:51 AM
Last activity: Jan 31, 2025, 04:24 AM
Last activity: Jan 31, 2025, 04:24 AM