Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add Kernel parameters through grub in Linux system

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces how to add kernel parameters in Linux system through grub. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

When the Linux kernel starts, we can provide it with various parameters to customize the default behavior of the kernel. The kernel parameters should be passed to the kernel through the boot loader, such as GRUB or LILO. Here's a good tutorial to share with you about adding kernel parameters through grub on Linux.

If you are using the GRUB bootloader and want to modify or add kernel parameters, you can edit the GRUB configuration file. Here is how to add kernel startup parameters to the configuration file of GRUB for a specific distribution.

Add kernel startup parameters to 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 "name=value" in the GRUB_CMDLINE_LINUX_DEFAULT variable.

$sudo-e / etc/default/grubGRUB_CMDLINE_LINUX_DEFAULT= ". Name=value"

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

$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 add kernel startup parameters to Fedora on Fedora. 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 "name=value" in the GRUB_CMDLINE_LINUX variable.

$sudo-e / etc/default/grubGRUB_CMDLINE_LINUX= ". Name=value"

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

Sudo grub2-mkconfig-o / boot/grub2/grub.cfg add kernel startup parameters to CentOS on CentOS. To add kernel parameters at startup, you can directly edit the GRUB configuration file / boot/grub/grub.conf. In the configuration file, find the entry that describes the Linux image used by default. The string "default=N" in the top line of the file indicates which entry is the default image.

When the default image entry is found, add kernel parameters to the end of the paragraph that starts with "kernel / vmlinuz-". The format of parameter is "name=value".

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

On the Linux system how to add kernel parameters through grub to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 248

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report