How to update Grub on RHEL or CentOS Linux

Hi,

What command I must type to update Grub config on RHEL or CentOS Linux system. I edited /etc/default/grub. On Debian Linux we can type to generate a grub2 config file. Here is How I do it on Debian and Ubuntu:

sudo update-grub

How do I update Grub on RHEL or CentOS Linux?

The update-grub is a stub for running grub-mkconfig -o /boot/grub/grub.cfg to generate a grub2 config file on Debian or Ubuntu. So use that command:

grub-mkconfig -o /boot/grub/grub.cfg

Updating Grub boot loader on an RHEL or CentOS Linux

  1. Open the terminal app
  2. Edit the /etc/default/grub as per your needs. For example:
    sudo vim /etc/default/grub
  3. Type the following command as root user:
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  4. Reboot your Linux box
    sudo reboot

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki