Linux kernel boot options (parameters) (rpm) Linux kernel boot options (parameters)

Linux kernel boot options (parameters)

In Linux, the kernel to pass parameters to control its behavior There are three ways:

1.build various configuration options of the kernel.

2. When the kernel starts to be passed to the kernel when the parameter is called the kernel or the like GRUB LILO boot program.

3. In the run-time kernel, file modification / proc or / sys directory.

Here I am simply talking about is a second way, kernel configuration parameter in the grub boot.

First, the parameters of which kernel have it? In linux source code, there is such a document:

https://www.kernel.org/doc/Documentation/kernel-parameters.txt 

It describes each parameter and its kernel of meaning.

Secondly, Kernel boot parameters separated by spaces, and is strictly case-sensitive (eg: mem and MEM is not the same).

Again, for the module-specific kernel parameters such wording is , [module name] [Parameter = XX]. , For example: igb.max_vfs = 7 kernel boot parameters this effect is equivalent to such dynamic loading:

module: modprobe igb max_vfs=7

In addition, Kernel is how to deal with these startup parameters of it?  Start parameters are usually of the form: name [= value_1] [, value_2] ... [, value_10]

"Name" is the key word, use it to identify the kernel should pass the value behind the "key" to whom, that is, how to deal with this value is passed to the treatment process or as environment variables or thrown "init". The number of values ​​is limited to 10, you can use the keyword again by using more than 10 parameters. First, kernel checks keywords are not 'root =', 'nfsroot =', 'nfsaddrs =', 'ro', 'rw', 'debug' or 'init', and then search for the keyword in the kernel array bootsetups registered handler associated with the handler if the relevant registered is found, call these functions and the value after the keyword is passed to the function as a parameter. For example, you set the parameter name when you start = a, b, c, d, core search bootsetups array, if found "name" is registered, call the "name" of setting function as name_setup (), and the a, b, c, d is transmitted to name_setup () execution. All types such as "name = value" parameter is not received if the functions provided above, will be interpreted as the system boot environment variables such as "TERM = vt100" parameter will be started after a start as environment variables . All is not set to receive a kernel function has not yet been set environment variables init process parameters will be left to deal with, such as "single".

Following is a brief summary of what I used to work in some of the kernel boot parameters.

Root disk-related startup parameters:

root # pointed out that the root file system startup, such as: root = / dev / sda1

ro # Specify root device during startup is read-only, they usually are by default assigned

rw # and ro Similarly, it is defined as read-write, write

rootfstype # root file system types, such as: rootfstype = ext4

Console and kernel log related startup parameters:

console #console equipment and options, such as: console = tty0 console = ttyS0

All debug information will debug #enable kernel debugging boot print on the console

quiet #disable all log messages the kernel log level is set to KERN_WARNING, starting only in very serious information

loglevel # Set the default console log level, such as: loglevel = 7 (0 to 7, respectively: KERN_EMERG, .., KERN_DEBUG)

Set time # add a time stamp before each kernel log information

Memory-related start-up parameters:

Mem # specified amount of memory used by kernel, mem = n [KMG]

hugepages # Set large page table page (4MB size) of the maximum number, hugepages = n

CPU-related start-up parameters:

mce # Enable the machine check exception feature.

nosmp #Run as a single-processor machine. without using the SMP (multiprocessor)

max_cpus # max_cpus = n, CPU number (even if the system has more than n the CPU) SMP system can be used up

Ramdisk related startup parameters:

initrd # ramdisk specified initialization position, the initrd = filename

noinitrd # do not use initrd configuration, even if the configuration parameters of the initrd

Related start initialization parameters:

init # startup program to be executed, the init = filename , the default value is / sbin / init

PCI-related startup parameters:

pci #pci related options, I often use the pci = assign_buses, also used the pci = nomsi

SELinux-related startup parameters:

Enforcing #SELinux enforcing switching state, enforcing = 0 indicates only dangerous but does not prevent access to the recording, enforcing = 1 is fully enable, the default value is 0

# selinux turned off at startup or SELinux, selinux = 0 represents off, selinux = 1 indicates turning selinux

In addition, the circuit is used to specify the device max_loop up to use.

In Redhat systems, there is often seen kernel boot parameters --rhgb, rhgb represents redhat graphics boot, is to see the pictures instead of text information displayed during startup, this information can also be used dmesg after starting see 
rhgb = RedHat the Graphical the Boot  - This IS A MOST with the GUI of the MODE the Booting Screen at The Information hidden the User sees the while at The Rotating Activity A icon spining and the Brief to the What at The Computer Information AS IS doing.

quiet = hides the majority of boot messages before rhgb starts. These are supposed to make the common user more comfortable. They get alarmed about seeing the kernel and initializing messages, so they hide them for their comfort.

References:

linux kernel documents

