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