{"id":4868,"date":"2026-08-29T20:30:32","date_gmt":"2026-08-29T11:30:32","guid":{"rendered":"https:\/\/donguri3.net\/server-tech\/edit-grub-boot-order-linux-2\/"},"modified":"2026-08-29T20:30:33","modified_gmt":"2026-08-29T11:30:33","slug":"edit-grub-boot-order-linux","status":"publish","type":"post","link":"https:\/\/donguri3.net\/en\/server-tech\/linux-server-network\/edit-grub-boot-order-linux\/","title":{"rendered":"How to Change the Linux Boot Order by Editing the GRUB Bootloader"},"content":{"rendered":"<p>When using Linux, you may sometimes have multiple kernel versions installed. If you want to change the kernel used for the next boot, you can achieve this by editing the GRUB bootloader settings. Here, we will explain the method using &#8220;GRUB_DEFAULT=saved&#8221;.<\/p>\n<div>\n<hr \/>\n<\/div>\n<h2>Check the Current Kernels<\/h2>\n<p>Verify the list of kernels recognized by GRUB. Run the following command to display the available bootable kernel entries.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>sudo grep menuentry \/boot\/grub2\/grub.cfg  # Ubuntu\u3084CentOS\u3067\u4f7f\u7528<\/code><\/pre>\n<\/div>\n<p>Output example:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-plain\" data-lang=\"Plain Text\"><code>menuentry 'CentOS Linux (6...'  \nmenuentry 'CentOS Linux (5...'<\/code><\/pre>\n<\/div>\n<p>Make a note of the kernel names and order displayed here.<\/p>\n<div>\n<hr \/>\n<\/div>\n<h2>Change the Default GRUB Kernel<\/h2>\n<h3>1. Edit the GRUB Configuration File<\/h3>\n<p>Run the following command to open the GRUB configuration file.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>sudo nano \/etc\/default\/grub<\/code><\/pre>\n<\/div>\n<p>Set <code>\u201cGRUB_DEFAULT\u201d<\/code> as follows:<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>GRUB_DEFAULT=saved<\/code><\/pre>\n<\/div>\n<p>With this setting, the last selected kernel will automatically become the default for the next boot.<\/p>\n<p>However, you need to manually select the intended kernel for the first time only. To do this, run the following command.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>sudo grub2-set-default 'CentOS Linux (6...'<\/code><\/pre>\n<\/div>\n<h3>2. Update the Configuration<\/h3>\n<p>After making changes, run the following command to update the settings.<\/p>\n<p><span>RHEL\/CentOS-based systems:<\/span><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code><span style=\"background-color: inherit; color: inherit; font-family: inherit; font-size: var(--hcb--fz,14px);\">sudo grub2-mkconfig -o \/boot\/grub2\/grub.cfg<\/span><\/code><\/pre>\n<\/div>\n<div>\n<hr \/>\n<\/div>\n<h2>Verify That the Changes Took Effect<\/h2>\n<p>Reboot the system and confirm that the new kernel is running.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code><span style=\"background-color: inherit; color: inherit; font-family: inherit; font-size: var(--hcb--fz,14px);\">uname -r<\/span><\/code><\/pre>\n<\/div>\n<p>If the output contains your desired kernel version, it was successful.<\/p>\n<div>\n<hr \/>\n<\/div>\n<h2>Cautions<\/h2>\n<ul>\n<li>Incorrectly modifying GRUB settings may prevent your system from booting. Please make changes carefully.<\/li>\n<\/ul>\n<ul>\n<li>If you want to test multiple kernels while implementing this, it is recommended to keep a live kernel image saved for recovery.<\/li>\n<\/ul>\n<p>Editing GRUB allows you to customize your Linux system to fit your needs. Try adjusting the settings to match your environment.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When using Linux, you may sometimes have multiple kernel versions installed. If you want to change the kernel  [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1082,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/donguri3.net\/?p=244","footnotes":""},"categories":[1170],"tags":[105,352],"class_list":["post-4868","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-server-network","tag-linux","tag-ubuntu","en-US"],"_links":{"self":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4868","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/comments?post=4868"}],"version-history":[{"count":1,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4868\/revisions"}],"predecessor-version":[{"id":4871,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/posts\/4868\/revisions\/4871"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media\/1082"}],"wp:attachment":[{"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/media?parent=4868"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/categories?post=4868"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/donguri3.net\/wp-json\/wp\/v2\/tags?post=4868"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}