Linux Tutorial
Linux File/Directory Management
Linux Packaging And Compression
Vim Text Editor
Linux Text Processing
Linux Software Installation
Linux User/User Group Management
Linux Permission Management
Linux Filesystem Management
Linux Advanced Filesystem Management
Linux System Management
Linux Backup and Recovery
Linux System Service Management
Linux System Log Management
Linux Boot Management
LAMP/LNMP Environment
SELinux Management
In some Linux distributions, especially those based on Red Hat or Fedora, the GRUB bootloader configuration file is located at /boot/grub/grub.conf
instead of /boot/grub/grub.cfg
. The process of editing and updating the configuration file remains similar. This tutorial will guide you through the process of modifying the /boot/grub/grub.conf
file in these systems.
Exploring grub.conf
file:
The grub.conf
file contains the bootloader settings, such as menu entries for different operating systems or kernel versions, timeout values, and default boot entry. Here's a sample grub.conf
file structure:
default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz title Linux Distro root (hd0,0) kernel /vmlinuz-linux root=/dev/sda1 ro quiet initrd /initramfs-linux.img title Another Linux Distro root (hd0,1) kernel /vmlinuz-linux root=/dev/sda2 ro quiet initrd /initramfs-linux.img
Modifying grub.conf
file:
To modify the grub.conf
file, open it with a text editor, such as nano
or vim
, with administrative privileges:
sudo nano /boot/grub/grub.conf
Some common settings you might want to modify are:
default
: Set the default boot entry (use a numeric value starting from 0).timeout
: Set the number of seconds the GRUB menu is displayed before the default entry is booted.title
: Specifies a menu entry. Follow this line with the root
, kernel
, and initrd
lines to configure the boot options for the entry.After making changes, save and exit the text editor.
Updating the grub.conf
file:
Unlike /boot/grub/grub.cfg
in some distributions, you generally do not need to run update-grub
or grub-mkconfig
when using /boot/grub/grub.conf
. The changes made to the grub.conf
file will take effect immediately upon the next system reboot.
However, in some cases, a symlink (symbolic link) is used to point /boot/grub/grub.conf
to another file (such as /boot/grub/grub.cfg
). If this is the case on your system, you may still need to run update-grub
or grub-mkconfig
to update the actual configuration file.
Backup before modifying:
Before making any changes to your grub.conf
file, it's always a good idea to make a backup. This allows you to restore the original configuration in case of any errors. To create a backup, run the following command:
sudo cp /boot/grub/grub.conf /boot/grub/grub.conf.bak
With this tutorial, you can now modify the GRUB settings on Linux systems that use /boot/grub/grub.conf
as the GRUB configuration file. This enables you to fine-tune your bootloader and manage multiple operating systems or kernel versions more effectively.
Editing grub.conf
in Linux:
grub.conf
file.sudo nano /boot/grub/grub.conf
Location of grub.conf
in /boot/grub/:
grub.conf
file in the /boot/grub/
directory.ls /boot/grub/grub.conf
Adding kernel parameters in grub.conf
:
grub.conf
to customize kernel behavior.kernel /vmlinuz-5.4.0-91-generic root=/dev/sda1 ro quiet splash
GRUB menu customization in grub.conf
:
title Ubuntu 20.04 root (hd0,1) kernel /vmlinuz-5.4.0-91-generic root=/dev/sda1 ro quiet splash
Backup and restore grub.conf
in Linux:
grub.conf
before making changes and restore if needed.cp /boot/grub/grub.conf /boot/grub/grub.conf.bak
Default entries in grub.conf
:
grub.conf
for the GRUB menu.default 0
GRUB timeout settings in grub.conf
:
grub.conf
.timeout 5
Troubleshooting errors in grub.conf
:
grub.conf
, such as syntax issues or incorrect configurations.grub2-mkconfig -o /boot/grub/grub.cfg