9 dracut - low-level tool for generating an initramfs image
13 *dracut* ['OPTION...'] [<image> [_<kernel version>_]]
18 Create an initramfs <image> for the kernel with the version <kernel version>.
19 If <kernel version> is omitted, then the version of the actual running
20 kernel is used. If <image> is omitted or empty, then the default location
21 /boot/initramfs-<kernel version>.img is used.
23 dracut creates an initial image used by the kernel for preloading the block
24 device modules (such as IDE, SCSI or RAID) which are needed to access the root
25 filesystem, mounting the root filesystem and booting into the real system.
27 At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it
28 as initial root file system. All finding of the root device happens in this
31 For a complete list of kernel command line options see *dracut.cmdline*(7).
33 If you are dropped to an emergency shell, while booting your initramfs,
34 the file _/run/initramfs/rdsosreport.txt_ is created, which can be safed to a
35 (to be mounted by hand) partition (usually /boot) or a USB stick.
36 Additional debugging info can be produced by adding **rd.debug** to the kernel command line.
37 _/run/initramfs/rdsosreport.txt_ contains all logs and the output of some tools.
38 It should be attached to any report about dracut problems.
43 To create a initramfs image, the most simple command is:
48 This will generate a general purpose initramfs image, with all possible
49 functionality resulting of the combination of the installed dracut modules and
50 system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
51 contains the kernel modules of the currently active kernel with version
52 _++<kernel version>++_.
54 If the initramfs image already exists, dracut will display an error message, and
55 to overwrite the existing image, you have to use the --force option.
60 If you want to specify another filename for the resulting image you would issue
66 To generate an image for a specific kernel version, the command would be:
68 # dracut foobar.img 2.6.40-1.rc5.f20
71 A shortcut to generate the image at the default location for a specific kernel
74 # dracut --kver 2.6.40-1.rc5.f20
77 If you want to create lighter, smaller initramfs images, you may want to specify
78 the --hostonly or -H option. Using this option, the resulting image will
79 contain only those dracut modules, kernel modules and filesystems, which are
80 needed to boot this specific machine. This has the drawback, that you can't put
81 the disk on another controller or machine, and that you can't switch to another
82 root filesystem, without recreating the initramfs image. The usage of the
83 --hostonly option is only for experts and you will have to keep the broken
84 pieces. At least keep a copy of a general purpose image (and corresponding
85 kernel) as a fallback to rescue your system.
90 **--kver** _<kernel version>_::
91 set the kernel version. This enables to specify the kernel version, without
92 specifying the location of the initramfs image. For example:
94 # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
98 overwrite existing initramfs file.
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.
106 ===============================
107 If [LIST] has multiple arguments, then you have to put these in quotes. For
110 # dracut --modules "module1 module2" ...
112 ===============================
114 **-o, --omit** _<list of dracut modules>_::
115 omit a space-separated list of dracut modules. This parameter can be
116 specified multiple times.
119 ===============================
120 If [LIST] has multiple arguments, then you have to put these in quotes. For
123 # dracut --omit "module1 module2" ...
125 ===============================
127 **-a, --add** _<list of dracut modules>_::
128 add a space-separated list of dracut modules to the default set of modules.
129 This parameter can be specified multiple times.
132 ===============================
133 If [LIST] has multiple arguments, then you have to put these in quotes. For
136 # dracut --add "module1 module2" ...
138 ===============================
140 **--force-add** _<list of dracut modules>_::
141 force to add a space-separated list of dracut modules to the default set of
142 modules, when -H is specified. This parameter can be specified multiple
146 ===============================
147 If [LIST] has multiple arguments, then you have to put these in quotes. For
150 # dracut --force-add "module1 module2" ...
152 ===============================
154 **-d, --drivers** _<list of kernel modules>_::
155 specify a space-separated list of kernel modules to exclusively include
156 in the initramfs. The kernel modules have to be specified without the ".ko"
157 suffix. This parameter can be specified multiple times.
160 ===============================
161 If [LIST] has multiple arguments, then you have to put these in quotes. For
164 # dracut --drivers "kmodule1 kmodule2" ...
166 ===============================
168 **--add-drivers** _<list of kernel modules>_::
169 specify a space-separated list of kernel modules to add to the initramfs.
170 The kernel modules have to be specified without the ".ko" suffix. This
171 parameter can be specified multiple times.
174 ===============================
175 If [LIST] has multiple arguments, then you have to put these in quotes. For
178 # dracut --add-drivers "kmodule1 kmodule2" ...
180 ===============================
182 **--omit-drivers** _<list of kernel modules>_::
183 specify a space-separated list of kernel modules not to add to the
185 The kernel modules have to be specified without the ".ko" suffix. This
186 parameter can be specified multiple times.
189 ===============================
190 If [LIST] has multiple arguments, then you have to put these in quotes. For
193 # dracut --omit-drivers "kmodule1 kmodule2" ...
195 ===============================
197 **--filesystems** _<list of filesystems>_::
198 specify a space-separated list of kernel filesystem modules to exclusively
199 include in the generic initramfs. This parameter can be specified multiple
203 ===============================
204 If [LIST] has multiple arguments, then you have to put these in quotes. For
207 # dracut --filesystems "filesystem1 filesystem2" ...
209 ===============================
211 **-k, --kmoddir** _<kernel directory>_::
212 specify the directory, where to look for kernel modules
214 **--fwdir** _<dir>[:<dir>...]++_::
215 specify additional directories, where to look for firmwares. This parameter
216 can be specified multiple times.
218 **--kernel-cmdline <parameters>**::
219 specify default kernel command line parameters
223 only install kernel drivers and firmware files
226 do not install kernel drivers and firmware files
228 **--early-microcode**::
229 Combine early microcode with ramdisk
231 **--no-early-microcode**::
232 Do not combine early microcode with ramdisk
234 **--print-cmdline**::
235 print the kernel command line for the current disk layout
238 include local _/etc/mdadm.conf_
241 do not include local _/etc/mdadm.conf_
244 include local _/etc/lvm/lvm.conf_
247 do not include local _/etc/lvm/lvm.conf_
250 add a space-separated list of fsck tools, in addition to _dracut.conf_'s
251 specification; the installation is opportunistic (non-existing tools are
255 ===============================
256 If [LIST] has multiple arguments, then you have to put these in quotes. For
259 # dracut --fscks "fsck.foo barfsck" ...
261 ===============================
264 inhibit installation of any fsck tools
267 strip binaries in the initramfs (default)
270 do not strip binaries in the initramfs
273 prelink binaries in the initramfs (default)
276 do not prelink binaries in the initramfs
279 hardlink files in the initramfs (default)
282 do not hardlink files in the initramfs
284 **--prefix** _<dir>_::
285 prefix initramfs files with the specified directory
288 do not prefix initramfs files (default)
291 display help text and exit.
294 output debug information of the build process
297 increase verbosity level (default is info(4))
299 **-q, --quiet**:: decrease verbosity level (default is info(4))
301 **-c, --conf** _<dracut configuration file>_::
302 specify configuration file to use.
307 **--confdir** _<configuration directory>_::
308 specify configuration directory to use.
313 **--tmpdir** _<temporary directory>_::
314 specify temporary directory to use.
319 **--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
322 activates the local mode. dracut will use modules from the current working
323 directory instead of the system-wide installed modules in
324 _/usr/lib/dracut/modules.d_.
325 This is useful when running dracut from a git checkout.
328 Host-Only mode: Install only what is needed for booting the local host
329 instead of a generic host and generate host-specific configuration.
333 If chrooted to another root other than the real root device, use "--fstab" and
334 provide a valid _/etc/fstab_.
337 **-N, --no-hostonly**::
338 Disable Host-Only mode
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>_"::
352 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
353 options>_ in the initramfs
355 **--add-device** _<device>_ ::
356 Bring up _<device>_ in initramfs, _<device>_ should be the device name.
357 This can be useful in hostonly mode for resume support when your swap is on
358 LVM or an encrypted partition.
359 [NB --device can be used for compatibility with earlier releases]
361 **-i, --include** _<SOURCE>_ _<TARGET>_::
362 include the files in the SOURCE directory into the
363 TARGET directory in the final initramfs. If SOURCE is a file, it will be
364 installed to TARGET in the final initramfs. This parameter can be specified
367 **-I, --install** _<file list>_::
368 install the space separated list of files into the initramfs.
371 ===============================
372 If [LIST] has multiple arguments, then you have to put these in quotes. For
375 # dracut --install "/bin/foo /sbin/bar" ...
377 ===============================
380 Compress the generated initramfs using gzip. This will be done by default,
381 unless another compression option or --no-compress is passed. Equivalent to
385 Compress the generated initramfs using bzip2.
389 Make sure your kernel has bzip2 decompression support compiled in, otherwise you
390 will not be able to boot. Equivalent to "--compress=bzip2"
394 Compress the generated initramfs using lzma.
398 Make sure your kernel has lzma decompression support compiled in, otherwise you
399 will not be able to boot. Equivalent to "lzma --compress=lzma -9"
403 Compress the generated initramfs using xz.
407 Make sure your kernel has xz decompression support compiled in, otherwise you
408 will not be able to boot. Equivalent to "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"
411 **--compress** _<compressor>_::
412 Compress the generated initramfs using the passed compression program. If
413 you pass it just the name of a compression program, it will call that
414 program with known-working arguments. If you pass a quoted string with
415 arguments, it will be called with exactly those arguments. Depending on what
416 you pass, this may result in an initramfs that the kernel cannot decompress.
419 Do not compress the generated initramfs. This will override any other
423 List all available dracut modules.
425 **-M, --show-modules**::
426 Print included module's name to standard output during build.
429 Keep the initramfs temporary directory for debugging purposes.
432 Print out the module install size
435 Output profile information of the build process
438 Mount / and /usr read-only by default.
440 **-L, --stdlog** _<level>_::
441 [0-6] Specify logging level (to standard error)
443 0 - suppress any messages
444 1 - only fatal errors
448 5 - debug info (here starts lots of output)
449 6 - trace info (and even more)
452 **--regenerate-all**::
453 Regenerate all initramfs images at the default location with the kernel versions found on the system.
454 Additional parameters are passed through.
458 _/var/log/dracut.log_::
459 logfile of initramfs image creation
462 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
468 _/etc/dracut.conf.d/*.conf_::
471 _/usr/lib/dracut/dracut.conf.d/*.conf_::
474 Configuration in the initramfs
475 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
477 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
478 set initial values. Command line options will override these values
479 set in the configuration files.
482 Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf.
484 _/etc/cmdline.d/*.conf::
485 Can contain additional command line options.
489 The dracut command is part of the dracut package and is available from
490 link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
512 *dracut.cmdline*(7) *dracut.conf*(5)