]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man7/bootparam.7
04ed231914a1b160ff0a9b903f901d57ea9bd4ee
[thirdparty/man-pages.git] / man7 / bootparam.7
1 .\" Copyright (c) 1995,1997 Paul Gortmaker and Andries Brouwer
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .\" This man page written 950814 by aeb, based on Paul Gortmaker's HOWTO
6 .\" (dated v1.0.1, 15/08/95).
7 .\" Major update, aeb, 970114.
8 .\"
9 .TH BOOTPARAM 7 2021-03-22 "Linux" "Linux Programmer's Manual"
10 .SH NAME
11 bootparam \- introduction to boot time parameters of the Linux kernel
12 .SH DESCRIPTION
13 The Linux kernel accepts certain 'command-line options' or 'boot time
14 parameters' at the moment it is started.
15 In general, this is used to
16 supply the kernel with information about hardware parameters that
17 the kernel would not be able to determine on its own, or to avoid/override
18 the values that the kernel would otherwise detect.
19 .PP
20 When the kernel is booted directly by the BIOS,
21 you have no opportunity to specify any parameters.
22 So, in order to take advantage of this possibility you have to
23 use a boot loader that is able to pass parameters, such as GRUB.
24 .SS The argument list
25 The kernel command line is parsed into a list of strings
26 (boot arguments) separated by spaces.
27 Most of the boot arguments have the form:
28 .PP
29 .in +4n
30 .EX
31 name[=value_1][,value_2]...[,value_10]
32 .EE
33 .in
34 .PP
35 where 'name' is a unique keyword that is used to identify what part of
36 the kernel the associated values (if any) are to be given to.
37 Note the limit of 10 is real, as the present code handles only 10 comma
38 separated parameters per keyword.
39 (However, you can reuse the same
40 keyword with up to an additional 10 parameters in unusually
41 complicated situations, assuming the setup function supports it.)
42 .PP
43 Most of the sorting is coded in the kernel source file
44 .IR init/main.c .
45 First, the kernel
46 checks to see if the argument is any of the special arguments 'root=',
47 \&'nfsroot=', 'nfsaddrs=', 'ro', 'rw', 'debug', or 'init'.
48 The meaning of these special arguments is described below.
49 .PP
50 Then it walks a list of setup functions
51 to see if the specified argument string (such as 'foo') has
52 been associated with a setup function ('foo_setup()') for a particular
53 device or part of the kernel.
54 If you passed the kernel the line
55 foo=3,4,5,6 then the kernel would search the bootsetups array to see
56 if 'foo' was registered.
57 If it was, then it would call the setup
58 function associated with 'foo' (foo_setup()) and hand it the arguments
59 3, 4, 5, and 6 as given on the kernel command line.
60 .PP
61 Anything of the form 'foo=bar' that is not accepted as a setup function
62 as described above is then interpreted as an environment variable to
63 be set.
64 A (useless?) example would be to use 'TERM=vt100' as a boot
65 argument.
66 .PP
67 Any remaining arguments that were not picked up by the kernel and were
68 not interpreted as environment variables are then passed onto PID 1,
69 which is usually the
70 .BR init (1)
71 program.
72 The most common argument that
73 is passed to the
74 .I init
75 process is the word 'single' which instructs it
76 to boot the computer in single user mode, and not launch all the usual
77 daemons.
78 Check the manual page for the version of
79 .BR init (1)
80 installed on
81 your system to see what arguments it accepts.
82 .SS General non-device-specific boot arguments
83 .TP
84 .B "'init=...'"
85 This sets the initial command to be executed by the kernel.
86 If this is not set, or cannot be found, the kernel will try
87 .IR /sbin/init ,
88 then
89 .IR /etc/init ,
90 then
91 .IR /bin/init ,
92 then
93 .I /bin/sh
94 and panic if all of this fails.
95 .TP
96 .B "'nfsaddrs=...'"
97 This sets the NFS boot address to the given string.
98 This boot address is used in case of a net boot.
99 .TP
100 .B "'nfsroot=...'"
101 This sets the NFS root name to the given string.
102 If this string
103 does not begin with '/' or ',' or a digit, then it is prefixed by
104 \&'/tftpboot/'.
105 This root name is used in case of a net boot.
106 .TP
107 .B "'root=...'"
108 This argument tells the kernel what device is to be used as the root
109 filesystem while booting.
110 The default of this setting is determined
111 at compile time, and usually is the value of the root device of the
112 system that the kernel was built on.
113 To override this value, and
114 select the second floppy drive as the root device, one would
115 use 'root=/dev/fd1'.
116 .IP
117 The root device can be specified symbolically or numerically.
118 A symbolic specification has the form
119 .IR /dev/XXYN ,
120 where XX designates
121 the device type (e.g., 'hd' for ST-506 compatible hard disk, with Y in
122 \&'a'\(en'd'; 'sd' for SCSI compatible disk, with Y in 'a'\(en'e'),
123 Y the driver letter or
124 number, and N the number (in decimal) of the partition on this device.
125 .IP
126 Note that this has nothing to do with the designation of these
127 devices on your filesystem.
128 The '/dev/' part is purely conventional.
129 .IP
130 The more awkward and less portable numeric specification of the above
131 possible root devices in major/minor format is also accepted.
132 (For example,
133 .I /dev/sda3
134 is major 8, minor 3, so you could use 'root=0x803' as an
135 alternative.)
136 .TP
137 .BR "'rootdelay='"
138 This parameter sets the delay (in seconds) to pause before attempting
139 to mount the root filesystem.
140 .TP
141 .BR "'rootflags=...'"
142 This parameter sets the mount option string for the root filesystem
143 (see also
144 .BR fstab (5)).
145 .TP
146 .BR "'rootfstype=...'"
147 The 'rootfstype' option tells the kernel to mount the root filesystem as
148 if it where of the type specified.
149 This can be useful (for example) to
150 mount an ext3 filesystem as ext2 and then remove the journal in the root
151 filesystem, in fact reverting its format from ext3 to ext2 without the
152 need to boot the box from alternate media.
153 .TP
154 .BR 'ro' " and " 'rw'
155 The 'ro' option tells the kernel to mount the root filesystem
156 as 'read-only' so that filesystem consistency check programs (fsck)
157 can do their work on a quiescent filesystem.
158 No processes can
159 write to files on the filesystem in question until it is 'remounted'
160 as read/write capable, for example, by 'mount \-w \-n \-o remount /'.
161 (See also
162 .BR mount (8).)
163 .IP
164 The 'rw' option tells the kernel to mount the root filesystem read/write.
165 This is the default.
166 .TP
167 .B "'resume=...'"
168 This tells the kernel the location of the suspend-to-disk data that you want the machine to resume from after hibernation.
169 Usually, it is the same as your swap partition or file.
170 Example:
171 .IP
172 .in +4n
173 .EX
174 resume=/dev/hda2
175 .EE
176 .in
177 .TP
178 .B "'reserve=...'"
179 This is used to protect I/O port regions from probes.
180 The form of the command is:
181 .IP
182 .in +4n
183 .EX
184 .BI reserve= iobase,extent[,iobase,extent]...
185 .EE
186 .in
187 .IP
188 In some machines it may be necessary to prevent device drivers from
189 checking for devices (auto-probing) in a specific region.
190 This may be
191 because of hardware that reacts badly to the probing, or hardware
192 that would be mistakenly identified, or merely
193 hardware you don't want the kernel to initialize.
194 .IP
195 The reserve boot-time argument specifies an I/O port region that
196 shouldn't be probed.
197 A device driver will not probe a reserved region,
198 unless another boot argument explicitly specifies that it do so.
199 .IP
200 For example, the boot line
201 .IP
202 .in +4n
203 .EX
204 reserve=0x300,32 blah=0x300
205 .EE
206 .in
207 .IP
208 keeps all device drivers except the driver for 'blah' from probing
209 0x300\-0x31f.
210 .TP
211 .B "'panic=N'"
212 By default, the kernel will not reboot after a panic, but this option
213 will cause a kernel reboot after N seconds (if N is greater than zero).
214 This panic timeout can also be set by
215 .IP
216 .in +4n
217 .EX
218 echo N > /proc/sys/kernel/panic
219 .EE
220 .in
221 .TP
222 .B "'reboot=[warm|cold][,[bios|hard]]'"
223 Since Linux 2.0.22, a reboot is by default a cold reboot.
224 One asks for the old default with 'reboot=warm'.
225 (A cold reboot may be required to reset certain hardware,
226 but might destroy not yet written data in a disk cache.
227 A warm reboot may be faster.)
228 By default, a reboot is hard, by asking the keyboard controller
229 to pulse the reset line low, but there is at least one type
230 of motherboard where that doesn't work.
231 The option 'reboot=bios' will
232 instead jump through the BIOS.
233 .TP
234 .BR 'nosmp' " and " 'maxcpus=N'
235 (Only when __SMP__ is defined.)
236 A command-line option of 'nosmp' or 'maxcpus=0' will disable SMP
237 activation entirely; an option 'maxcpus=N' limits the maximum number
238 of CPUs activated in SMP mode to N.
239 .SS Boot arguments for use by kernel developers
240 .TP
241 .B "'debug'"
242 Kernel messages are handed off to a daemon (e.g.,
243 .BR klogd (8)
244 or similar) so that they may be logged to disk.
245 Messages with a priority above
246 .I console_loglevel
247 are also printed on the console.
248 (For a discussion of log levels, see
249 .BR syslog (2).)
250 By default,
251 .I console_loglevel
252 is set to log messages at levels higher than
253 .BR KERN_DEBUG .
254 This boot argument will cause the kernel to also
255 print messages logged at level
256 .BR KERN_DEBUG .
257 The console loglevel can also be set on a booted system via the
258 .IR /proc/sys/kernel/printk
259 file (described in
260 .BR syslog (2)),
261 the
262 .BR syslog (2)
263 .B SYSLOG_ACTION_CONSOLE_LEVEL
264 operation, or
265 .BR dmesg (8).
266 .TP
267 .B "'profile=N'"
268 It is possible to enable a kernel profiling function,
269 if one wishes to find out where the kernel is spending its CPU cycles.
270 Profiling is enabled by setting the variable
271 .I prof_shift
272 to a nonzero value.
273 This is done either by specifying
274 .B CONFIG_PROFILE
275 at compile time, or by giving the 'profile=' option.
276 Now the value that
277 .I prof_shift
278 gets will be N, when given, or
279 .BR CONFIG_PROFILE_SHIFT ,
280 when that is given, or 2, the default.
281 The significance of this variable is that it
282 gives the granularity of the profiling: each clock tick, if the
283 system was executing kernel code, a counter is incremented:
284 .IP
285 .in +4n
286 .EX
287 profile[address >> prof_shift]++;
288 .EE
289 .in
290 .IP
291 The raw profiling information can be read from
292 .IR /proc/profile .
293 Probably you'll want to use a tool such as readprofile.c to digest it.
294 Writing to
295 .I /proc/profile
296 will clear the counters.
297 .SS Boot arguments for ramdisk use
298 (Only if the kernel was compiled with
299 .BR CONFIG_BLK_DEV_RAM .)
300 In general it is a bad idea to use a ramdisk under Linux\(emthe
301 system will use available memory more efficiently itself.
302 But while booting,
303 it is often useful to load the floppy contents into a
304 ramdisk.
305 One might also have a system in which first
306 some modules (for filesystem or hardware) must be loaded
307 before the main disk can be accessed.
308 .IP
309 In Linux 1.3.48, ramdisk handling was changed drastically.
310 Earlier, the memory was allocated statically, and there was
311 a 'ramdisk=N' parameter to tell its size.
312 (This could also be set in the kernel image at compile time.)
313 These days ram disks use the buffer cache, and grow dynamically.
314 For a lot of information on the current ramdisk
315 setup, see the kernel source file
316 .IR Documentation/blockdev/ramdisk.txt
317 .RI ( Documentation/ramdisk.txt
318 in older kernels).
319 .IP
320 There are four parameters, two boolean and two integral.
321 .TP
322 .B "'load_ramdisk=N'"
323 If N=1, do load a ramdisk.
324 If N=0, do not load a ramdisk.
325 (This is the default.)
326 .TP
327 .B "'prompt_ramdisk=N'"
328 If N=1, do prompt for insertion of the floppy.
329 (This is the default.)
330 If N=0, do not prompt.
331 (Thus, this parameter is never needed.)
332 .TP
333 .BR 'ramdisk_size=N' " or (obsolete) " 'ramdisk=N'
334 Set the maximal size of the ramdisk(s) to N kB.
335 The default is 4096 (4\ MB).
336 .TP
337 .B "'ramdisk_start=N'"
338 Sets the starting block number (the offset on the floppy where
339 the ramdisk starts) to N.
340 This is needed in case the ramdisk follows a kernel image.
341 .TP
342 .B "'noinitrd'"
343 (Only if the kernel was compiled with
344 .B CONFIG_BLK_DEV_RAM
345 and
346 .BR CONFIG_BLK_DEV_INITRD .)
347 These days it is possible to compile the kernel to use initrd.
348 When this feature is enabled, the boot process will load the kernel
349 and an initial ramdisk; then the kernel converts initrd into
350 a "normal" ramdisk, which is mounted read-write as root device;
351 then
352 .I /linuxrc
353 is executed; afterward the "real" root filesystem is mounted,
354 and the initrd filesystem is moved over to
355 .IR /initrd ;
356 finally
357 the usual boot sequence (e.g., invocation of
358 .IR /sbin/init )
359 is performed.
360 .IP
361 For a detailed description of the initrd feature, see the kernel source file
362 .I Documentation/admin\-guide/initrd.rst
363 .\" commit 9d85025b0418163fae079c9ba8f8445212de8568
364 (or
365 .I Documentation/initrd.txt
366 before Linux 4.10).
367 .IP
368 The 'noinitrd' option tells the kernel that although it was compiled for
369 operation with initrd, it should not go through the above steps, but
370 leave the initrd data under
371 .IR /dev/initrd .
372 (This device can be used only once: the data is freed as soon as
373 the last process that used it has closed
374 .IR /dev/initrd .)
375 .SS Boot arguments for SCSI devices
376 General notation for this section:
377 .PP
378 .I iobase
379 -- the first I/O port that the SCSI host occupies.
380 These are specified in hexadecimal notation,
381 and usually lie in the range from 0x200 to 0x3ff.
382 .PP
383 .I irq
384 -- the hardware interrupt that the card is configured to use.
385 Valid values will be dependent on the card in question, but will
386 usually be 5, 7, 9, 10, 11, 12, and 15.
387 The other values are usually
388 used for common peripherals like IDE hard disks, floppies, serial
389 ports, and so on.
390 .PP
391 .I scsi\-id
392 -- the ID that the host adapter uses to identify itself on the
393 SCSI bus.
394 Only some host adapters allow you to change this value, as
395 most have it permanently specified internally.
396 The usual default value
397 is 7, but the Seagate and Future Domain TMC-950 boards use 6.
398 .PP
399 .I parity
400 -- whether the SCSI host adapter expects the attached devices
401 to supply a parity value with all information exchanges.
402 Specifying a one indicates parity checking is enabled,
403 and a zero disables parity checking.
404 Again, not all adapters will support selection of parity
405 behavior as a boot argument.
406 .TP
407 .B "'max_scsi_luns=...'"
408 A SCSI device can have a number of 'subdevices' contained within
409 itself.
410 The most common example is one of the new SCSI CD-ROMs that
411 handle more than one disk at a time.
412 Each CD is addressed as a
413 \&'Logical Unit Number' (LUN) of that particular device.
414 But most
415 devices, such as hard disks, tape drives, and such are only one device,
416 and will be assigned to LUN zero.
417 .IP
418 Some poorly designed SCSI devices cannot handle being probed for
419 LUNs not equal to zero.
420 Therefore, if the compile-time flag
421 .B CONFIG_SCSI_MULTI_LUN
422 is not set, newer kernels will by default probe only LUN zero.
423 .IP
424 To specify the number of probed LUNs at boot, one enters
425 \&'max_scsi_luns=n' as a boot arg, where n is a number between one and
426 eight.
427 To avoid problems as described above, one would use n=1 to
428 avoid upsetting such broken devices.
429 .TP
430 .B "SCSI tape configuration"
431 Some boot time configuration of the SCSI tape driver can be achieved
432 by using the following:
433 .IP
434 .in +4n
435 .EX
436 .BI st= buf_size[,write_threshold[,max_bufs]]
437 .EE
438 .in
439 .IP
440 The first two numbers are specified in units of kB.
441 The default
442 .I buf_size
443 is 32k\ B, and the maximum size that can be specified is a
444 ridiculous 16384\ kB.
445 The
446 .I write_threshold
447 is the value at which the buffer is committed to tape, with a
448 default value of 30\ kB.
449 The maximum number of buffers varies
450 with the number of drives detected, and has a default of two.
451 An example usage would be:
452 .IP
453 .in +4n
454 .EX
455 st=32,30,2
456 .EE
457 .in
458 .IP
459 Full details can be found in the file
460 .I Documentation/scsi/st.txt
461 (or
462 .I drivers/scsi/README.st
463 for older kernels) in the Linux kernel source.
464 .SS Hard disks
465 .TP
466 .B "IDE Disk/CD-ROM Driver Parameters"
467 The IDE driver accepts a number of parameters, which range from disk
468 geometry specifications, to support for broken controller chips.
469 Drive-specific options are specified by using 'hdX=' with X in 'a'\(en'h'.
470 .IP
471 Non-drive-specific options are specified with the prefix 'hd='.
472 Note that using a drive-specific prefix for a non-drive-specific option
473 will still work, and the option will just be applied as expected.
474 .IP
475 Also note that 'hd=' can be used to refer to the next unspecified
476 drive in the (a, ..., h) sequence.
477 For the following discussions,
478 the 'hd=' option will be cited for brevity.
479 See the file
480 .I Documentation/ide/ide.txt
481 (or
482 .I Documentation/ide.txt
483 .\" Linux 2.0, 2.2, 2.4
484 in older kernels, or
485 .I drivers/block/README.ide
486 in ancient kernels) in the Linux kernel source for more details.
487 .TP
488 .B "The 'hd=cyls,heads,sects[,wpcom[,irq]]' options"
489 These options are used to specify the physical geometry of the disk.
490 Only the first three values are required.
491 The cylinder/head/sectors
492 values will be those used by fdisk.
493 The write precompensation value
494 is ignored for IDE disks.
495 The IRQ value specified will be the IRQ
496 used for the interface that the drive resides on, and is not really a
497 drive-specific parameter.
498 .TP
499 .B "The 'hd=serialize' option"
500 The dual IDE interface CMD-640 chip is broken as designed such that
501 when drives on the secondary interface are used at the same time as
502 drives on the primary interface, it will corrupt your data.
503 Using this
504 option tells the driver to make sure that both interfaces are never
505 used at the same time.
506 .TP
507 .B "The 'hd=noprobe' option"
508 Do not probe for this drive.
509 For example,
510 .IP
511 .in +4n
512 .EX
513 hdb=noprobe hdb=1166,7,17
514 .EE
515 .in
516 .IP
517 would disable the probe, but still specify the drive geometry so
518 that it would be registered as a valid block device, and hence
519 usable.
520 .TP
521 .B "The 'hd=nowerr' option"
522 Some drives apparently have the
523 .B WRERR_STAT
524 bit stuck on permanently.
525 This enables a work-around for these broken devices.
526 .TP
527 .B "The 'hd=cdrom' option"
528 This tells the IDE driver that there is an ATAPI compatible CD-ROM
529 attached in place of a normal IDE hard disk.
530 In most cases the CD-ROM
531 is identified automatically, but if it isn't then this may help.
532 .TP
533 .B "Standard ST-506 Disk Driver Options ('hd=')"
534 The standard disk driver can accept geometry arguments for the disks
535 similar to the IDE driver.
536 Note however that it expects only three
537 values (C/H/S); any more or any less and it will silently ignore you.
538 Also, it accepts only 'hd=' as an argument, that is, 'hda='
539 and so on are not valid here.
540 The format is as follows:
541 .IP
542 .in +4n
543 .EX
544 hd=cyls,heads,sects
545 .EE
546 .in
547 .IP
548 If there are two disks installed, the above is repeated with the
549 geometry parameters of the second disk.
550 .SS Ethernet devices
551 Different drivers make use of different parameters, but they all at
552 least share having an IRQ, an I/O port base value, and a name.
553 In its most generic form, it looks something like this:
554 .PP
555 .in +4n
556 .EX
557 ether=irq,iobase[,param_1[,...param_8]],name
558 .EE
559 .in
560 .PP
561 The first nonnumeric argument is taken as the name.
562 The param_n values (if applicable) usually have different meanings for each
563 different card/driver.
564 Typical param_n values are used to specify
565 things like shared memory address, interface selection, DMA channel
566 and the like.
567 .PP
568 The most common use of this parameter is to force probing for a second
569 ethercard, as the default is to probe only for one.
570 This can be accomplished with a simple:
571 .PP
572 .in +4n
573 .EX
574 ether=0,0,eth1
575 .EE
576 .in
577 .PP
578 Note that the values of zero for the IRQ and I/O base in the above
579 example tell the driver(s) to autoprobe.
580 .PP
581 The Ethernet-HowTo has extensive documentation on using multiple
582 cards and on the card/driver-specific implementation
583 of the param_n values where used.
584 Interested readers should refer to
585 the section in that document on their particular card.
586 .SS The floppy disk driver
587 There are many floppy driver options, and they are all listed in
588 .I Documentation/blockdev/floppy.txt
589 (or
590 .I Documentation/floppy.txt
591 in older kernels, or
592 .I drivers/block/README.fd
593 for ancient kernels) in the Linux kernel source.
594 See that file for the details.
595 .SS The sound driver
596 The sound driver can also accept boot arguments to override the compiled-in
597 values.
598 This is not recommended, as it is rather complex.
599 It is described in the Linux kernel source file
600 .IR Documentation/sound/oss/README.OSS
601 .RI ( drivers/sound/Readme.linux
602 in older kernel versions).
603 It accepts
604 a boot argument of the form:
605 .PP
606 .in +4n
607 .EX
608 sound=device1[,device2[,device3...[,device10]]]
609 .EE
610 .in
611 .PP
612 where each deviceN value is of the following format 0xTaaaId and the
613 bytes are used as follows:
614 .PP
615 T \- device type: 1=FM, 2=SB, 3=PAS, 4=GUS, 5=MPU401, 6=SB16,
616 7=SB16-MPU401
617 .PP
618 aaa \- I/O address in hex.
619 .PP
620 I \- interrupt line in hex (i.e., 10=a, 11=b, ...)
621 .PP
622 d \- DMA channel.
623 .PP
624 As you can see, it gets pretty messy, and you are better off to compile
625 in your own personal values as recommended.
626 Using a boot argument of
627 \&'sound=0' will disable the sound driver entirely.
628 .SS The line printer driver
629 .TP
630 .B "'lp='"
631 .br
632 Syntax:
633 .IP
634 .in +4n
635 .EX
636 lp=0
637 lp=auto
638 lp=reset
639 lp=port[,port...]
640 .EE
641 .in
642 .IP
643 You can tell the printer driver what ports to use and what ports not
644 to use.
645 The latter comes in handy if you don't want the printer driver
646 to claim all available parallel ports, so that other drivers
647 (e.g., PLIP, PPA) can use them instead.
648 .IP
649 The format of the argument is multiple port names.
650 For example,
651 lp=none,parport0 would use the first parallel port for lp1, and
652 disable lp0.
653 To disable the printer driver entirely, one can use
654 lp=0.
655 .\" .SH AUTHORS
656 .\" Linus Torvalds (and many others)
657 .SH SEE ALSO
658 .BR klogd (8),
659 .BR mount (8)
660 .PP
661 For up-to-date information, see the kernel source file
662 .IR Documentation/admin\-guide/kernel\-parameters.txt .