《Linux kernel in a nutshell》

In Linux, the kernel to pass parameters to control its behavior There are three ways:

1.build various configuration options of the kernel.

2. When the kernel starts to be passed to the kernel when the parameter is called the kernel or the like GRUB LILO boot program.

3. In the run-time kernel, file modification / proc or / sys directory.

Here I am simply talking about is a second way, kernel configuration parameter in the grub boot.

First, the parameters of which kernel have it? In linux source code, there is such a document:

https://www.kernel.org/doc/Documentation/kernel-parameters.txt 

It describes each parameter and its kernel of meaning.

Secondly, Kernel boot parameters separated by spaces, and is strictly case-sensitive (eg: mem and MEM is not the same).

Again, for the module-specific kernel parameters such wording is , [module name] [Parameter = XX]. , For example: igb.max_vfs = 7 kernel boot parameters this effect is equivalent to such dynamic loading:

module: modprobe igb max_vfs=7

In addition, Kernel is how to deal with these startup parameters of it?  Start parameters are usually of the form: name [= value_1] [, value_2] ... [, value_10]

"Name" is the key word, use it to identify the kernel should pass the value behind the "key" to whom, that is, how to deal with this value is passed to the treatment process or as environment variables or thrown "init". The number of values ​​is limited to 10, you can use the keyword again by using more than 10 parameters. First, kernel checks keywords are not 'root =', 'nfsroot =', 'nfsaddrs =', 'ro', 'rw', 'debug' or 'init', and then search for the keyword in the kernel array bootsetups registered handler associated with the handler if the relevant registered is found, call these functions and the value after the keyword is passed to the function as a parameter. For example, you set the parameter name when you start = a, b, c, d, core search bootsetups array, if found "name" is registered, call the "name" of setting function as name_setup (), and the a, b, c, d is transmitted to name_setup () execution. All types such as "name = value" parameter is not received if the functions provided above, will be interpreted as the system boot environment variables such as "TERM = vt100" parameter will be started after a start as environment variables . All is not set to receive a kernel function has not yet been set environment variables init process parameters will be left to deal with, such as "single".

Following is a brief summary of what I used to work in some of the kernel boot parameters.

Root disk-related startup parameters:

root # pointed out that the root file system startup, such as: root = / dev / sda1

ro # Specify root device during startup is read-only, they usually are by default assigned

rw # and ro Similarly, it is defined as read-write, write

rootfstype # root file system types, such as: rootfstype = ext4

Console and kernel log related startup parameters:

console #console equipment and options, such as: console = tty0 console = ttyS0

All debug information will debug #enable kernel debugging boot print on the console

quiet #disable all log messages the kernel log level is set to KERN_WARNING, starting only in very serious information

loglevel # Set the default console log level, such as: loglevel = 7 (0 to 7, respectively: KERN_EMERG, .., KERN_DEBUG)

Set time # add a time stamp before each kernel log information

Memory-related start-up parameters:

Mem # specified amount of memory used by kernel, mem = n [KMG]

hugepages # Set large page table page (4MB size) of the maximum number, hugepages = n

CPU-related start-up parameters:

mce # Enable the machine check exception feature.

nosmp #Run as a single-processor machine. without using the SMP (multiprocessor)

max_cpus # max_cpus = n, CPU number (even if the system has more than n the CPU) SMP system can be used up

Ramdisk related startup parameters:

initrd # ramdisk specified initialization position, the initrd = filename

noinitrd # do not use initrd configuration, even if the configuration parameters of the initrd

Related start initialization parameters:

init # startup program to be executed, the init = filename , the default value is / sbin / init

PCI-related startup parameters:

pci #pci related options, I often use the pci = assign_buses, also used the pci = nomsi

SELinux-related startup parameters:

Enforcing #SELinux enforcing switching state, enforcing = 0 indicates only dangerous but does not prevent access to the recording, enforcing = 1 is fully enable, the default value is 0

# selinux turned off at startup or SELinux, selinux = 0 represents off, selinux = 1 indicates turning selinux

In addition, the circuit is used to specify the device max_loop up to use.

In Redhat systems, there is often seen kernel boot parameters --rhgb, rhgb represents redhat graphics boot, is to see the pictures instead of text information displayed during startup, this information can also be used dmesg after starting see 
rhgb = RedHat the Graphical the Boot  - This IS A MOST with the GUI of the MODE the Booting Screen at The Information hidden the User sees the while at The Rotating Activity A icon spining and the Brief to the What at The Computer Information AS IS doing.

quiet = hides the majority of boot messages before rhgb starts. These are supposed to make the common user more comfortable. They get alarmed about seeing the kernel and initializing messages, so they hide them for their comfort.

References:

linux kernel documents

《Linux kernel in a nutshell》

Guess you like

Origin www.cnblogs.com/lh03061238/p/11128017.html