How to add kernel parameters through GRUB in Linux

Source: Internet
Author: User

We can provide various parameters for Linux kernel startup. These parameters can customize the default kernel behavior or notify the kernel about hardware configuration. Kernel parameters should be passed to the kernel through a boot loader such as GRUB or LILO at kernel startup.

In this tutorial, I will describe how to add kernel parameters through GRUB on linux.

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 describes how to add kernel startup parameters to the GRUB configuration file for a specific release.

Add the kernel startup parameters to Debian-based systems On Debian or Ubuntu. If you want to add the kernel parameters when the system is started, you can edit the grub configuration Template under the/etc/default/GRUB directory. Add the 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"

Run the following command to generate a GRUB configuration file.

$ Sudo update-grub if you cannot find the update-grub command, you can install it using the following command.

$ Sudo apt-get install grub2-common add kernel startup parameters on Fedora to add kernel parameters at startup, you can edit the grub configuration Template under the/etc/default/GRUB directory. Add Kernel Parameters in the format of "name = value" in GRUB_CMDLINE_LINUX variables.

$ 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 adds kernel startup parameters to CentOS. To add kernel parameters at startup, you can directly edit the GRUB configuration file/boot/grub. conf. In the configuration file, find the entry that describes the default Linux image. The "default = N" character string in the top line of the file indicates which entry is the default image.

After finding the default image entry, append the kernel parameters at the end of the section starting with "kernel/vmlinuz. The parameter format is "name = value ".

Grub and mbr during Linux boot

Installation and Use of grub

Grub Bootstrap Configuration File Analysis

CentOS 6.4 grub and password

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.