]> git.ipfire.org Git - thirdparty/dracut.git/blame - dracut.8.asc
dracut_mkdir(): create parent directories as needed.
[thirdparty/dracut.git] / dracut.8.asc
CommitLineData
888d53f2
HH
1DRACUT(8)
2=========
3:doctype: manpage
4:man source: dracut
5:man manual: dracut
50057af1 6:man version: {version}
888d53f2
HH
7
8NAME
9----
319867fa 10dracut - low-level tool for generating an initramfs/initrd image
888d53f2
HH
11
12SYNOPSIS
13--------
b6c89768 14*dracut* [__OPTION...__] [__<image>__ [__<kernel version>__]]
888d53f2
HH
15
16DESCRIPTION
17-----------
4c3be42c
HH
18
19Create an initramfs <image> for the kernel with the version <kernel version>.
20If <kernel version> is omitted, then the version of the actual running
21kernel is used. If <image> is omitted or empty, then the default location
22/boot/initramfs-<kernel version>.img is used.
23
888d53f2
HH
24dracut creates an initial image used by the kernel for preloading the block
25device modules (such as IDE, SCSI or RAID) which are needed to access the root
26filesystem, mounting the root filesystem and booting into the real system.
27
28At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
29as initial root file system. All finding of the root device happens in this
30early userspace.
31
319867fa
HH
32Initramfs images are also called "initrd".
33
4c3be42c
HH
34For a complete list of kernel command line options see *dracut.cmdline*(7).
35
64d144ae 36If you are dropped to an emergency shell, while booting your initramfs,
05b879ed 37the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
64d144ae 38(to be mounted by hand) partition (usually /boot) or a USB stick.
ef9ddb91
HH
39Additional debugging info can be produced by adding **rd.debug** to the kernel
40command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
41of some tools. It should be attached to any report about dracut problems.
64d144ae 42
b6c89768
HH
43USAGE
44-----
4c3be42c 45
b6c89768 46include::dracut.usage.asc[]
888d53f2
HH
47
48OPTIONS
49-------
e65caf36
HH
50**--kver** _<kernel version>_::
51 set the kernel version. This enables to specify the kernel version, without
52 specifying the location of the initramfs image. For example:
53----
54# dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
55----
56
888d53f2
HH
57**-f, --force**::
58 overwrite existing initramfs file.
59
319867fa
HH
60**-a, --add** _<list of dracut modules>_::
61 add a space-separated list of dracut modules to the default set of modules.
62 This parameter can be specified multiple times.
888d53f2
HH
63+
64[NOTE]
65===============================
66If [LIST] has multiple arguments, then you have to put these in quotes. For
67example:
68----
319867fa 69# dracut --add "module1 module2" ...
888d53f2
HH
70----
71===============================
72
319867fa
HH
73**--force-add** _<list of dracut modules>_::
74 force to add a space-separated list of dracut modules to the default set of
75 modules, when -H is specified. This parameter can be specified multiple
76 times.
18595ced 77+
888d53f2
HH
78[NOTE]
79===============================
80If [LIST] has multiple arguments, then you have to put these in quotes. For
81example:
82----
319867fa 83# dracut --force-add "module1 module2" ...
888d53f2
HH
84----
85===============================
86
319867fa
HH
87**-o, --omit** _<list of dracut modules>_::
88 omit a space-separated list of dracut modules. This parameter can be
89 specified multiple times.
888d53f2
HH
90+
91[NOTE]
92===============================
93If [LIST] has multiple arguments, then you have to put these in quotes. For
94example:
95----
319867fa 96# dracut --omit "module1 module2" ...
888d53f2
HH
97----
98===============================
99
319867fa
HH
100**-m, --modules** _<list of dracut modules>_::
101 specify a space-separated list of dracut modules to call when building the
102 initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
103 parameter can be specified multiple times.
104 This option forces dracut to only include the specified dracut modules.
105 In most cases the "--add" option is what you want to use.
888d53f2
HH
106+
107[NOTE]
108===============================
109If [LIST] has multiple arguments, then you have to put these in quotes. For
110example:
111----
319867fa 112# dracut --modules "module1 module2" ...
888d53f2
HH
113----
114===============================
115
116**-d, --drivers** _<list of kernel modules>_::
117 specify a space-separated list of kernel modules to exclusively include
118 in the initramfs. The kernel modules have to be specified without the ".ko"
119 suffix. This parameter can be specified multiple times.
120+
121[NOTE]
122===============================
123If [LIST] has multiple arguments, then you have to put these in quotes. For
124example:
125----
126# dracut --drivers "kmodule1 kmodule2" ...
127----
128===============================
129
130**--add-drivers** _<list of kernel modules>_::
131 specify a space-separated list of kernel modules to add to the initramfs.
132 The kernel modules have to be specified without the ".ko" suffix. This
133 parameter can be specified multiple times.
134+
135[NOTE]
136===============================
137If [LIST] has multiple arguments, then you have to put these in quotes. For
138example:
139----
140# dracut --add-drivers "kmodule1 kmodule2" ...
141----
142===============================
cea907f6
TR
143
144**--force-drivers** _<list of kernel modules>_::
145 See add-drivers above. But in this case it is ensured that the drivers
146 are tried to be loaded early via modprobe.
147+
148[NOTE]
149===============================
150If [LIST] has multiple arguments, then you have to put these in quotes. For
151example:
152----
153# dracut --force-drivers "kmodule1 kmodule2" ...
154----
155===============================
888d53f2
HH
156
157**--omit-drivers** _<list of kernel modules>_::
158 specify a space-separated list of kernel modules not to add to the
159 initramfs.
160 The kernel modules have to be specified without the ".ko" suffix. This
161 parameter can be specified multiple times.
162+
163[NOTE]
164===============================
165If [LIST] has multiple arguments, then you have to put these in quotes. For
166example:
167----
168# dracut --omit-drivers "kmodule1 kmodule2" ...
169----
170===============================
171
172**--filesystems** _<list of filesystems>_::
173 specify a space-separated list of kernel filesystem modules to exclusively
174 include in the generic initramfs. This parameter can be specified multiple
175 times.
18595ced 176+
888d53f2
HH
177[NOTE]
178===============================
179If [LIST] has multiple arguments, then you have to put these in quotes. For
180example:
181----
182# dracut --filesystems "filesystem1 filesystem2" ...
183----
184===============================
185
186**-k, --kmoddir** _<kernel directory>_::
187 specify the directory, where to look for kernel modules
188
189**--fwdir** _<dir>[:<dir>...]++_::
190 specify additional directories, where to look for firmwares. This parameter
191 can be specified multiple times.
192
d20fb951
HH
193**--kernel-cmdline <parameters>**::
194 specify default kernel command line parameters
195
196
888d53f2
HH
197**--kernel-only**::
198 only install kernel drivers and firmware files
199
200**--no-kernel**::
201 do not install kernel drivers and firmware files
202
b7c770e1
DS
203**--early-microcode**::
204 Combine early microcode with ramdisk
205
206**--no-early-microcode**::
207 Do not combine early microcode with ramdisk
208
1743473b
HH
209**--print-cmdline**::
210 print the kernel command line for the current disk layout
211
888d53f2
HH
212**--mdadmconf**::
213 include local _/etc/mdadm.conf_
214
215**--nomdadmconf**::
216 do not include local _/etc/mdadm.conf_
217
218**--lvmconf**::
219 include local _/etc/lvm/lvm.conf_
220
221**--nolvmconf**::
222 do not include local _/etc/lvm/lvm.conf_
223
224**--fscks** [LIST]::
225 add a space-separated list of fsck tools, in addition to _dracut.conf_'s
226 specification; the installation is opportunistic (non-existing tools are
227 ignored)
228+
229[NOTE]
230===============================
231If [LIST] has multiple arguments, then you have to put these in quotes. For
232example:
233----
234# dracut --fscks "fsck.foo barfsck" ...
235----
236===============================
237
238**--nofscks**::
239 inhibit installation of any fsck tools
240
241**--strip**::
6c128565 242 strip binaries in the initramfs (default)
888d53f2
HH
243
244**--nostrip**::
6c128565 245 do not strip binaries in the initramfs
04d18f55
HH
246
247**--hardlink**::
248 hardlink files in the initramfs (default)
249
250**--nohardlink**::
251 do not hardlink files in the initramfs
888d53f2
HH
252
253**--prefix** _<dir>_::
254 prefix initramfs files with the specified directory
255
256**--noprefix**::
257 do not prefix initramfs files (default)
258
888d53f2
HH
259**-h, --help**::
260 display help text and exit.
261
262**--debug**::
263 output debug information of the build process
264
265**-v, --verbose**::
266 increase verbosity level (default is info(4))
267
268**-q, --quiet**:: decrease verbosity level (default is info(4))
269
270**-c, --conf** _<dracut configuration file>_::
271 specify configuration file to use.
272+
273Default:
274 _/etc/dracut.conf_
275
276**--confdir** _<configuration directory>_::
277 specify configuration directory to use.
278+
279Default:
280 _/etc/dracut.conf.d_
281
4dd68ca4
282**--tmpdir** _<temporary directory>_::
283 specify temporary directory to use.
284+
285Default:
286 _/var/tmp_
287
4efcd19a
BZ
288**-r, --sysroot** _<sysroot directory>_::
289 specify the sysroot directory to collect files from.
290 This is useful to create the initramfs image from
291 a cross-compiled sysroot directory. For the extra helper
292 variables, see *ENVIRONMENT* below.
293+
294Default:
295 _empty_
296
888d53f2
HH
297**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
298
ee54b840
HR
299**--logfile** _<logfile>_:: logfile to use; overrides any setting from
300 the configuration files.
301+
302Default:
303 _/var/log/dracut.log_
304
888d53f2
HH
305**-l, --local**::
306 activates the local mode. dracut will use modules from the current working
307 directory instead of the system-wide installed modules in
308 _/usr/lib/dracut/modules.d_.
309 This is useful when running dracut from a git checkout.
310
311**-H, --hostonly**::
1d97bb8b
312 Host-Only mode: Install only what is needed for booting the local host
313 instead of a generic host and generate host-specific configuration.
888d53f2
HH
314+
315[WARNING]
316====
0cec2304
HH
317If chrooted to another root other than the real root device, use "--fstab" and
318provide a valid _/etc/fstab_.
888d53f2
HH
319====
320
472189da 321**-N, --no-hostonly**::
cb74b382
HH
322 Disable Host-Only mode
323
ab9457ef
HH
324**--hostonly-cmdline**:
325 Store kernel command line arguments needed in the initramfs
326
327**--no-hostonly-cmdline**:
328 Do not store kernel command line arguments needed in the initramfs
329
37f2fe55
XP
330**--no-hostonly-default-device**:
331 Do not generate implicit host devices like root, swap, fstab, etc.
332 Use "--mount" or "--add-device" to explicitly add devices as needed.
333
fe6455a6
HH
334**--hostonly-i18n**:
335 Install only needed keyboard and font files according to the host configuration (default).
336
337**--no-hostonly-i18n**:
338 Install all keyboard and font files available.
339
b6c89768 340**--persistent-policy** _<policy>_::
324ea606
HH
341 Use _<policy>_ to address disks and partitions.
342 _<policy>_ can be any directory name found in /dev/disk.
343 E.g. "by-uuid", "by-label"
344
888d53f2
HH
345**--fstab**::
346 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
347
b6c89768 348**--add-fstab** _<filename>_::
888d53f2
HH
349 Add entries of _<filename>_ to the initramfs /etc/fstab.
350
5f6a495b
DY
351**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ [_<filesystem options>_ [_<dump frequency>_ [_<fsck order>_]]]"::
352 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ in the
353 initramfs. _<filesystem options>_, _<dump options>_ and _<fsck order>_ can
354 be specified, see fstab manpage for the details.
355 The default _<filesystem options>_ is "defaults".
356 The default _<dump frequency>_ is "0".
357 the default _<fsck order>_ is "2".
888d53f2 358
edbd9ca0
FV
359**--mount** "_<mountpoint>_"::
360 Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
361 are determined by looking at the current mounts.
362
c586b033
CG
363**--add-device** _<device>_ ::
364 Bring up _<device>_ in initramfs, _<device>_ should be the device name.
365 This can be useful in hostonly mode for resume support when your swap is on
366 LVM or an encrypted partition.
367 [NB --device can be used for compatibility with earlier releases]
52f1b041 368
b6c89768 369**-i, --include** _<SOURCE>_ _<TARGET>_::
888d53f2
HH
370 include the files in the SOURCE directory into the
371 TARGET directory in the final initramfs. If SOURCE is a file, it will be
372 installed to TARGET in the final initramfs. This parameter can be specified
373 multiple times.
374
b6c89768 375**-I, --install** _<file list>_::
888d53f2
HH
376 install the space separated list of files into the initramfs.
377+
378[NOTE]
379===============================
380If [LIST] has multiple arguments, then you have to put these in quotes. For
381example:
888d53f2
HH
382----
383# dracut --install "/bin/foo /sbin/bar" ...
384----
385===============================
386
54b68829
HH
387**--install-optional** _<file list>_::
388 install the space separated list of files into the initramfs, if they exist.
389
888d53f2
HH
390**--gzip**::
391 Compress the generated initramfs using gzip. This will be done by default,
392 unless another compression option or --no-compress is passed. Equivalent to
393 "--compress=gzip -9"
394
395**--bzip2**::
396 Compress the generated initramfs using bzip2.
397+
398[WARNING]
399====
400Make sure your kernel has bzip2 decompression support compiled in, otherwise you
401will not be able to boot. Equivalent to "--compress=bzip2"
402====
403
404**--lzma**::
405 Compress the generated initramfs using lzma.
406+
407[WARNING]
408====
409Make sure your kernel has lzma decompression support compiled in, otherwise you
ea3c4e82 410will not be able to boot. Equivalent to "lzma --compress=lzma -9"
888d53f2
HH
411====
412
413**--xz**::
414 Compress the generated initramfs using xz.
415+
416[WARNING]
417====
418Make sure your kernel has xz decompression support compiled in, otherwise you
ef9ddb91
HH
419will not be able to boot. Equivalent to
420"lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
888d53f2
HH
421====
422
871c8e40 423**--lzo**::
424 Compress the generated initramfs using lzop.
425[WARNING]
426====
427Make sure your kernel has lzo decompression support compiled in, otherwise you
428will not be able to boot.
429====
430
431**--lz4**::
432 Compress the generated initramfs using lz4.
433[WARNING]
434====
435Make sure your kernel has lz4 decompression support compiled in, otherwise you
436will not be able to boot.
437====
438
7dbadcc7
TPG
439**--zstd**::
440 Compress the generated initramfs using Zstandard.
441[WARNING]
442====
443Make sure your kernel has zstd decompression support compiled in, otherwise you
444will not be able to boot.
445====
446
888d53f2
HH
447**--compress** _<compressor>_::
448 Compress the generated initramfs using the passed compression program. If
449 you pass it just the name of a compression program, it will call that
450 program with known-working arguments. If you pass a quoted string with
451 arguments, it will be called with exactly those arguments. Depending on what
452 you pass, this may result in an initramfs that the kernel cannot decompress.
bd98b884 453 The default value can also be set via the _INITRD_COMPRESS_ environment variable.
888d53f2
HH
454
455**--no-compress**::
456 Do not compress the generated initramfs. This will override any other
457 compression options.
458
80626ded
HH
459**--reproducible**::
460 Create reproducible images.
461
4a6c14f9
HH
462**--no-reproducible**::
463 Do not create reproducible images.
464
888d53f2
HH
465**--list-modules**::
466 List all available dracut modules.
467
468**-M, --show-modules**::
469 Print included module's name to standard output during build.
470
471**--keep**::
472 Keep the initramfs temporary directory for debugging purposes.
473
ea3c4e82
HH
474**--printsize**::
475 Print out the module install size
476
477**--profile**:
478 Output profile information of the build process
479
480**--ro-mnt**:
481 Mount / and /usr read-only by default.
482
483**-L, --stdlog** _<level>_::
484 [0-6] Specify logging level (to standard error)
485----
486 0 - suppress any messages
487 1 - only fatal errors
488 2 - all errors
489 3 - warnings
490 4 - info
491 5 - debug info (here starts lots of output)
492 6 - trace info (and even more)
493----
494
7d848c55 495**--regenerate-all**::
ef9ddb91
HH
496 Regenerate all initramfs images at the default location with the kernel
497 versions found on the system. Additional parameters are passed through.
7d848c55 498
ca96509c 499**--loginstall _<DIR>_**::
37383f71
HH
500 Log all files installed from the host to _<DIR>_.
501
ca96509c 502**--uefi**::
636d2d46 503 Instead of creating an initramfs image, dracut will create an UEFI executable,
5c57209b
HH
504 which can be executed by an UEFI BIOS. The default output filename is
505 _<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_. <EFI> might be
506 _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted.
507 The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
508 _/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.
509
510**--no-machineid**::
511 affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
512 part.
636d2d46 513
ca96509c 514**--uefi-stub _<FILE>_**::
636d2d46
HH
515 Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
516 kernel command line and boots the kernel. The default is
53475faa
HH
517 _$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
518 or _$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
636d2d46 519
4237aeb0
DT
520**--uefi-splash-image _<FILE>_**::
521 Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
522 format.
523
ca96509c 524**--kernel-image _<FILE>_**::
636d2d46
HH
525 Specifies the kernel image, which to include in the UEFI executable. The default is
526 _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
527
bd98b884
HH
528ENVIRONMENT
529-----------
530
531_INITRD_COMPRESS_::
532 sets the default compression program. See **--compress**.
533
4efcd19a
BZ
534_DRACUT_LDCONFIG_::
535 sets the _ldconfig_ program path and options. Optional.
536 Used for **--sysroot**.
537+
538Default:
539 _ldconfig_
540
541_DRACUT_LDD_::
542 sets the _ldd_ program path and options. Optional.
543 Used for **--sysroot**.
544+
545Default:
546 _ldd_
547
548_DRACUT_TESTBIN_::
549 sets the initially tested binary for detecting library paths.
550 Optional. Used for **--sysroot**. In the cross-compiled sysroot,
551 the default value (_/bin/sh_) is unusable, as it is an absolute
552 symlink and points outside the sysroot directory.
553+
554Default:
555 _/bin/sh_
556
557_DRACUT_INSTALL_::
558 overrides path and options for executing _dracut-install_ internally.
559 Optional. Can be used to debug _dracut-install_ while running the
560 main dracut script.
561+
562Default:
563 _dracut-install_
564+
565Example:
566 DRACUT_INSTALL="valgrind dracut-install"
567
568_DRACUT_COMPRESS_BZIP2_::
569_DRACUT_COMPRESS_BZIP2_::
570_DRACUT_COMPRESS_LBZIP2_::
571_DRACUT_COMPRESS_LZMA_::
572_DRACUT_COMPRESS_XZ_::
573_DRACUT_COMPRESS_GZIP_::
574_DRACUT_COMPRESS_PIGZ_::
575_DRACUT_COMPRESS_LZOP_::
576_DRACUT_COMPRESS_ZSTD_::
577_DRACUT_COMPRESS_LZ4_::
578_DRACUT_COMPRESS_CAT_::
579 overrides for compression utilities to support using them from
580 non-standard paths.
581+
582Default values are the default compression utility names to be found in **PATH**.
583
584_DRACUT_ARCH_::
585 overrides the value of **uname -m**. Used for **--sysroot**.
586+
587Default:
588 _empty_ (the value of **uname -m** on the host system)
589
590_SYSTEMD_VERSION_::
591 overrides systemd version. Used for **--sysroot**.
592
593_DRACUT_INSTALL_PATH_::
594 overrides **PATH** environment for **dracut-install** to look for
595 binaries relative to **--sysroot**. In a cross-compiled environment
596 (e.g. Yocto), PATH points to natively built binaries that are not
597 in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain
598 /bin and /usr/bin that are relative to the cross-compiled sysroot.
599+
600Default:
601 _PATH_
602
603_DRACUT_INSTALL_LOG_TARGET_::
604 overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows
605 running **dracut-install* to run with different log target that
606 **dracut** runs with.
607+
608Default:
609 _DRACUT_LOG_TARGET_
610
611_DRACUT_INSTALL_LOG_LEVEL_::
612 overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows
613 running **dracut-install* to run with different log level that
614 **dracut** runs with.
615+
616Default:
617 _DRACUT_LOG_LEVEL_
618
888d53f2
HH
619FILES
620-----
621_/var/log/dracut.log_::
622 logfile of initramfs image creation
623
624_/tmp/dracut.log_::
625 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
626 writable
627
628_/etc/dracut.conf_::
629 see dracut.conf5
630
631_/etc/dracut.conf.d/*.conf_::
632 see dracut.conf5
633
c4e098a5
HH
634_/usr/lib/dracut/dracut.conf.d/*.conf_::
635 see dracut.conf5
636
888d53f2
HH
637Configuration in the initramfs
638~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
639_/etc/conf.d/_::
640 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
641 set initial values. Command line options will override these values
642 set in the configuration files.
643
644_/etc/cmdline_::
ef9ddb91
HH
645 Can contain additional command line options. Deprecated, better use
646 /etc/cmdline.d/*.conf.
3cff5fb5 647
b6c89768 648_/etc/cmdline.d/*.conf_::
888d53f2
HH
649 Can contain additional command line options.
650
651AVAILABILITY
652------------
653The dracut command is part of the dracut package and is available from
654link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
655
656AUTHORS
657-------
9f355169 658Harald Hoyer
888d53f2 659
9f355169 660Victor Lowther
888d53f2 661
9f355169 662Philippe Seewer
888d53f2 663
9f355169 664Warren Togami
888d53f2 665
9f355169 666Amadeusz Żołnowski
888d53f2 667
9f355169 668Jeremy Katz
888d53f2 669
9f355169 670David Dillow
888d53f2 671
9f355169 672Will Woods
888d53f2
HH
673
674SEE ALSO
675--------
820f8101 676*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)