0

GRUB is the default boot loader for all Enterprise Linux. It load all the Linux Distro as well as other operating system with ease. It provides a menu which shows all the the operating system in one place. The GRUB has advanced feature as well as some basic features that makes it effective on all enterprise grade Linux. This guide provides to change the default GRUB Entries as well as to change the timeout according to the user requirements on respective Enterprise Linux that supports the GRUB.

How to Change Default GRUB2 Entries

Step-1 (Login to the root user)
[gopal@techbrown ~]$ su -
Password:
Step-2 (List all the GRUB2 boot entries)
[root@techbrown ~]# grep "^menuentry" /boot/grub2/grub.cfg | cut -d "'" -f2
Sample Output
CentOS Linux 7 (Core), with Linux 3.10.0-229.el7.x86_64
CentOS Linux 7 (Core), with Linux 0-rescue-7e890c03ebb940a9a67163adaef14894
Windows 10 (loader) (on /dev/sda1)
menuentry "Windows 10 (loader) (on /dev/sda1)"
Step-3 (Change the default boot entry)
[root@techbrown ~]# grub2-set-default 3

Note you can change the 3 according to your choice of entries this is the default entries to boot.

Step-4 (Check whether it is added to the default entry)
[root@techbrown ~]# grub2-editenv list
Sample Output
saved_entry=3
Step-5 (Save all the changes in GRUB2)
[root@techbrown ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Sample output
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-7e890c03ebb940a9a67163adaef14894
Found initrd image: /boot/initramfs-0-rescue-7e890c03ebb940a9a67163adaef14894.img
Found Windows 10 (loader) on /dev/sda1
done

How to add Windows 10 boot entries in GRUB

You need to follow the tutorial for that purpose.

How to Change Default GRUB Menu Timeout.

Step-1 (Login to the root user)
[gopal@techbrown ~]$ su -
Password:
Step-2 (Change GRUB menu time out)
[root@techbrown ~]# vi /etc/default/grub
Sample Output
GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

Note: You can make change “GRUB_TIMEOUT=ANY-POSITIVE-NUMBER” to it for making change the timeout period according to your choice.

Step-5 (Save all the changes in GRUB)
[root@techbrown ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Sample Output
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-229.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-229.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-7e890c03ebb940a9a67163adaef14894
Found initrd image: /boot/initramfs-0-rescue-7e890c03ebb940a9a67163adaef14894.img
Found Windows 10 (loader) on /dev/sda1
done

That’s all for now.

How to Install Sophos Anti Virus on CentOS / RHEL

Previous article

How to Fix Installation Failed at Boot /dev/root Does Not Exist on CentOS / RHEL

Next article

You may also like

Comments

Leave a reply

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

More in Linux