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