]> git.ipfire.org Git - thirdparty/dracut.git/blame - dracut.8.asc
add "--kernel-cmdline" and kernel_cmdline options for default parameters
[thirdparty/dracut.git] / dracut.8.asc
CommitLineData
888d53f2
HH
1DRACUT(8)
2=========
3:doctype: manpage
4:man source: dracut
5:man manual: dracut
6
7NAME
8----
9dracut - low-level tool for generating an initramfs image
10
11SYNOPSIS
12--------
13*dracut* ['OPTION...'] [<image> [_<kernel version>_]]
14
15DESCRIPTION
16-----------
4c3be42c
HH
17
18Create an initramfs <image> for the kernel with the version <kernel version>.
19If <kernel version> is omitted, then the version of the actual running
20kernel is used. If <image> is omitted or empty, then the default location
21/boot/initramfs-<kernel version>.img is used.
22
888d53f2
HH
23dracut creates an initial image used by the kernel for preloading the block
24device modules (such as IDE, SCSI or RAID) which are needed to access the root
25filesystem, mounting the root filesystem and booting into the real system.
26
27At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
28as initial root file system. All finding of the root device happens in this
29early userspace.
30
4c3be42c
HH
31For a complete list of kernel command line options see *dracut.cmdline*(7).
32
33EXAMPLE
34-------
35
36To create a initramfs image, the most simple command is:
37----
38# dracut
39----
40
41This will generate a general purpose initramfs image, with all possible
42functionality resulting of the combination of the installed dracut modules and
43system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
44contains the kernel modules of the currently active kernel with version
45_++<kernel version>++_.
46
47If the initramfs image already exists, dracut will display an error message, and
48to overwrite the existing image, you have to use the --force option.
49----
50# dracut --force
51----
52
53If you want to specify another filename for the resulting image you would issue
54a command like:
55----
56# dracut foobar.img
57----
58
59To generate an image for a specific kernel version, the command would be:
60----
61# dracut foobar.img 2.6.40-1.rc5.f20
62----
63
64A shortcut to generate the image at the default location for a specific kernel
65version is:
66----
67# dracut --kver 2.6.40-1.rc5.f20
68----
69
70If you want to create lighter, smaller initramfs images, you may want to specify
71the --host-only or -H option. Using this option, the resulting image will
72contain only those dracut modules, kernel modules and filesystems, which are
73needed to boot this specific machine. This has the drawback, that you can't put
74the disk on another controller or machine, and that you can't switch to another
75root filesystem, without recreating the initramfs image. The usage of the
76--host-only option is only for experts and you will have to keep the broken
77pieces. At least keep a copy of a general purpose image (and corresponding
78kernel) as a fallback to rescue your system.
79
888d53f2
HH
80
81OPTIONS
82-------
e65caf36
HH
83**--kver** _<kernel version>_::
84 set the kernel version. This enables to specify the kernel version, without
85 specifying the location of the initramfs image. For example:
86----
87# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
88----
89
888d53f2
HH
90**-f, --force**::
91 overwrite existing initramfs file.
92
93**-m, --modules** _<list of dracut modules>_::
0cec2304
HH
94 specify a space-separated list of dracut modules to call when building the
95 initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
96 parameter can be specified multiple times.
888d53f2
HH
97+
98[NOTE]
99===============================
100If [LIST] has multiple arguments, then you have to put these in quotes. For
101example:
102----
103# dracut --modules "module1 module2" ...
104----
105===============================
106
107**-o, --omit** _<list of dracut modules>_::
0cec2304
HH
108 omit a space-separated list of dracut modules. This parameter can be
109 specified multiple times.
18595ced 110+
888d53f2
HH
111[NOTE]
112===============================
113If [LIST] has multiple arguments, then you have to put these in quotes. For
114example:
115----
116# dracut --omit "module1 module2" ...
117----
118===============================
119
120**-a, --add** _<list of dracut modules>_::
121 add a space-separated list of dracut modules to the default set of modules.
122 This parameter can be specified multiple times.
123+
124[NOTE]
125===============================
126If [LIST] has multiple arguments, then you have to put these in quotes. For
127example:
128----
129# dracut --add "module1 module2" ...
130----
131===============================
132
133**--force-add** _<list of dracut modules>_::
134 force to add a space-separated list of dracut modules to the default set of
135 modules, when -H is specified. This parameter can be specified multiple
136 times.
137+
138[NOTE]
139===============================
140If [LIST] has multiple arguments, then you have to put these in quotes. For
141example:
142----
143# dracut --force-add "module1 module2" ...
144----
145===============================
146
147**-d, --drivers** _<list of kernel modules>_::
148 specify a space-separated list of kernel modules to exclusively include
149 in the initramfs. The kernel modules have to be specified without the ".ko"
150 suffix. This parameter can be specified multiple times.
151+
152[NOTE]
153===============================
154If [LIST] has multiple arguments, then you have to put these in quotes. For
155example:
156----
157# dracut --drivers "kmodule1 kmodule2" ...
158----
159===============================
160
161**--add-drivers** _<list of kernel modules>_::
162 specify a space-separated list of kernel modules to add to the initramfs.
163 The kernel modules have to be specified without the ".ko" suffix. This
164 parameter can be specified multiple times.
165+
166[NOTE]
167===============================
168If [LIST] has multiple arguments, then you have to put these in quotes. For
169example:
170----
171# dracut --add-drivers "kmodule1 kmodule2" ...
172----
173===============================
174
175**--omit-drivers** _<list of kernel modules>_::
176 specify a space-separated list of kernel modules not to add to the
177 initramfs.
178 The kernel modules have to be specified without the ".ko" suffix. This
179 parameter can be specified multiple times.
180+
181[NOTE]
182===============================
183If [LIST] has multiple arguments, then you have to put these in quotes. For
184example:
185----
186# dracut --omit-drivers "kmodule1 kmodule2" ...
187----
188===============================
189
190**--filesystems** _<list of filesystems>_::
191 specify a space-separated list of kernel filesystem modules to exclusively
192 include in the generic initramfs. This parameter can be specified multiple
193 times.
18595ced 194+
888d53f2
HH
195[NOTE]
196===============================
197If [LIST] has multiple arguments, then you have to put these in quotes. For
198example:
199----
200# dracut --filesystems "filesystem1 filesystem2" ...
201----
202===============================
203
204**-k, --kmoddir** _<kernel directory>_::
205 specify the directory, where to look for kernel modules
206
207**--fwdir** _<dir>[:<dir>...]++_::
208 specify additional directories, where to look for firmwares. This parameter
209 can be specified multiple times.
210
d20fb951
HH
211**--kernel-cmdline <parameters>**::
212 specify default kernel command line parameters
213
214
888d53f2
HH
215**--kernel-only**::
216 only install kernel drivers and firmware files
217
218**--no-kernel**::
219 do not install kernel drivers and firmware files
220
221**--mdadmconf**::
222 include local _/etc/mdadm.conf_
223
224**--nomdadmconf**::
225 do not include local _/etc/mdadm.conf_
226
227**--lvmconf**::
228 include local _/etc/lvm/lvm.conf_
229
230**--nolvmconf**::
231 do not include local _/etc/lvm/lvm.conf_
232
233**--fscks** [LIST]::
234 add a space-separated list of fsck tools, in addition to _dracut.conf_'s
235 specification; the installation is opportunistic (non-existing tools are
236 ignored)
237+
238[NOTE]
239===============================
240If [LIST] has multiple arguments, then you have to put these in quotes. For
241example:
242----
243# dracut --fscks "fsck.foo barfsck" ...
244----
245===============================
246
247**--nofscks**::
248 inhibit installation of any fsck tools
249
250**--strip**::
04d18f55 251 strip binaries in the initramfs
888d53f2
HH
252
253**--nostrip**::
04d18f55
HH
254 do not strip binaries in the initramfs (default)
255
256**--hardlink**::
257 hardlink files in the initramfs (default)
258
259**--nohardlink**::
260 do not hardlink files in the initramfs
888d53f2
HH
261
262**--prefix** _<dir>_::
263 prefix initramfs files with the specified directory
264
265**--noprefix**::
266 do not prefix initramfs files (default)
267
888d53f2
HH
268**-h, --help**::
269 display help text and exit.
270
271**--debug**::
272 output debug information of the build process
273
274**-v, --verbose**::
275 increase verbosity level (default is info(4))
276
277**-q, --quiet**:: decrease verbosity level (default is info(4))
278
279**-c, --conf** _<dracut configuration file>_::
280 specify configuration file to use.
281+
282Default:
283 _/etc/dracut.conf_
284
285**--confdir** _<configuration directory>_::
286 specify configuration directory to use.
287+
288Default:
289 _/etc/dracut.conf.d_
290
4dd68ca4
291**--tmpdir** _<temporary directory>_::
292 specify temporary directory to use.
293+
294Default:
295 _/var/tmp_
296
888d53f2
HH
297**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
298
299**-l, --local**::
300 activates the local mode. dracut will use modules from the current working
301 directory instead of the system-wide installed modules in
302 _/usr/lib/dracut/modules.d_.
303 This is useful when running dracut from a git checkout.
304
305**-H, --hostonly**::
1d97bb8b
306 Host-Only mode: Install only what is needed for booting the local host
307 instead of a generic host and generate host-specific configuration.
888d53f2
HH
308+
309[WARNING]
310====
0cec2304
HH
311If chrooted to another root other than the real root device, use "--fstab" and
312provide a valid _/etc/fstab_.
888d53f2
HH
313====
314
472189da 315**-N, --no-hostonly**::
cb74b382
HH
316 Disable Host-Only mode
317
888d53f2
HH
318**--fstab**::
319 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
320
bd66d2b5 321**--add-fstab** _<filename>_ ::
888d53f2
HH
322 Add entries of _<filename>_ to the initramfs /etc/fstab.
323
324**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
f0690513
HH
325 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
326 options>_ in the initramfs
888d53f2 327
52f1b041
DY
328**--device** _<device>_ ::
329 Bring up _<device>_ in initramfs, _<device>_ should be the device name
330
888d53f2
HH
331**-i, --include** _<SOURCE>_ _<TARGET>_::
332 include the files in the SOURCE directory into the
333 TARGET directory in the final initramfs. If SOURCE is a file, it will be
334 installed to TARGET in the final initramfs. This parameter can be specified
335 multiple times.
336
337**-I, --install** _<file list>_::
338 install the space separated list of files into the initramfs.
339+
340[NOTE]
341===============================
342If [LIST] has multiple arguments, then you have to put these in quotes. For
343example:
888d53f2
HH
344----
345# dracut --install "/bin/foo /sbin/bar" ...
346----
347===============================
348
349**--gzip**::
350 Compress the generated initramfs using gzip. This will be done by default,
351 unless another compression option or --no-compress is passed. Equivalent to
352 "--compress=gzip -9"
353
354**--bzip2**::
355 Compress the generated initramfs using bzip2.
356+
357[WARNING]
358====
359Make sure your kernel has bzip2 decompression support compiled in, otherwise you
360will not be able to boot. Equivalent to "--compress=bzip2"
361====
362
363**--lzma**::
364 Compress the generated initramfs using lzma.
365+
366[WARNING]
367====
368Make sure your kernel has lzma decompression support compiled in, otherwise you
369will not be able to boot. Equivalent to "--compress=lzma -9"
370====
371
372**--xz**::
373 Compress the generated initramfs using xz.
374+
375[WARNING]
376====
377Make sure your kernel has xz decompression support compiled in, otherwise you
378will not be able to boot. Equivalent to "--compress=xz --check=crc32
379--lzma2=dict=1MiB"
380====
381
382**--compress** _<compressor>_::
383 Compress the generated initramfs using the passed compression program. If
384 you pass it just the name of a compression program, it will call that
385 program with known-working arguments. If you pass a quoted string with
386 arguments, it will be called with exactly those arguments. Depending on what
387 you pass, this may result in an initramfs that the kernel cannot decompress.
388
389**--no-compress**::
390 Do not compress the generated initramfs. This will override any other
391 compression options.
392
393**--list-modules**::
394 List all available dracut modules.
395
396**-M, --show-modules**::
397 Print included module's name to standard output during build.
398
399**--keep**::
400 Keep the initramfs temporary directory for debugging purposes.
401
402FILES
403-----
404_/var/log/dracut.log_::
405 logfile of initramfs image creation
406
407_/tmp/dracut.log_::
408 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
409 writable
410
411_/etc/dracut.conf_::
412 see dracut.conf5
413
414_/etc/dracut.conf.d/*.conf_::
415 see dracut.conf5
416
417Configuration in the initramfs
418~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
419_/etc/conf.d/_::
420 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
421 set initial values. Command line options will override these values
422 set in the configuration files.
423
424_/etc/cmdline_::
425 Can contain additional command line options.
426
427AVAILABILITY
428------------
429The dracut command is part of the dracut package and is available from
430link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
431
432AUTHORS
433-------
9f355169 434Harald Hoyer
888d53f2 435
9f355169 436Victor Lowther
888d53f2 437
9f355169 438Philippe Seewer
888d53f2 439
9f355169 440Warren Togami
888d53f2 441
9f355169 442Amadeusz Żołnowski
888d53f2 443
9f355169 444Jeremy Katz
888d53f2 445
9f355169 446David Dillow
888d53f2 447
9f355169 448Will Woods
888d53f2
HH
449
450SEE ALSO
451--------
452*dracut.cmdline*(7) *dracut.conf*(5)