Linux uses GRUB to add kernel parameters

  
                

When the Linux kernel is booted, we can increase the Linux kernel boot parameters. It can be implemented by using GRUB. The following small series will introduce you to the method of using GRUB to add kernel boot parameters. Interested friends are not. Get bored to understand.

We can provide a variety of parameters for the Linux kernel when it starts. These parameters can customize the kernel's default behavior or notify the kernel about hardware configuration information. Kernel parameters should be passed to the kernel via the boot loader, such as GRUB or LILO, at kernel startup.

If you are using the GRUB boot loader and want to modify or add kernel parameters, you can edit the GRUB configuration file. The following is a way to add kernel startup parameters to GRUB's configuration files for a specific release.

Adding Kernel Boot Parameters on Debian or Ubuntu On Debian-based systems, if you want to add kernel parameters at system startup, you can edit the GRUB configuration template in the /etc/default/grub directory. Add kernel parameters in the format of “name=value” in the GRUB_CMDLINE_LINUX_DEFAULT variable.

$ sudo -e /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT=“. . . . . . Name=value”

Then run the following command to generate a GRUB configuration file.

$ sudo update-grub If you can't find the update-grub command, you can install it with the following command.

$ sudo apt-get install grub2-common Adding kernel startup parameters on Fedora On Fedora, you want to add kernel parameters at startup. You can edit the GRUB configuration template in the /etc/default/grub directory. . Add kernel parameters in the format of “name=value” in the GRUB_CMDLINE_LINUX variable.

$ sudo -e /etc/default/grub GRUB_CMDLINE_LINUX=“. . . . . . Name=value”

Then run the following command to generate the GRUB2 configuration file.

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg Adding Kernel Boot Parameters on CentOS On CentOS, you want to add kernel parameters at boot time, you can edit the GRUB configuration file /boot directly /grub/grub.conf. In the configuration file, find the entry that describes the Linux image that is used by default. The top-most string in the file “default=N” will indicate which entry is the default image.

Once you find the default image entry, in order to & ldquo; kernel /vmlinuz- & rdquo; at the beginning of the end of that period on additional kernel parameters. The format of the parameter is “name=value” .

The above is the introduction of Linux using GRUB to add kernel parameters. In the process of operation, you need to edit the GRUB configuration file. The method described in this article is applicable to Ubuntu and Debian systems.

Copyright © Windows knowledge All Rights Reserved