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, then the default location
22 /boot/initramfs-<kernel version>.img is used.
24 dracut creates an initial image used by the kernel for preloading the block
25 device modules (such as IDE, SCSI or RAID) which are needed to access the root
26 filesystem, mounting the root filesystem and booting into the real system.
28 At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
29 as initial root file system. All finding of the root device happens in this
32 Initramfs images are also called "initrd".
34 For a complete list of kernel command line options see *dracut.cmdline*(7).
36 If you are dropped to an emergency shell, while booting your initramfs,
37 the 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.
39 Additional debugging info can be produced by adding **rd.debug** to the kernel
40 command line. _/run/initramfs/rdsosreport.txt_ contains all logs and the output
41 of some tools. It should be attached to any report about dracut problems.
46 include::dracut.usage.asc[]
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:
54 # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
58 overwrite existing initramfs file.
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.
65 ===============================
66 If [LIST] has multiple arguments, then you have to put these in quotes. For
69 # dracut --add "module1 module2" ...
71 ===============================
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
79 ===============================
80 If [LIST] has multiple arguments, then you have to put these in quotes. For
83 # dracut --force-add "module1 module2" ...
85 ===============================
87 **-o, --omit** _<list of dracut modules>_::
88 omit a space-separated list of dracut modules. This parameter can be
89 specified multiple times.
92 ===============================
93 If [LIST] has multiple arguments, then you have to put these in quotes. For
96 # dracut --omit "module1 module2" ...
98 ===============================
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.
108 ===============================
109 If [LIST] has multiple arguments, then you have to put these in quotes. For
112 # dracut --modules "module1 module2" ...
114 ===============================
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.
122 ===============================
123 If [LIST] has multiple arguments, then you have to put these in quotes. For
126 # dracut --drivers "kmodule1 kmodule2" ...
128 ===============================
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.
136 ===============================
137 If [LIST] has multiple arguments, then you have to put these in quotes. For
140 # dracut --add-drivers "kmodule1 kmodule2" ...
142 ===============================
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.
149 ===============================
150 If [LIST] has multiple arguments, then you have to put these in quotes. For
153 # dracut --force-drivers "kmodule1 kmodule2" ...
155 ===============================
157 **--omit-drivers** _<list of kernel modules>_::
158 specify a space-separated list of kernel modules not to add to the
160 The kernel modules have to be specified without the ".ko" suffix. This
161 parameter can be specified multiple times.
164 ===============================
165 If [LIST] has multiple arguments, then you have to put these in quotes. For
168 # dracut --omit-drivers "kmodule1 kmodule2" ...
170 ===============================
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
178 ===============================
179 If [LIST] has multiple arguments, then you have to put these in quotes. For
182 # dracut --filesystems "filesystem1 filesystem2" ...
184 ===============================
186 **-k, --kmoddir** _<kernel directory>_::
187 specify the directory, where to look for kernel modules
189 **--fwdir** _<dir>[:<dir>...]++_::
190 specify additional directories, where to look for firmwares. This parameter
191 can be specified multiple times.
193 **--kernel-cmdline <parameters>**::
194 specify default kernel command line parameters
198 only install kernel drivers and firmware files
201 do not install kernel drivers and firmware files
203 **--early-microcode**::
204 Combine early microcode with ramdisk
206 **--no-early-microcode**::
207 Do not combine early microcode with ramdisk
209 **--print-cmdline**::
210 print the kernel command line for the current disk layout
213 include local _/etc/mdadm.conf_
216 do not include local _/etc/mdadm.conf_
219 include local _/etc/lvm/lvm.conf_
222 do not include local _/etc/lvm/lvm.conf_
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
230 ===============================
231 If [LIST] has multiple arguments, then you have to put these in quotes. For
234 # dracut --fscks "fsck.foo barfsck" ...
236 ===============================
239 inhibit installation of any fsck tools
242 strip binaries in the initramfs (default)
245 do not strip binaries in the initramfs
248 hardlink files in the initramfs (default)
251 do not hardlink files in the initramfs
253 **--prefix** _<dir>_::
254 prefix initramfs files with the specified directory
257 do not prefix initramfs files (default)
260 display help text and exit.
263 output debug information of the build process
266 increase verbosity level (default is info(4))
268 **-q, --quiet**:: decrease verbosity level (default is info(4))
270 **-c, --conf** _<dracut configuration file>_::
271 specify configuration file to use.
276 **--confdir** _<configuration directory>_::
277 specify configuration directory to use.
282 **--tmpdir** _<temporary directory>_::
283 specify temporary directory to use.
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.
297 **--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
299 **--logfile** _<logfile>_:: logfile to use; overrides any setting from
300 the configuration files.
303 _/var/log/dracut.log_
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.
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.
317 If chrooted to another root other than the real root device, use "--fstab" and
318 provide a valid _/etc/fstab_.
321 **-N, --no-hostonly**::
322 Disable Host-Only mode
324 **--hostonly-cmdline**:
325 Store kernel command line arguments needed in the initramfs
327 **--no-hostonly-cmdline**:
328 Do not store kernel command line arguments needed in the initramfs
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.
335 Install only needed keyboard and font files according to the host configuration (default).
337 **--no-hostonly-i18n**:
338 Install all keyboard and font files available.
340 **--persistent-policy** _<policy>_::
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"
346 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
348 **--add-fstab** _<filename>_::
349 Add entries of _<filename>_ to the initramfs /etc/fstab.
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".
359 **--mount** "_<mountpoint>_"::
360 Like above, but _<device>_, _<filesystem type>_ and _<filesystem options>_
361 are determined by looking at the current mounts.
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]
369 **-i, --include** _<SOURCE>_ _<TARGET>_::
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
375 **-I, --install** _<file list>_::
376 install the space separated list of files into the initramfs.
379 ===============================
380 If [LIST] has multiple arguments, then you have to put these in quotes. For
383 # dracut --install "/bin/foo /sbin/bar" ...
385 ===============================
387 **--install-optional** _<file list>_::
388 install the space separated list of files into the initramfs, if they exist.
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
396 Compress the generated initramfs using bzip2.
400 Make sure your kernel has bzip2 decompression support compiled in, otherwise you
401 will not be able to boot. Equivalent to "--compress=bzip2"
405 Compress the generated initramfs using lzma.
409 Make sure your kernel has lzma decompression support compiled in, otherwise you
410 will not be able to boot. Equivalent to "lzma --compress=lzma -9"
414 Compress the generated initramfs using xz.
418 Make sure your kernel has xz decompression support compiled in, otherwise you
419 will not be able to boot. Equivalent to
420 "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
424 Compress the generated initramfs using lzop.
427 Make sure your kernel has lzo decompression support compiled in, otherwise you
428 will not be able to boot.
432 Compress the generated initramfs using lz4.
435 Make sure your kernel has lz4 decompression support compiled in, otherwise you
436 will not be able to boot.
440 Compress the generated initramfs using Zstandard.
443 Make sure your kernel has zstd decompression support compiled in, otherwise you
444 will not be able to boot.
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.
453 The default value can also be set via the _INITRD_COMPRESS_ environment variable.
456 Do not compress the generated initramfs. This will override any other
460 Create reproducible images.
462 **--no-reproducible**::
463 Do not create reproducible images.
466 List all available dracut modules.
468 **-M, --show-modules**::
469 Print included module's name to standard output during build.
472 Keep the initramfs temporary directory for debugging purposes.
475 Print out the module install size
478 Output profile information of the build process
481 Mount / and /usr read-only by default.
483 **-L, --stdlog** _<level>_::
484 [0-6] Specify logging level (to standard error)
486 0 - suppress any messages
487 1 - only fatal errors
491 5 - debug info (here starts lots of output)
492 6 - trace info (and even more)
495 **--regenerate-all**::
496 Regenerate all initramfs images at the default location with the kernel
497 versions found on the system. Additional parameters are passed through.
499 **--loginstall _<DIR>_**::
500 Log all files installed from the host to _<DIR>_.
503 Instead of creating an initramfs image, dracut will create an UEFI executable,
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.
511 affects the default output filename of **--uefi** and will discard the <MACHINE_ID>
514 **--uefi-stub _<FILE>_**::
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
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_
520 **--uefi-splash-image _<FILE>_**::
521 Specifies the UEFI stub loader's splash image. Requires bitmap (**.bmp**) image
524 **--kernel-image _<FILE>_**::
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>_
532 sets the default compression program. See **--compress**.
535 sets the _ldconfig_ program path and options. Optional.
536 Used for **--sysroot**.
542 sets the _ldd_ program path and options. Optional.
543 Used for **--sysroot**.
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.
558 overrides path and options for executing _dracut-install_ internally.
559 Optional. Can be used to debug _dracut-install_ while running the
566 DRACUT_INSTALL="valgrind dracut-install"
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
582 Default values are the default compression utility names to be found in **PATH**.
585 overrides the value of **uname -m**. Used for **--sysroot**.
588 _empty_ (the value of **uname -m** on the host system)
591 overrides systemd version. Used for **--sysroot**.
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.
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.
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.
621 _/var/log/dracut.log_::
622 logfile of initramfs image creation
625 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
631 _/etc/dracut.conf.d/*.conf_::
634 _/usr/lib/dracut/dracut.conf.d/*.conf_::
637 Configuration in the initramfs
638 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
645 Can contain additional command line options. Deprecated, better use
646 /etc/cmdline.d/*.conf.
648 _/etc/cmdline.d/*.conf_::
649 Can contain additional command line options.
653 The dracut command is part of the dracut package and is available from
654 link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
676 *dracut.cmdline*(7) *dracut.conf*(5) *lsinitrd*(1)