Kernel boot command-line parameter reference: Chapter 9 - Linux Kernel in a Nutshell
by Greg Kroah-HartmanThis excerpt is from Linux Kernel in a Nutshell.
Linux Kernel in a Nutshell covers the entire range of kernel tasks, starting with downloading the source and making sure that the kernel is in sync with the versions of the tools you need. In addition to configuration and installation steps, the book offers reference material and discussions of related topics such as control of kernel options at runtime.
There are three ways to pass options to the kernel and thus control its behavior:
When building the kernel. Most of this book discusses these options.
When starting the kernel. Usually, parameters are passed to the kernel when it is invoked from a boot file such as the GRUB or LILO configuration file.
At run-time, by writing to files in the
/procand/sysdirectories.
This chapter describes the second method of passing options. The
chapter breaks the boot-time options into different logical sections. A
number of architecture-specific and individual driver options are not
listed here. For a complete list of all known options, please see the file
Documentation/kernel-parameters.txt
in the kernel source tree and the individual architecture-specific
documentation files.
Not all of the listed options are always available. Most are associated with subsystems, and work only if the kernel is configured with those subsystems built in. They also depend on the presence of the hardware with which they are associated.
All of these parameters are case-sensitive.
In addition to the options listed in this chapter, parameters for
modules that are built in to the kernel can also be passed on the
command line. (Dynamically loaded modules, of course, are not in memory
when the kernel boots and therefore cannot be passed parameters at boot
time.) The syntax for passing parameters consisting of the module name
followed by a dot (.) and the
parameter.
For example, the usbcore module
accepts the parameter blinkenlights
to display flashing lights on all supported USB 2.0 hubs (don't ever say
the kernel developers don't have a sense of humor). To set this
parameter when loading the module dynamically, you would enter:
$ modprobe usbcore blinkenlights=1
But if the usbcore module is built
into the kernel, you achieve the same effect by invoking the kernel with
the following option:
usbcore.blinkenlights=1
Most module options for modules that are built into the kernel can
also be changed at run time by writing to files in the subdirectory
named after the module under the /sys/module/ directory. Thus, the blinkenlights option is represented by the
file /sys/module/usbcore/blinkenlights.
desired.
These options deal with the console or kernel log, where kernel debugging and error information are displayed.
Name
console — Output console device and options.
Synopsis
console=
Options
ttynUse the virtual console device
n.ttyS,n[,options]ttyUSB0[,options]Use the specified serial port. The options are of the form
bbbbpnf, wherebbbbis the baud rate,pis parity (n,o, ore),nis number of bits, andfis flow control (rfor RTS or omitted). Default is9600n8.See the file
Documentation/serial-console.txtfor more information on how to use a serial console. If you wish to have access to the kernel console information and do not have a serial port, see thenetconsolecommand-line option.uart,io,,addr[,options]uart,mmio,addr[,options]Start an early, polled-mode console on the 8250/16550 UART at the specified I/O port or MMIO address, switching to the specified ttyS device later. The options are the same as for ttyS shown earlier.
Name
netconsole — Output console data across the network.
Synopsis
netconsole=[src-port]@[src-ip]/[dev],[target-port]@ target-ip
/[target-mac-address]
Send kernel console data across the network using UDP packets to another machine. Options are:
src-portSource port for the UDP packets. The default value is 6665.
src-ipSource IP address of the interface to use.
devNetwork interface to use.
eth0is an example. The network interface can also run normal network traffic, because the netconsole data is not intrusive and should cause no slowdown in other network operations.target-portPort that the logging agent will use. The default value is 6666.
target-ipIP address for the logging agent.
target-mac-addressEthernet MAC address for the logging agent.
To listen to this data, the remote machine can use the syslogd program, or run the netcat program as follows:
netcat -u -l -pport
For more background on how to use this option, see the file
Documentation/networking/netconsole.txt.
Name
earlyprintk — Show early boot messages.
Synopsis
earlyprintk=[vga|serial][,ttyS
n[,baudrate]][,keep]
Show kernel log messages that precede the initialization of
the traditional console. These messages are typically never seen on
the console unless you use this option. Enabling this can be very
useful for tracking down hardware issues. Currently, the option can
specify either the VGA device or the serial port, but not both at
the same time. Also, only the ttyS0 or ttyS1 serial devices will work.
Interaction with the standard serial driver is not very good, and
the VGA output will eventually be overwritten by the real
console.
Append ,keep in order not to disable
the messages shown by this option when the real kernel console is
initialized and takes over the system.
Name
loglevel — Set the default console log level.
Synopsis
loglevel=
level
Specify the initial console log level. Any log messages with levels less than this (that is, of higher priority) will be printed to the console, whereas any messages with levels equal to or greater than this will not be displayed.
The console log level can also be changed by the klogd program, or by writing the specified
level to the /proc/sys/kernel/printk file.
The kernel log levels are:
0 (KERN_EMERG)The system is unusable.
1 (KERN_ALERT)Actions that must be taken care of immediately.
2 (KERN_CRIT)Critical conditions.
3 (KERN_ERR)Non-critical error conditions.
4 (KERN_WARNING)Warning conditions that should be taken care of.
5 (KERN_NOTICE)Normal, but significant events.
6 (KERN_INFO)Informational messages that require no action.
7 (KERN_DEBUG)Kernel debugging messages, output by the kernel if the developer enabled debugging at compile time.
Interrupts are a complex aspect of kernel behavior. The boot-time options deal mostly with the interface between the kernel and the hardware that handles interrupts, such as the Intel chip's Advanced Programmable Interrupt Controller (APIC).
Name
apic — Change the verbosity of the APIC subsystem when booting.
Synopsis
apic=[quiet(default)|verbose|debug]
The kernel handles memory in many different chunks and categories for different purposes. These options allow you to tweak the sizes and settings.
Name
mem — Force memory usage.
Synopsis
mem=
n[KMG]
Set the specific ammount of memory used by the kernel. When
used with the memmap= option,
physical address space collisions can be avoided. Without the
memmap= option, this option could
cause PCI devices to be placed at addresses that belong to unused
RAM. n specifies the amount of memory to
force and is measured in units of kilobytes (K), megabytes (M), or gigabytes (G).
These options change the way the kernel handles suspension for power-saving purposes.
Name
resume — Specify the partition device for the suspend image.
Synopsis
resume=
suspend_device
Tell the kernel which disk device contains the suspended
kernel image. If the data on the image is a valid kernel image
created by the software suspend subsystem, it will be loaded into
memory and the kernel will run it instead of continuing on with the
normal boot process. suspend_device is
the kernel device name, which might be different from what userspace
thinks the device name is, so be careful with this option.
These options control a wide range of behavior regarding timing, processor use in multi-processor systems, and other processor issues.
Name
cachesize — Override level 2 CPU cache size detection.
Synopsis
cachesize=
n
Sometimes CPU hardware bugs make them report the cache size
incorrectly. The kernel will attempt to work around and fix known
problems with most CPUs, but for some CPUs it is not possible to
determine what the correct size should be. This option provides an
override for these situations. n is
measured in units of bytes.
Name
lpj — Set the loops per jiffy.
Synopsis
lpg=
n
Specify the loops per jiffy that should be used by the kernel,
and thus have the kernel avoid the time-consuming boot-time
autodetection of this value. If n is
0, the value will be autodetected
as usual.
Warning
On SMP systems, this value will be set on all CPUs, which might cause problems if the different CPUs need different settings. An incorrect value will cause incorrect delays in the kernel, which can lead to unpredictable I/O errors and other breakage. Although unlikely, in the extreme case this might damage your hardware.
Name
nmi_watchdog — Set the NMI watchdog value.
Synopsis
nmi_watchdog=[0|1|2|3]
This is a debugging feature that allows the user to override the default
non-maskable interrupt (NMI) watchdog value. 0 specifies that no NMI watchdog should be
used. 1 specifies that the APIC
should be used if present. 2
specifies that the local APIC should be used if present. 3 means that the NMI watchdog is invalid,
so do not use it.
These options tweak the parameters used to make scheduling decisions. Most depend on an intimate understanding of how scheduling works in Linux.
Name
isolcpus — Isolate CPUs from the kernel scheduler.
Synopsis
isolcpus=
cpu_number[,
cpu_number,...]
Remove the specified CPUs, as defined by the
cpu_number values, from the general
kernel SMP balancing and scheduler algroithms. The only way to move
a process onto or off an "isolated" CPU is via the CPU affinity
syscalls. cpu_number begins at 0, so the maximum value is 1 less than the
number of CPUs on the system.
This option is the preferred way to isolate CPUs. The alternative, manually setting the CPU mask of all tasks in the system, can cause problems and suboptimal load balancer performance.
Name
migration_cost — Override the default scheduler migrations costs.
Synopsis
migration_cost=
level-1-useconds[level-2-useconds...]
This is a debugging option that overrides the default
scheduler migration cost matrix. The numbers specified by
level-N-useconds are indexed by the "CPU
domain distance" and are measured in microseconds.
An example of this option is migration_cost=1000,2000,3000 for a SMT
NUMA machine. It sets up an intra-core migration cost of 1 ms,
another inter-core migration cost of 2 ms, and another internode
migration cost of 3 ms.
Warning
Incorrect values can severely degrade scheduler performance, so this option should be used only for scheduler development, never for production environments.
Name
migration_debug — Verbosity of migration cost auto-detection.
Synopsis
migration_debug=[0|1|2]
Set the migration cost debug level. If 0 is specified, no extra messages will be
printed to the kernel log. This is the default value. 1 prints some information on how the
matrix is determined. 2 is very
verbose and is useful only if you use a serial console, as the
amount of information will overflow the kernel log buffer.
Name
migration_factor — Multiply or divide the migration costs.
Synopsis
migration_factor=
percent
Modify the default migration costs by the specified
percentage. This is a debugging option
that can be used to proportionally increase or decrease the
auto-detected migration costs for all entries of the migration
matrix. For example, migration_factor=150 increases migration
costs by 50%, so the scheduler will be less eager to migrate
cache-hot tasks. migration_factor=80 decreases migration
costs by 20%, thus making the scheduler will be more eager to
migrate tasks.
Warning
Incorrect values can severely degrade scheduler performance, so this option should be used only for scheduler development, never for production environments.
These options control how the storage of information in memory to imitate disks (Ramdisks) is done, including init ramdisks that hold information necessary at some stages of booting.
These options control how the kernel finds and handles the filesystem that contains the root filesystem.
Name
root — Specify the root filesystem to boot from.
Synopsis
root=
device
Tell the kernel which disk device the root filesystem image is
on. device can be specified in one of the
following ways:
nnnnA device number in hexadecimal represents the major and minor number of the device in the internal format that the kernel expects. This method is not recommended unless you have access to kernel internals.
/dev/nfsUse the NFS disk specified by the
nfsrootboot option as the root disk./dev/<diskname>Use the kernel disk name specified by
<diskname>as the root disk./dev/<diskname><decimal>Use the kernel disk name specified by
<diskname>and the partition specified by<decimal>as the root disk./dev/<diskname>p<decimal>Use the kernel disk name specified by
<diskname>and the partition specified by<decimal>as the root disk. This is the same as above, but is needed when<diskname>ends with a digit.
The init process is the first to be started by the kernel and is the ancestor of all other processes. These options control which program is run and how it is run.
The kexec subsystem is a specialized rebooting feature that allows a fast reboot and is usually combined with the kdump facility that enables the previous kernel's memory to be dumped to a safe place for analysis at a later time. These options modify the kexec subsystem's parameters.
Name
crashkernel — Reserve a portion of physical memory for kexec to use.
Synopsis
crashkernel=
n[KMG]@start[KMG]
The kexec subsystem likes to have a portion of physical memory
reserved for it. This option reserves that memory from the rest of
the kernel and will switch to use it if the kernel panics.
n specifies the amount of memory to
reserve, and start specifies the location
for this memory chunk. Both are measured in units of kilobytes
(K), megabytes (M), or gigabytes (G).
Read Copy Update (RCU) is a portion of the kernel that handles mutual exclusion for a variety of subsystems in a lock-less manner. There are a number of options that can be used to tune RCU in different ways:
These options control parameters that the Advanced Configuration and Power Interface (ACPI) subsystem can use.
Name
acpi — ACPI subsystem options.
Synopsis
acpi=[force|off|noirq|ht|strict]
This is the main option for the Advanced Configuration and Power Interface (ACPI). Values are:
forceForce ACPI to be enabled. Can be used to override the kernel configuration option that disabled it.
offDisable ACPI. Can be used to override the kernel configuration option that enabled it.
noirqPrevent ACPI from being used for IRQ routing.
htrun only enough of the ACPI layer to enable HyperThreading on processors that are capable of it.
strictMake the ACPI layer be less tolerant of platforms that are not fully compliant with the ACPI specification.
Name
acpi_sleep — ACPI sleep options.
Synopsis
acpi_sleep=[s3_bios],[s3_mode]
During S3 resume (which happens after the machine has been suspended to RAM), hardware needs to be reinitialized properly. For most devices this is simple, except for video cards, which are normally initialized by the BIOS. The kernel does not have enough information to restore the video device, because that information is in the BIOS and not accessable at all. This option lets the kernel try to use the ACPI subsystem to restore the video card in two different ways.
See the file Documentation/power/video.txt for more
information on this option and how to find the proper value for your
type of hardware.
Name
acpi_os_name — Fake the operating system name to ACPI.
Synopsis
acpi_os_name=
name
Tell the ACPI BIOS that the name of the running operating
system is name. This can be useful to
spoof the BIOS into thinking that Windows is running instead of
Linux, which can help solve some ACPI issues for older BIOSes. As an
example, use the string Microsoft
2001 to spoof the BIOS into thinking that Windows 2001 is
running on the machine.
These options specify different parameters the SCSI subsystem can
use. A number of SCSI driver-specific options are also available; please
see the different driver documentation files in the kernel directory
Documentation/scsi/ for
details.
These options specify different parameters the PCI subsystem can use.
Name
Synopsis
pci=option[,option...]
Each option can be one of the
following:
offDo not probe for the PCI bus.
biosForce the use of the PCI BIOS by not accessing the hardware directly. This means that the kernel should trust the BIOS, which is not the standard thing to do (as BIOSes are known to lie more than they are known to be valid.) Use this only if your machine has a non-standard PCI host bridge and the normal boot method is not working properly.
nobiosDo not use the PCI BIOS, but access the hardware directly instead. This is the default method of probing for PCI devices in all kernels after 2.6.13.
conf1Force use of PCI Configuration Mechanism 1 (a way to access PCI memory on i386 machines.)
conf2Force use of PCI Configuration Mechanism 2 (a way to access PCI memory on i386 machines.)
nommconfDisable use of the ACPI MMCONFIG table for PCI configuration.
nomsiIf the PCI_MSI kernel config parameter is enabled, this kernel boot option can be used to disable the use of MSI interrupts system-wide.
nosortDo not sort PCI devices according to order given by the PCI BIOS. This sorting is done to get a device order compatible with much older kernel versions.
biosirqUse PCI BIOS calls to get the interrupt routing table. These calls are known to be buggy on several machines and hang these machine when used, but on other machines they are the only way to get the interrupt routing table. Try this option if the kernel is unable to allocate IRQs or discover secondary PCI buses on your motherboard.
romAssign address space to expansion ROMs. Use this with caution as certain devices share address decoders between ROMs and other resources.
irqmask=0xnnnnSet a bit mask of IRQs allowed to be assigned automatically to PCI devices. You can make the kernel exclude IRQs of your ISA cards this way.
pirqaddr=0xnSpecify the physical address of the PIRQ table (normally generated by the BIOS) if it is outside the F0000-100000 (hexadecimal) range.
lastbus=nScan all buses through bus
n. Can be useful if the kernel is unable to find your secondary buses and you want to tell it explicitly which ones they are.assign-bussesAlways use your own PCI bus numbers, overriding whatever the firmware may have done.
usepirqmaskHonor the possible IRQ mask stored in the BIOS $PIR table. This is needed on some systems with broken BIOSes, notably some HP Pavilion N5400 and Omnibook XE3 notebooks. This will have no effect if ACPI IRQ routing is enabled.
noacpiDo not use ACPI for IRQ routing or for PCI scanning.
routeirqDo IRQ routing for all PCI devices. This is normally done in
pci_enable_device(), so this option is a temporary workaround for broken drivers that don't call it.firmwareDo not re-enumerate the bus, but instead just use the configuration from the bootloader. This is currently used on IXP2000 systems where the bus has to be configured a certain way for adjunct CPUs.
These options change some fundamental aspects of SELinux startup.
Name
checkreqprot — Set the initial checkreqprot flag value.
Synopsis
checkreqprot=[0|1]
Set the initial checkreqprot flag value. 0 means that the check protection will be
applied by the kernel and will include any implied execute
protection. 1 means that the
check protection is requested by the application. The default value
is set by a kernel configuration option.
The value can be changed at runtime via the /selinux/checkreqprot file.
Name
enforcing — Set the initial enforcing status.
Synopsis
enforcing=[0|1]
Specify whether SELinux enforces its rules upon boot. 0 means that SELinux will just log policy
violations but wil not deny access to anything. 1 means that the enforcement will be fully
enabled with denials as well as logging. The default value is
0.
The value can be changed at runtime via the /selinux/enforce file.
These options control low-level aspects of the networking subsystem.
Name
netdev — Set various network device parameters.
Synopsis
netdev=[irq],[io],[mem_start],[mem_end],[name]
Specify network device parameters, which are specific to the driver used by the network device. Some drivers' source files document the applicable options. This option does not usually apply to PCI, USB, or other plug-and-play network devices. It is intented for use only on devices that can not discover their own resource assignments.
These options control Network File System startup.
Name
lockd.nlm_grace_period — Assign a grace period to the lock manager.
Synopsis
lockd.nlm_grace_period=
n
Name
nfsroot — Specifies the NFS root filesystem.
Synopsis
nfsroot=[server-ip
:]root-dir[,nfs-options]
Set the NFS root filesystem for diskless boxes, to enable them
to boot properly over NFS. If this parameter is not set, the value
/tftpboot/
client_ip_address will be used as the
root filesystem with the default NFS options.
server-ipIP address of the NFS server to connect to.
root-dirDirectory on the NFS server to mount as root. If there is a
%stoken in this string, it will be replaced with the ASCII representation of the client's IP address.nfs-optionsThe standard NFS options, such as
ro, separated by commas.
These options specify different parameters, depending on the hardware present in the system.
Name
lp — Parallel port and its mode.
Synopsis
lp=[0|port[,port...]|reset|auto]
Specify the parallel port to use. The lp=port1,port2... format associates a
sequence of parallel ports to devices, starting with lp0. An example is lp=none,parport0, which would suppress
configuration of the lp0 device
and cause the lp1 device to use
the first parallel port.
lp=0 disables the printer
driver.
lp=reset causes the
attached printers to be reset. This option can be combined with the
port specifications.
lp=auto causes the kernel
to examine the device ID from each port to determine whether a IEEE
1284-compatible printer is attached. If so, the kernel will manage
that printer.
Name
parport — Specify the parallel port parameters.
Synopsis
parport=[setting[,setting...]
Specify specific settings for parallel port drivers. Parallel
ports are assigned in the order they are specified on the command
line, starting with parport0.
auto forces the driver to
use any IRQ/DMA settings detected (the default is to ignore detected
IRQ/DMA settings because of possible conflicts). You can also
specify the base address, IRQ, and DMA settings in the format
0x
nnnn[,irq[,dma]].
irq and DMA
can be numbers, auto to use
detected settings on that particular port, or nofifo to avoid using a FIFO even if it is
detected.
These options override default kernel behavior to fix problems with certain chips.
These options should always be available, and don't depend on any specific subsystem or hardware being present in the system in order to work properly.
Name
elevator — Set the default I/O scheduler elevator.
Synopsis
elevator=[anticipatory|cfq|deadline|noop]
Name
profile — Control the kernel profiling.
Synopsis
profile=[schedule
,][number]
This option affects how the kernel profiler is calculated. If schedule is specified, the schedule points
are affected by the value set in number.
If schedule is not specified,
number is the step size as a power of two
for statistical time-based profiling in the kernel.
The most common use of this option is profile=2
[14] The majority of this chapter is based on the in-kernel documentation for the different kernel boot command line reference options, which were written by the kernel developers and released under the GPL.
If you enjoyed this excerpt, buy a copy of Linux Kernel in a Nutshell
