Configuring CentOS 7 Boot Order: Managing System Startup Preferences

To ensure your CentOS 7 system boots up with the desired configuration, you can manipulate the boot order settings using the following steps:

  1. Check the Current Boot Order: To determine the current boot order configuration, execute the command:
    grub2-editenv list

    The output will display the saved_entry value, which represents the default boot entry. For example:

    saved_entry=CentOS Linux 7 (Core), with Linux 3.10.0-229.4.2.el7.x86_64
  2. List Available Boot Menu Entries: To view all the menu entries available for selection during system boot, utilize the command:
    grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2

    The output will present a numbered list of the available boot entries. For instance:

    0 : CentOS Linux 7 (Core), with Linux 3.10.0-229.14.1.el7.x86_64
    1 : CentOS Linux 7 (Core), with Linux 3.10.0-229.4.2.el7.x86_64
    2 : CentOS Linux 7 (Core), with Linux 3.10.0-229.el7.x86_64
    3 : CentOS Linux 7 (Core), with Linux 0-rescue-605f01abef434fb98dd1309e774b72ba
  3. Set the Default Boot Entry: To change the default boot entry, utilize the command:
    grub2-set-default <entry_number>

    Replace <entry_number> with the desired boot entry’s corresponding number. For example, to set the default boot entry to “CentOS Linux 7 (Core), with Linux 3.10.0-229.14.1.el7.x86_64,” you would execute:

    grub2-set-default 0
  4. Verify the Changes: To confirm that the default boot entry has been updated successfully, run the command:
    grub2-editenv list

    The output should now show the updated saved_entry value. For instance:

    makefile
    saved_entry=0

By following these steps, you can effectively configure the boot order on your CentOS 7 system, ensuring it boots with the desired configuration at startup.

 1,492 total views,  12 views today

Comments

So empty here ... leave a comment!

Leave a Reply

Your email address will not be published. Required fields are marked *

Sidebar