6 :man version: {version}
10 dracut - low-level tool for generating an initramfs/initrd image
14 *dracut* [__OPTION...__] [__<image>__ [__<kernel version>__]]
19 Create an initramfs <image> for the kernel with the version <kernel version>.
20 If <kernel version> is omitted, then the version of the actual running
21 kernel is used. If <image> is omitted or empty, depending on bootloader
22 specification, the default location can be
23 _/efi/<machine-id>/<kernel-version>/initrd_,
24 _/boot/<machine-id>/<kernel-version>/initrd_,
25 _/boot/efi/<machine-id>/<kernel-version>/initrd_,
26 _/lib/modules/<kernel-version>/initrd_ or
27 _/boot/initramfs-<kernel-version>.img_.
29 dracut creates an initial image used by the kernel for preloading the block
30 device modules (such as IDE, SCSI or RAID) which are needed to access the root
31 filesystem, mounting the root filesystem and booting into the real system.
33 At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
34 as initial root file system. All finding of the root device happens in this
37 Initramfs images are also called "initrd".
39 For a complete list of kernel command line options see *dracut.cmdline*(7).
41 If you are dropped to an emergency shell, while booting your initramfs,
42 the file _/run/initramfs/rdsosreport.txt_ is created, which can be saved to a
43 (to be mounted by hand) partition (usually /boot) or a USB stick.
44 Additional debugging info can be produced by adding **rd.debug** to the kernel
45 command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
46 of some tools. It should be attached to any report about dracut problems.
51 include::dracut.usage.asc[]
55 **--kver** _<kernel version>_::
56 Set the kernel version. This enables to specify the kernel version, without
57 specifying the location of the initramfs image. For example:
59 # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
63 Overwrite existing initramfs file.
65 _<output file>_ **--rebuild**::
66 Append the current arguments to those with which the input initramfs image
67 was built. This option helps in incrementally building the initramfs for
68 testing. If optional _<output file>_ is not provided, the input initramfs
69 provided to rebuild will be used as output file.
71 **-a, --add** _<list of dracut modules>_::
72 Add a space-separated list of dracut modules to the default set of modules.
73 This parameter can be specified multiple times.
76 ===============================
77 If the list has multiple arguments, then you have to put these in quotes. For
80 # dracut --add "module1 module2" ...
82 ===============================
84 **--force-add** _<list of dracut modules>_::
85 Force to add a space-separated list of dracut modules to the default set of
86 modules, when -H is specified. This parameter can be specified multiple
90 ===============================
91 If the list has multiple arguments, then you have to put these in quotes. For
94 # dracut --force-add "module1 module2" ...
96 ===============================
98 **-o, --omit** _<list of dracut modules>_::
99 Omit a space-separated list of dracut modules. This parameter can be
100 specified multiple times.
103 ===============================
104 If the list has multiple arguments, then you have to put these in quotes. For
107 # dracut --omit "module1 module2" ...
109 ===============================
111 **-m, --modules** _<list of dracut modules>_::
112 Specify a space-separated list of dracut modules to call when building the
113 initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
114 parameter can be specified multiple times.
115 This option forces dracut to only include the specified dracut modules.
116 In most cases the "--add" option is what you want to use.
119 ===============================
120 If the list has multiple arguments, then you have to put these in quotes. For
123 # dracut --modules "module1 module2" ...
125 ===============================
127 **-d, --drivers** _<list of kernel modules>_::
128 Specify a space-separated list of kernel modules to exclusively include
129 in the initramfs. The kernel modules have to be specified without the ".ko"
130 suffix. This parameter can be specified multiple times.
133 ===============================
134 If the list has multiple arguments, then you have to put these in quotes. For
137 # dracut --drivers "kmodule1 kmodule2" ...
139 ===============================
141 **--add-drivers** _<list of kernel modules>_::
142 Specify a space-separated list of kernel modules to add to the initramfs.
143 The kernel modules have to be specified without the ".ko" suffix. This
144 parameter can be specified multiple times.
147 ===============================
148 If the list has multiple arguments, then you have to put these in quotes. For
151 # dracut --add-drivers "kmodule1 kmodule2" ...
153 ===============================
155 **--force-drivers** _<list of kernel modules>_::
156 See add-drivers above. But in this case it is ensured that the drivers
157 are tried to be loaded early via modprobe.
160 ===============================
161 If the list has multiple arguments, then you have to put these in quotes. For
164 # dracut --force-drivers "kmodule1 kmodule2" ...
166 ===============================
168 **--omit-drivers** _<list of kernel modules>_::
169 Specify a space-separated list of kernel modules not to add to the
171 The kernel modules have to be specified without the ".ko" suffix. This
172 parameter can be specified multiple times.
175 ===============================
176 If the list has multiple arguments, then you have to put these in quotes. For
179 # dracut --omit-drivers "kmodule1 kmodule2" ...
181 ===============================
183 **--filesystems** _<list of filesystems>_::
184 Specify a space-separated list of kernel filesystem modules to exclusively
185 include in the generic initramfs. This parameter can be specified multiple
189 ===============================
190 If the list has multiple arguments, then you have to put these in quotes. For
193 # dracut --filesystems "filesystem1 filesystem2" ...
195 ===============================
197 **-k, --kmoddir** _<kernel directory>_::
198 Specify the directory, where to look for kernel modules.
200 **--fwdir** _<dir>[:<dir>...]++_::
201 Specify additional directories, where to look for firmwares. This parameter
202 can be specified multiple times.
204 **--libdirs** _<list of directories>_::
205 Specify a space-separated list of directories to look for libraries to
206 include in the generic initramfs. This parameter can be specified multiple
210 ===============================
211 If the list has multiple arguments, then you have to put these in quotes. For
214 # dracut --libdirs "dir1 dir2" ...
216 ===============================
218 **--kernel-cmdline <parameters>**::
219 Specify default kernel command line parameters.
222 Only install kernel drivers and firmware files.
225 Do not install kernel drivers and firmware files.
227 **--early-microcode**::
228 Combine early microcode with ramdisk.
230 **--no-early-microcode**::
231 Do not combine early microcode with ramdisk.
233 **--print-cmdline**::
234 Print the kernel command line for the current disk layout.
237 Include local _/etc/mdadm.conf_ file.
240 Do not include local _/etc/mdadm.conf_ file.
243 Include local _/etc/lvm/lvm.conf_ file.
246 Do not include local _/etc/lvm/lvm.conf_ file.
248 **--fscks** _<list of fsck tools>_::
249 Add a space-separated list of fsck tools, in addition to _dracut.conf_'s
250 specification; the installation is opportunistic (non-existing tools are
254 ===============================
255 If the list has multiple arguments, then you have to put these in quotes. For
258 # dracut --fscks "fsck.foo barfsck" ...
260 ===============================
263 Inhibit installation of any fsck tools.
266 Strip binaries in the initramfs (default).
268 **--aggressive-strip**::
269 Strip more than just debug symbol and sections, for a smaller initramfs
270 build. The --strip option must also be specified.
273 Do not strip binaries in the initramfs.
276 Hardlink files in the initramfs (default).
279 Do not hardlink files in the initramfs.
281 **--prefix** _<dir>_::
282 Prefix initramfs files with the specified directory.
285 Do not prefix initramfs files (default).
288 Display help text and exit.
291 Output debug information of the build process.
294 Increase verbosity level (default is info(4)).
297 Display version and exit.
300 Decrease verbosity level (default is info(4)).
302 **-c, --conf** _<dracut configuration file>_::
303 Specify configuration file to use.
308 **--confdir** _<configuration directory>_::
309 Specify configuration directory to use.
314 **--tmpdir** _<temporary directory>_::
315 Specify temporary directory to use.
320 **-r, --sysroot** _<sysroot directory>_::
321 Specify the sysroot directory to collect files from.
322 This is useful to create the initramfs image from
323 a cross-compiled sysroot directory. For the extra helper
324 variables, see *ENVIRONMENT* below.
329 **--sshkey** _<sshkey file>_::
330 SSH key file used with ssh-client module.
332 **--logfile** _<logfile>_::
333 Logfile to use; overrides any setting from the configuration files.
336 _/var/log/dracut.log_
339 Activates the local mode. dracut will use modules from the current working
340 directory instead of the system-wide installed modules in
341 _/usr/lib/dracut/modules.d_.
342 This is useful when running dracut from a git checkout.
345 Host-only mode: Install only what is needed for booting the local host
346 instead of a generic host and generate host-specific configuration.
350 If chrooted to another root other than the real root device, use "--fstab" and
351 provide a valid _/etc/fstab_.
354 **-N, --no-hostonly**::
355 Disable host-only mode.
357 **--hostonly-mode _<mode>_**::
358 Specify the host-only mode to use. _<mode>_ could be one of "sloppy" or
360 In "sloppy" host-only mode, extra drivers and modules will be installed, so
361 minor hardware change won't make the image unbootable (e.g. changed
362 keyboard), and the image is still portable among similar hosts.
363 With "strict" mode enabled, anything not necessary for booting the local
364 host in its current state will not be included, and modules may do some
365 extra job to save more space. Minor change of hardware or environment could
366 make the image unbootable.
371 **--hostonly-cmdline**::
372 Store kernel command line arguments needed in the initramfs.
374 **--no-hostonly-cmdline**::
375 Do not store kernel command line arguments needed in the initramfs.
377 **--no-hostonly-default-device**::
378 Do not generate implicit host devices like root, swap, fstab, etc.
379 Use "--mount" or "--add-device" to explicitly add devices as needed.
381 **--hostonly-i18n**::
382 Install only needed keyboard and font files according to the host
383 configuration (default).
385 **--no-hostonly-i18n**::
386 Install all keyboard and font files available.
388 **--hostonly-nics** _<list of nics>_::
389 Only enable listed NICs in the initramfs. The list can be empty, so other
390 modules can install only the necessary network drivers.
392 **--persistent-policy** _<policy>_::
393 Use _<policy>_ to address disks and partitions.
394 _<policy>_ can be any directory name found in /dev/disk.
395 E.g. "by-uuid", "by-label"
398 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
400 **--add-fstab** _<filename>_::
401 Add entries of _<filename>_ to the initramfs /etc/fstab.
403 **--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ [_<filesystem options>_ [_<dump frequency>_ [_<fsck order>_]]]"::
404 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ in the
405 initramfs. _<filesystem options>_, _<dump options>_ and _<fsck order>_ can
406 be specified, see fstab manpage for the details.
407 The default _<filesystem options>_ is "defaults".
408 The default _<dump frequency>_ is "0".
409 The default _<fsck order>_ is "2".
411 **--mount** "_<mountpoint>_"::
412 Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
413 are determined by looking at the current mounts.
415 **--add-device** _<device>_ ::
416 Bring up _<device>_ in initramfs, _<device>_ should be the device name.
417 This can be useful in host-only mode for resume support when your swap is on
418 LVM or an encrypted partition.
419 [NB --device can be used for compatibility with earlier releases]
421 **-i, --include** _<SOURCE>_ _<TARGET>_::
422 Include the files in the SOURCE directory into the
423 TARGET directory in the final initramfs. If SOURCE is a file, it will be
424 installed to TARGET in the final initramfs. This parameter can be specified
427 **-I, --install** _<file list>_::
428 Install the space separated list of files into the initramfs.
431 ===============================
432 If the list has multiple arguments, then you have to put these in quotes. For
435 # dracut --install "/bin/foo /sbin/bar" ...
437 ===============================
439 **--install-optional** _<file list>_::
440 Install the space separated list of files into the initramfs, if they exist.
443 Compress the generated initramfs using gzip. This will be done by default,
444 unless another compression option or --no-compress is passed. Equivalent to
445 "--compress=gzip -9".
448 Compress the generated initramfs using bzip2.
452 Make sure your kernel has bzip2 decompression support compiled in, otherwise you
453 will not be able to boot. Equivalent to "--compress=bzip2 -9".
457 Compress the generated initramfs using lzma.
461 Make sure your kernel has lzma decompression support compiled in, otherwise you
462 will not be able to boot. Equivalent to "--compress=lzma -9 -T0".
466 Compress the generated initramfs using xz.
470 Make sure your kernel has xz decompression support compiled in, otherwise you
471 will not be able to boot. Equivalent to
472 "--compress=xz --check=crc32 --lzma2=dict=1MiB -T0".
476 Compress the generated initramfs using lzop.
480 Make sure your kernel has lzo decompression support compiled in, otherwise you
481 will not be able to boot. Equivalent to "--compress=lzop -9".
485 Compress the generated initramfs using lz4.
489 Make sure your kernel has lz4 decompression support compiled in, otherwise you
490 will not be able to boot. Equivalent to "--compress=lz4 -l -9".
494 Compress the generated initramfs using Zstandard.
498 Make sure your kernel has zstd decompression support compiled in, otherwise you
499 will not be able to boot. Equivalent to "--compress=zstd -15 -q -T0".
502 **--compress** _<compressor>_::
503 Compress the generated initramfs using the passed compression program. If
504 you pass it just the name of a compression program, it will call that
505 program with known-working arguments. If you pass a quoted string with
506 arguments, it will be called with exactly those arguments. Depending on what
507 you pass, this may result in an initramfs that the kernel cannot decompress.
508 The default value can also be set via the _INITRD_COMPRESS_ environment
511 **--squash-compressor** _<compressor>_::
512 Compress the squashfs image using the passed compressor and compressor
513 specific options for mksquashfs. You can refer to mksquashfs manual for
514 supported compressors and compressor specific options. If squash module is
515 not called when building the initramfs, this option will not take effect.
518 Do not compress the generated initramfs. This will override any other
522 Create reproducible images.
524 **--no-reproducible**::
525 Do not create reproducible images.
528 List all available dracut modules.
530 **-M, --show-modules**::
531 Print included module's name to standard output during build.
534 Keep the initramfs temporary directory for debugging purposes.
537 Print out the module install size.
540 Output profile information of the build process.
543 Mount / and /usr read-only by default.
545 **-L, --stdlog** _<level>_::
546 [0-6] Specify logging level (to standard error).
548 0 - suppress any messages
549 1 - only fatal errors
553 5 - debug info (here starts lots of output)
554 6 - trace info (and even more)
557 **--regenerate-all**::
558 Regenerate all initramfs images at the default location with the kernel
559 versions found on the system. Additional parameters are passed through.
562 Try to execute tasks in parallel. Currently only supported with
563 **--regenerate-all** (build initramfs images for all kernel
564 versions simultaneously).
566 **--noimageifnotneeded**::
567 Do not create an image in host-only mode, if no kernel driver is needed
568 and no /etc/cmdline/*.conf will be generated into the initramfs.
570 **--loginstall _<directory>_**::
571 Log all files installed from the host to _<directory>_.
574 Instead of creating an initramfs image, dracut will create an UEFI
575 executable, which can be executed by an UEFI BIOS. The default output
576 filename is _<EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi_.
577 <EFI> might be _/efi_, _/boot_ or _/boot/efi_ depending on where the ESP
578 partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
579 _/usr/lib/os-release_ or if it exists _/etc/os-release_ and is left out,
580 if BUILD_ID is non-existant or empty.
586 Affects the default output filename of **--uefi** and will discard the
589 **--uefi-stub _<file>_**::
590 Specifies the UEFI stub loader, which will load the attached kernel,
591 initramfs and kernel command line and boots the kernel. The default is
592 _$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub_.
594 **--uefi-splash-image _<file>_**::
595 Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**)
598 **--kernel-image _<file>_**::
599 Specifies the kernel image, which to include in the UEFI executable. The
600 default is _/lib/modules/<KERNEL-VERSION>/vmlinuz_ or
601 _/boot/vmlinuz-<KERNEL-VERSION>_.
603 **--enhanced-cpio**::
604 Attempt to use the dracut-cpio binary, which optimizes archive creation for
605 copy-on-write filesystems by using the copy_file_range(2) syscall via Rust's
606 io::copy(). When specified, initramfs archives are also padded to ensure
607 optimal data alignment for extent sharing. To retain reflink data
608 deduplication benefits, this should be used alongside the **--no-compress**
609 and **--nostrip** parameters, with initramfs source files, **--tmpdir**
610 staging area and destination all on the same copy-on-write capable
617 sets the default compression program. See **--compress**.
620 sets the _ldconfig_ program path and options. Optional.
621 Used for **--sysroot**.
627 sets the _ldd_ program path and options. Optional.
628 Used for **--sysroot**.
634 sets the initially tested binary for detecting library paths.
635 Optional. Used for **--sysroot**. In the cross-compiled sysroot,
636 the default value (_/bin/sh_) is unusable, as it is an absolute
637 symlink and points outside the sysroot directory.
643 overrides path and options for executing _dracut-install_ internally.
644 Optional. Can be used to debug _dracut-install_ while running the
651 DRACUT_INSTALL="valgrind dracut-install"
653 _DRACUT_COMPRESS_BZIP2_::
654 _DRACUT_COMPRESS_BZIP2_::
655 _DRACUT_COMPRESS_LBZIP2_::
656 _DRACUT_COMPRESS_LZMA_::
657 _DRACUT_COMPRESS_XZ_::
658 _DRACUT_COMPRESS_GZIP_::
659 _DRACUT_COMPRESS_PIGZ_::
660 _DRACUT_COMPRESS_LZOP_::
661 _DRACUT_COMPRESS_ZSTD_::
662 _DRACUT_COMPRESS_LZ4_::
663 _DRACUT_COMPRESS_CAT_::
664 overrides for compression utilities to support using them from
667 Default values are the default compression utility names to be found in **PATH**.
670 overrides the value of **uname -m**. Used for **--sysroot**.
673 _empty_ (the value of **uname -m** on the host system)
676 overrides systemd version. Used for **--sysroot**.
679 overrides the systemctl binary. Used for **--sysroot**.
682 overrides the NetworkManager version. Used for **--sysroot**.
684 _DRACUT_INSTALL_PATH_::
685 overrides **PATH** environment for **dracut-install** to look for
686 binaries relative to **--sysroot**. In a cross-compiled environment
687 (e.g. Yocto), PATH points to natively built binaries that are not
688 in the host's /bin, /usr/bin, etc. **dracut-install** still needs plain
689 /bin and /usr/bin that are relative to the cross-compiled sysroot.
694 _DRACUT_INSTALL_LOG_TARGET_::
695 overrides **DRACUT_LOG_TARGET** for **dracut-install**. It allows
696 running **dracut-install* to run with different log target that
697 **dracut** runs with.
702 _DRACUT_INSTALL_LOG_LEVEL_::
703 overrides **DRACUT_LOG_LEVEL** for **dracut-install**. It allows
704 running **dracut-install* to run with different log level that
705 **dracut** runs with.
712 _/var/log/dracut.log_::
713 logfile of initramfs image creation
716 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
722 _/etc/dracut.conf.d/*.conf_::
725 _/usr/lib/dracut/dracut.conf.d/*.conf_::
728 Configuration in the initramfs
729 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
731 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
732 set initial values. Command line options will override these values
733 set in the configuration files.
736 Can contain additional command line options. Deprecated, better use
737 /etc/cmdline.d/*.conf.
739 _/etc/cmdline.d/*.conf_::
740 Can contain additional command line options.
744 The dracut command is part of the dracut package and is available from
745 link:$$https://github.com/dracutdevs/dracut$$[https://github.com/dracutdevs/dracut]
767 *dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)