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