In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what kernel boot parameters does the Linux operating system have". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what kernel boot parameters does the Linux operating system have"?
The Linux kernel can receive certain command-line options or boot-time parameters at startup. When the kernel cannot recognize some hardware and cannot set hardware parameters, or in order to prevent the kernel from changing the values of some parameters, these parameters can be manually passed to the kernel in this way.
You can't pass parameters or options to the kernel without using the boot manager, such as booting directly from BIOS or booting kernel files directly from the device with "cp zImage / dev/fd0"-- which may be one of the benefits of using boot managers such as LILO.
The kernel parameters of Linux are a list of strings separated by spaces, usually in the following form:
The code is as follows:
Name [= value_1] [, value_2]... [, value_10]
"name" is a keyword that the kernel uses to identify to whom the value after the "keyword" should be passed, that is, how to handle the value, whether it is passed to the processing routine, as an environment variable, or thrown to "init". The number of values is limited to 10, and you can use more than 10 parameters by using the keyword again.
First of all, the kernel checks whether the keyword is `root='', `nfsroot='', `nfsaddrs='', `ro'', `rw'', `debug'' or `init'',. Then the kernel searches the bootsetups array for the registered processing functions associated with the keyword. If the relevant registered processing functions are found, these functions are called and the values after the keywords are passed as parameters to these functions. For example, when you set the parameter name=a,b,c,d at startup, the kernel searches the bootsetups array, and if you find that "name" has been registered, call the setting function of "name" such as name_setup (), and pass the a _ mai _ b _ c _ (d) to name_setup () for execution. All types such as "name=value" parameters, if not received by the setting function described above, will be interpreted as environment variables after system startup, such as "TERM=vt100" will be used as a startup parameter.
All parameters that are not received by the kernel setting function and are not set as environment variables are left to the init process, such as "single".
[commonly used device-independent startup parameters]
1 、 init=...
Sets the name of the initialization process executed by the kernel. If this item is not set, the kernel will try / etc/init sequentially.
/ bin/init,/sbin/init, / bin/sh, if nothing is found, the kernel will throw an error of kernel panic:.
2 、 nfsaddrs=...
Set the startup address of NFS when booting from the network, which has been given in the form of a string.
3 、 nfsroot=...
Set the NFS root name when the network starts, if the string is not "/", "." To begin, it points to "/ tftp-boot" by default.
The above 2 and 3 are very useful in non-disk stations.
4 、 no387
This option is only available when CONFIG_BUGi386 is defined. Some i387 coprocessor chips have BUG when using 32-bit protected mode, such as floating-point operations. Using this parameter allows the kernel to ignore the 387 coprocessor.
5 、 no-hlt
This option can only be used when CONFIG_BUGi386 is defined. Some early i486DX-100 chips have problems with the "hlt" instruction and cannot reliably return to the operating system after executing the instruction. Using this option, you can let the Linux system not suspend CPU when the CPU is idle.
6 、 root=...
This parameter tells the kernel which device to use as the root file system when booting. For example, you can specify the root file as hda8:root=/dev/hda8.
7. Ro and rw
The ro parameter tells the kernel to load the root file system read-only for file system integrity checks, such as running the fsck;rw parameter to tell the kernel to load the root file system read-write, which is the default.
8 、 reserve=...
Keep the port number. Format: reserve=iobase,extent [, iobase,extent]. It is used to protect the Icano port of a certain area from being automatically detected by the device driver. On some machines, autoprobe will fail, or this parameter will be used when the device detects an error or does not want the kernel to initialize the device; for example: reserve=0x300,32device=0x300, all device drivers except device=0x300 do not detect the 0x300-0x31f range of Imax O ports.
9 、 mem=...
Limit the amount of memory used by the kernel. Early BIOS was designed to only recognize memory below 64m. If you have more than 64m of memory, you can specify that if you specify more than the actual amount of memory installed, the system will crash sooner or later. For example, mem=0x1000000 means 16m of memory, and if it is mem=0x6000000, it is 96m of memory. Note: many models use part of the memory as a mapping of BIOS, so you must reserve space when you specify the memory size. You can also use mem=nopentium to close the 4m page table on pentium or newer CPU, which should be stated during kernel configuration.
10 、 panic=N
By default, the kernel crashes-kernel panic goes down without restarting. You can set how many seconds to restart the machine after downtime, or you can set it in the / proc/sys/kernel/panic file.
11. Reboot= [warm | cold] [, [bios | hard]]
This option is available only if CONFIG_BUGi386 is defined. The kernel restart of 2.0.22 defaults to cool reboot,warm reboot faster, and the setting of bios can be inherited by using "reboot=bios".
12. Nosmp and maxcpus=N
This option is available only if _ _ SMP__, is defined. Can be used to disable multiple CPU or to indicate the maximum number of CPU supported.
[startup-time parameters for kernel development and debugging]
These parameters are mainly used for kernel development and debugging, and if you don't do similar work, you can simply skip this section.
1 、 debug
Linux has many log levels (see Linux/kernel.h for details). In general, the log daemon klogd only writes logs higher than DEBUG to disk; if you use this option, klogd also writes kernel DEBUG information to the log.
2 、 profile=N
When doing kernel development, if you think about it clearly
To know where the kernel consumes how many CPU clock cycles, you can use the core analysis function to set the variable prof_shift to a non-zero value, which can be achieved in two ways: one is specified at compile time, the other is specified through "profile="; he gives a minimum unit-- the clock cycle. When the system executes kernel code, the value of profile [address >; prof_shift] accumulates, and you can also use the
/ proc/profile gets some information about it.
3 、 swap=N1,N2,N3,N4,N5,N6,N7,N8
Set the eight parameters of the kernel exchange algorithm:
Max_page_age, page_advance, page_decline, page_initial_age
Age_cluster_fract, age_cluster_min, pageout_weight,bufferout_weight .
4 、 buff=N1,N2,N3,N4,N5,N6
Set six kernel buffer memory management parameters: max_buff_age, buff_advance,buff_decline,buff_initial_age, bufferout_weight, buffermem_grace.
Use the parameters of RAMDISK (only if the kernel configures and compiles CONFIG_BLK_DEV_RAM). Generally speaking, using ramdisk is not a good thing, and the system itself will use the available memory more efficiently; however, when starting or making a boot disk, using ramdisk can easily load images on devices such as floppy disks (especially during installation and startup), because before you actually use physical disks, you have to load some necessary modules, such as file system modules, scsi drivers, etc. In the early days, ramdisk (such as the core of 1.3.48) was statically allocated, and the size of the ramdisk had to be specified as ramdisk=N; now ramdisk can be increased dynamically. There are four parameters, two Boolean and two shaping.
1 、 load_ramdisk=N
If Number1, load ramdisk;. If Numb0, ramdisk; is not loaded. The default value is 0.
2 、 prompt_ramdisk=N
Numb1, prompt for floppy disk; Numb0, do not prompt for floppy disk; default is 1.
3. Ramdisk_size=N or ramdisk=N
Set the maximum value of ramdisk to N KB and default to 4096KB.
4 、 ramdisk_start=N
Set the starting block number of ramdisk to N, which is required when ramdisk has a kernel image file.
5 、 noinitrd
(only if the kernel is configured with the options CONFIG_BLK_DEV_RAM and CONFIG_BLK_DEV_INITRD) the kernel now supports initrd. The boot process first loads the kernel and an initialized ramdisk, and then the kernel converts the initrd into a normal ramdisk, the root file system device in read-write mode. Then Linuxrc executes, then mounts the real root file system, then ramdisk is unmounted, and finally executes the boot sequence, such as / sbin/init.
The option noinitrd tells the kernel not to perform the above steps, even if the kernel compiles initrd, but writes initrd data to / dev/initrd, but this is an one-time device.
Thank you for reading, the above is the content of "what kernel boot parameters does the Linux operating system have". After the study of this article, I believe you have a deeper understanding of the kernel boot parameters of the Linux operating system, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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: 0
*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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.