{"id":1357,"date":"2024-04-27T19:34:12","date_gmt":"2024-04-27T16:34:12","guid":{"rendered":"https:\/\/geckich.site\/?p=1357"},"modified":"2024-06-15T20:11:18","modified_gmt":"2024-06-15T17:11:18","slug":"edit-kernel-boot-options-with-grubby","status":"publish","type":"post","link":"https:\/\/geckich.space\/?p=1357","title":{"rendered":"Edit kernel boot options with grubby"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Grubby is a useful tool to change boot options on RHEL-based systems with grub2 since it is not preferable to manually edit config files for grub2 in RHEL8\/9.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Messing with default kernel<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To list all kernel menu entries, enter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>grubby --info=ALL<\/strong>\nindex=0\nkernel=\"\/boot\/vmlinuz-4.18.0-372.9.1.el8.x86_64\"\nargs=\"ro crashkernel=auto resume=\/dev\/mapper\/rhel-swap rd.lvm.lv=rhel\/root rd.lvm.lv=rhel\/swap rhgb quiet $tuned_params zswap.enabled=1\"\nroot=\"\/dev\/mapper\/rhel-root\"\ninitrd=\"\/boot\/initramfs-4.18.0-372.9.1.el8.x86_64.img $tuned_initrd\"\ntitle=\"Red Hat Enterprise Linux (4.18.0-372.9.1.el8.x86_64) 8.6 (Ootpa)\"\nid=\"67db13ba8cdb420794ef3ee0a8313205-4.18.0-372.9.1.el8.x86_64\"\nindex=1\nkernel=\"\/boot\/vmlinuz-0-rescue-67db13ba8cdb420794ef3ee0a8313205\"\nargs=\"ro crashkernel=auto resume=\/dev\/mapper\/rhel-swap rd.lvm.lv=rhel\/root rd.lvm.lv=rhel\/swap rhgb quiet\"\nroot=\"\/dev\/mapper\/rhel-root\"\ninitrd=\"\/boot\/initramfs-0-rescue-67db13ba8cdb420794ef3ee0a8313205.img\"\ntitle=\"Red Hat Enterprise Linux (0-rescue-67db13ba8cdb420794ef3ee0a8313205) 8.6 (Ootpa)\"\nid=\"67db13ba8cdb420794ef3ee0a8313205-0-rescue\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To find out the file name of the default kernel, enter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>grubby --default-kernel<\/strong>\n\/boot\/vmlinuz-4.18.0-372.9.1.el8.x86_64<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To find out the index number of the default kernel, enter:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>grubby --default-index<\/strong>\n0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To change default kernel for booting:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>grubby --set-default \/boot\/vmlinuz-4.18.0-372.9.1.el8.x86_64<\/strong>\n<strong>grubby --set-default-index=<\/strong>0<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Messing with kernel boot arguments<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To add boot arguments to specific kernel:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>grubby --args=console=ttyS0,115200 --update-kernel \/boot\/vmlinuz-4.18.0-372.9.1.el8.x86_64<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To remove arguments:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>grubby --remove-args=\"rhgb quiet\" --update-kernel \/boot\/vmlinuz-4.18.0-372.9.1.el8.x86_64<\/strong><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Links:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/access.redhat.com\/documentation\/de-de\/red_hat_enterprise_linux\/8\/html\/managing_monitoring_and_updating_the_kernel\/assembly_making-persistent-changes-to-the-grub-boot-loader_managing-monitoring-and-updating-the-kernel\">https:\/\/access.redhat.com\/documentation\/de-de\/red_hat_enterprise_linux\/8\/html\/managing_monitoring_and_updating_the_kernel\/assembly_making-persistent-changes-to-the-grub-boot-loader_managing-monitoring-and-updating-the-kernel<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Grubby is a useful tool to change boot options on RHEL-based systems with grub2 since it is not preferable to manually edit config files for grub2 in RHEL8\/9. Messing with default kernel To list all kernel menu entries, enter: To find out the file name of the default kernel, enter: To find out the index &hellip; <a href=\"https:\/\/geckich.space\/?p=1357\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Edit kernel boot options with grubby<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10,7],"tags":[],"class_list":["post-1357","post","type-post","status-publish","format-standard","hentry","category-linux","category-sysadmin"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts\/1357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1357"}],"version-history":[{"count":3,"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts\/1357\/revisions"}],"predecessor-version":[{"id":1367,"href":"https:\/\/geckich.space\/index.php?rest_route=\/wp\/v2\/posts\/1357\/revisions\/1367"}],"wp:attachment":[{"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/geckich.space\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}