]> git.ipfire.org Git - thirdparty/dracut.git/blame_incremental - man/dracut.8.asc
feat(dracut.sh): add "--enhanced-cpio" option for calling dracut-cpio
[thirdparty/dracut.git] / man / dracut.8.asc
... / ...
CommitLineData
1DRACUT(8)
2=========
3:doctype: manpage
4:man source: dracut
5:man manual: dracut
6:man version: {version}
7
8NAME
9----
10dracut - low-level tool for generating an initramfs/initrd image
11
12SYNOPSIS
13--------
14*dracut* [__OPTION...__] [__<image>__ [__<kernel version>__]]
15
16DESCRIPTION
17-----------
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
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
32Initramfs images are also called "initrd".
33
34For a complete list of kernel command line options see *dracut.cmdline*(7).
35
36If you are dropped to an emergency shell, while booting your initramfs,
37the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
38(to be mounted by hand) partition (usually /boot) or a USB stick.
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.
42
43USAGE
44-----
45
46include::dracut.usage.asc[]
47
48OPTIONS
49-------
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
57**-f, --force**::
58 overwrite existing initramfs file.
59
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.
63+
64[NOTE]
65===============================
66If [LIST] has multiple arguments, then you have to put these in quotes. For
67example:
68----
69# dracut --add "module1 module2" ...
70----
71===============================
72
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.
77+
78[NOTE]
79===============================
80If [LIST] has multiple arguments, then you have to put these in quotes. For
81example:
82----
83# dracut --force-add "module1 module2" ...
84----
85===============================
86
87**-o, --omit** _<list of dracut modules>_::
88 omit a space-separated list of dracut modules. This parameter can be
89 specified multiple times.
90+
91[NOTE]
92===============================
93If [LIST] has multiple arguments, then you have to put these in quotes. For
94example:
95----
96# dracut --omit "module1 module2" ...
97----
98===============================
99
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.
106+
107[NOTE]
108===============================
109If [LIST] has multiple arguments, then you have to put these in quotes. For
110example:
111----
112# dracut --modules "module1 module2" ...
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===============================
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===============================
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.
176+
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
193**--kernel-cmdline <parameters>**::
194 specify default kernel command line parameters
195
196
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
203**--early-microcode**::
204 Combine early microcode with ramdisk
205
206**--no-early-microcode**::
207 Do not combine early microcode with ramdisk
208
209**--print-cmdline**::
210 print the kernel command line for the current disk layout
211
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**::
242 strip binaries in the initramfs (default)
243
244**--nostrip**::
245 do not strip binaries in the initramfs
246
247**--hardlink**::
248 hardlink files in the initramfs (default)
249
250**--nohardlink**::
251 do not hardlink files in the initramfs
252
253**--prefix** _<dir>_::
254 prefix initramfs files with the specified directory
255
256**--noprefix**::
257 do not prefix initramfs files (default)
258
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**--version**::
269 display version and exit
270
271**-q, --quiet**:: decrease verbosity level (default is info(4))
272
273**-c, --conf** _<dracut configuration file>_::
274 specify configuration file to use.
275+
276Default:
277 _/etc/dracut.conf_
278
279**--confdir** _<configuration directory>_::
280 specify configuration directory to use.
281+
282Default:
283 _/etc/dracut.conf.d_
284
285**--tmpdir** _<temporary directory>_::
286 specify temporary directory to use.
287+
288Default:
289 _/var/tmp_
290
291**-r, --sysroot** _<sysroot directory>_::
292 specify the sysroot directory to collect files from.
293 This is useful to create the initramfs image from
294 a cross-compiled sysroot directory. For the extra helper
295 variables, see *ENVIRONMENT* below.
296+
297Default:
298 _empty_
299
300**--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
301
302**--logfile** _<logfile>_:: logfile to use; overrides any setting from
303 the configuration files.
304+
305Default:
306 _/var/log/dracut.log_
307
308**-l, --local**::
309 activates the local mode. dracut will use modules from the current working
310 directory instead of the system-wide installed modules in
311 _/usr/lib/dracut/modules.d_.
312 This is useful when running dracut from a git checkout.
313
314**-H, --hostonly**::
315 Host-Only mode: Install only what is needed for booting the local host
316 instead of a generic host and generate host-specific configuration.
317+
318[WARNING]
319====
320If chrooted to another root other than the real root device, use "--fstab" and
321provide a valid _/etc/fstab_.
322====
323
324**-N, --no-hostonly**::
325 Disable Host-Only mode
326
327**--hostonly-cmdline**:
328 Store kernel command line arguments needed in the initramfs
329
330**--no-hostonly-cmdline**:
331 Do not store kernel command line arguments needed in the initramfs
332
333**--no-hostonly-default-device**:
334 Do not generate implicit host devices like root, swap, fstab, etc.
335 Use "--mount" or "--add-device" to explicitly add devices as needed.
336
337**--hostonly-i18n**:
338 Install only needed keyboard and font files according to the host configuration (default).
339
340**--no-hostonly-i18n**:
341 Install all keyboard and font files available.
342
343**--persistent-policy** _<policy>_::
344 Use _<policy>_ to address disks and partitions.
345 _<policy>_ can be any directory name found in /dev/disk.
346 E.g. "by-uuid", "by-label"
347
348**--fstab**::
349 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
350
351**--add-fstab** _<filename>_::
352 Add entries of _<filename>_ to the initramfs /etc/fstab.
353
354**--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ [_<filesystem options>_ [_<dump frequency>_ [_<fsck order>_]]]"::
355 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ in the
356 initramfs. _<filesystem options>_, _<dump options>_ and _<fsck order>_ can
357 be specified, see fstab manpage for the details.
358 The default _<filesystem options>_ is "defaults".
359 The default _<dump frequency>_ is "0".
360 the default _<fsck order>_ is "2".
361
362**--mount** "_<mountpoint>_"::
363 Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
364 are determined by looking at the current mounts.
365
366**--add-device** _<device>_ ::
367 Bring up _<device>_ in initramfs, _<device>_ should be the device name.
368 This can be useful in hostonly mode for resume support when your swap is on
369 LVM or an encrypted partition.
370 [NB --device can be used for compatibility with earlier releases]
371
372**-i, --include** _<SOURCE>_ _<TARGET>_::
373 include the files in the SOURCE directory into the
374 TARGET directory in the final initramfs. If SOURCE is a file, it will be
375 installed to TARGET in the final initramfs. This parameter can be specified
376 multiple times.
377
378**-I, --install** _<file list>_::
379 install the space separated list of files into the initramfs.
380+
381[NOTE]
382===============================
383If [LIST] has multiple arguments, then you have to put these in quotes. For
384example:
385----
386# dracut --install "/bin/foo /sbin/bar" ...
387----
388===============================
389
390**--install-optional** _<file list>_::
391 install the space separated list of files into the initramfs, if they exist.
392
393**--gzip**::
394 Compress the generated initramfs using gzip. This will be done by default,
395 unless another compression option or --no-compress is passed. Equivalent to
396 "--compress=gzip -9"
397
398**--bzip2**::
399 Compress the generated initramfs using bzip2.
400+
401[WARNING]
402====
403Make sure your kernel has bzip2 decompression support compiled in, otherwise you
404will not be able to boot. Equivalent to "--compress=bzip2"
405====
406
407**--lzma**::
408 Compress the generated initramfs using lzma.
409+
410[WARNING]
411====
412Make sure your kernel has lzma decompression support compiled in, otherwise you
413will not be able to boot. Equivalent to "lzma --compress=lzma -9"
414====
415
416**--xz**::
417 Compress the generated initramfs using xz.
418+
419[WARNING]
420====
421Make sure your kernel has xz decompression support compiled in, otherwise you
422will not be able to boot. Equivalent to
423"lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
424====
425
426**--lzo**::
427 Compress the generated initramfs using lzop.
428[WARNING]
429====
430Make sure your kernel has lzo decompression support compiled in, otherwise you
431will not be able to boot.
432====
433
434**--lz4**::
435 Compress the generated initramfs using lz4.
436[WARNING]
437====
438Make sure your kernel has lz4 decompression support compiled in, otherwise you
439will not be able to boot.
440====
441
442**--zstd**::
443 Compress the generated initramfs using Zstandard.
444[WARNING]
445====
446Make sure your kernel has zstd decompression support compiled in, otherwise you
447will not be able to boot.
448====
449
450**--compress** _<compressor>_::
451 Compress the generated initramfs using the passed compression program. If
452 you pass it just the name of a compression program, it will call that
453 program with known-working arguments. If you pass a quoted string with
454 arguments, it will be called with exactly those arguments. Depending on what
455 you pass, this may result in an initramfs that the kernel cannot decompress.
456 The default value can also be set via the _INITRD_COMPRESS_ environment variable.
457
458**--no-compress**::
459 Do not compress the generated initramfs. This will override any other
460 compression options.
461
462**--reproducible**::
463 Create reproducible images.
464
465**--no-reproducible**::
466 Do not create reproducible images.
467
468**--list-modules**::
469 List all available dracut modules.
470
471**-M, --show-modules**::
472 Print included module's name to standard output during build.
473
474**--keep**::
475 Keep the initramfs temporary directory for debugging purposes.
476
477**--printsize**::
478 Print out the module install size
479
480**--profile**:
481 Output profile information of the build process
482
483**--ro-mnt**:
484 Mount / and /usr read-only by default.
485
486**-L, --stdlog** _<level>_::
487 [0-6] Specify logging level (to standard error)
488----
489 0 - suppress any messages
490 1 - only fatal errors
491 2 - all errors
492 3 - warnings
493 4 - info
494 5 - debug info (here starts lots of output)
495 6 - trace info (and even more)
496----
497
498**--regenerate-all**::
499 Regenerate all initramfs images at the default location with the kernel
500 versions found on the system. Additional parameters are passed through.
501
502**--loginstall _<DIR>_**::
503 Log all files installed from the host to _<DIR>_.
504
505**--uefi**::
506 Instead of creating an initramfs image, dracut will create an UEFI executable,
507 which can be executed by an UEFI BIOS. The default output filename is
508 _<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_. <EFI> might be
509 _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP partition is mounted.
510 The <BUILD_ID> is taken from BUILD_ID in _/usr/lib/os-release_ or if it exists
511 _/etc/os-release_ and is left out, if BUILD_ID is non-existant or empty.
512
513**--no-uefi**::
514 Disables UEFI mode.
515
516**--no-machineid**::
517 affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
518 part.
519
520**--uefi-stub _<FILE>_**::
521 Specifies the UEFI stub loader, which will load the attached kernel, initramfs and
522 kernel command line and boots the kernel. The default is
523 _$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_
524
525**--uefi-splash-image _<FILE>_**::
526 Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
527 format.
528
529**--kernel-image _<FILE>_**::
530 Specifies the kernel image, which to include in the UEFI executable. The default is
531 _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or _/boot/vmlinuz-<KERNEL-VERSION>_
532
533**--enhanced-cpio**::
534 Attempt to use the dracut-cpio binary, which optimizes archive creation for
535 copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
536 io::copy(). When specified, initramfs archives are also padded to ensure
537 optimal data alignment for extent sharing. To retain reflink data
538 deduplication benefits, this should be used alongside the **--no-compress**
539 and **--no-strip** parameters, with initramfs source files, **--tmpdir**
540 staging area and destination all on the same copy-on-write capable filesystem.
541
542ENVIRONMENT
543-----------
544
545_INITRD_COMPRESS_::
546 sets the default compression program. See **--compress**.
547
548_DRACUT_LDCONFIG_::
549 sets the _ldconfig_ program path and options. Optional.
550 Used for **--sysroot**.
551+
552Default:
553 _ldconfig_
554
555_DRACUT_LDD_::
556 sets the _ldd_ program path and options. Optional.
557 Used for **--sysroot**.
558+
559Default:
560 _ldd_
561
562_DRACUT_TESTBIN_::
563 sets the initially tested binary for detecting library paths.
564 Optional. Used for **--sysroot**. In the cross-compiled sysroot,
565 the default value (_/bin/sh_) is unusable, as it is an absolute
566 symlink and points outside the sysroot directory.
567+
568Default:
569 _/bin/sh_
570
571_DRACUT_INSTALL_::
572 overrides path and options for executing _dracut-install_ internally.
573 Optional. Can be used to debug _dracut-install_ while running the
574 main dracut script.
575+
576Default:
577 _dracut-install_
578+
579Example:
580 DRACUT_INSTALL="valgrind dracut-install"
581
582_DRACUT_COMPRESS_BZIP2_::
583_DRACUT_COMPRESS_BZIP2_::
584_DRACUT_COMPRESS_LBZIP2_::
585_DRACUT_COMPRESS_LZMA_::
586_DRACUT_COMPRESS_XZ_::
587_DRACUT_COMPRESS_GZIP_::
588_DRACUT_COMPRESS_PIGZ_::
589_DRACUT_COMPRESS_LZOP_::
590_DRACUT_COMPRESS_ZSTD_::
591_DRACUT_COMPRESS_LZ4_::
592_DRACUT_COMPRESS_CAT_::
593 overrides for compression utilities to support using them from
594 non-standard paths.
595+
596Default values are the default compression utility names to be found in **PATH**.
597
598_DRACUT_ARCH_::
599 overrides the value of **uname -m**. Used for **--sysroot**.
600+
601Default:
602 _empty_ (the value of **uname -m** on the host system)
603
604_SYSTEMD_VERSION_::
605 overrides systemd version. Used for **--sysroot**.
606
607_SYSTEMCTL_::
608 overrides the systemctl binary. Used for **--sysroot**.
609
610_NM_VERSION_::
611 overrides the NetworkManager version. Used for **--sysroot**.
612
613_DRACUT_INSTALL_PATH_::
614 overrides **PATH** environment for **dracut-install** to look for
615 binaries relative to **--sysroot**. In a cross-compiled environment
616 (e.g. Yocto), PATH points to natively built binaries that are not
617 in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain
618 /bin and /usr/bin that are relative to the cross-compiled sysroot.
619+
620Default:
621 _PATH_
622
623_DRACUT_INSTALL_LOG_TARGET_::
624 overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows
625 running **dracut-install* to run with different log target that
626 **dracut** runs with.
627+
628Default:
629 _DRACUT_LOG_TARGET_
630
631_DRACUT_INSTALL_LOG_LEVEL_::
632 overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows
633 running **dracut-install* to run with different log level that
634 **dracut** runs with.
635+
636Default:
637 _DRACUT_LOG_LEVEL_
638
639FILES
640-----
641_/var/log/dracut.log_::
642 logfile of initramfs image creation
643
644_/tmp/dracut.log_::
645 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
646 writable
647
648_/etc/dracut.conf_::
649 see dracut.conf5
650
651_/etc/dracut.conf.d/*.conf_::
652 see dracut.conf5
653
654_/usr/lib/dracut/dracut.conf.d/*.conf_::
655 see dracut.conf5
656
657Configuration in the initramfs
658~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
659_/etc/conf.d/_::
660 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
661 set initial values. Command line options will override these values
662 set in the configuration files.
663
664_/etc/cmdline_::
665 Can contain additional command line options. Deprecated, better use
666 /etc/cmdline.d/*.conf.
667
668_/etc/cmdline.d/*.conf_::
669 Can contain additional command line options.
670
671AVAILABILITY
672------------
673The dracut command is part of the dracut package and is available from
674link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
675
676AUTHORS
677-------
678Harald Hoyer
679
680Victor Lowther
681
682Amadeusz Żołnowski
683
684Hannes Reinecke
685
686Daniel Molkentin
687
688Will Woods
689
690Philippe Seewer
691
692Warren Togami
693
694SEE ALSO
695--------
696*dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)