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).
36 To create a initramfs image, the most simple command is:
41 This will generate a general purpose initramfs image, with all possible
42 functionality resulting of the combination of the installed dracut modules and
43 system tools. The image is /boot/initramfs-_++<kernel version>++_.img and
44 contains the kernel modules of the currently active kernel with version
45 _++<kernel version>++_.
47 If the initramfs image already exists, dracut will display an error message, and
48 to overwrite the existing image, you have to use the --force option.
53 If you want to specify another filename for the resulting image you would issue
59 To generate an image for a specific kernel version, the command would be:
61 # dracut foobar.img 2.6.40-1.rc5.f20
64 A shortcut to generate the image at the default location for a specific kernel
67 # dracut --kver 2.6.40-1.rc5.f20
70 If you want to create lighter, smaller initramfs images, you may want to specify
71 the --host-only or -H option. Using this option, the resulting image will
72 contain only those dracut modules, kernel modules and filesystems, which are
73 needed to boot this specific machine. This has the drawback, that you can't put
74 the disk on another controller or machine, and that you can't switch to another
75 root filesystem, without recreating the initramfs image. The usage of the
76 --host-only option is only for experts and you will have to keep the broken
77 pieces. At least keep a copy of a general purpose image (and corresponding
78 kernel) as a fallback to rescue your system.
83 **--kver** _<kernel version>_::
84 set the kernel version. This enables to specify the kernel version, without
85 specifying the location of the initramfs image. For example:
87 # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
91 overwrite existing initramfs file.
93 **-m, --modules** _<list of dracut modules>_::
94 specify a space-separated list of dracut modules to call when building the
95 initramfs. Modules are located in _/usr/lib/dracut/modules.d_. This
96 parameter can be specified multiple times.
99 ===============================
100 If [LIST] has multiple arguments, then you have to put these in quotes. For
103 # dracut --modules "module1 module2" ...
105 ===============================
107 **-o, --omit** _<list of dracut modules>_::
108 omit a space-separated list of dracut modules. This parameter can be
109 specified multiple times.
112 ===============================
113 If [LIST] has multiple arguments, then you have to put these in quotes. For
116 # dracut --omit "module1 module2" ...
118 ===============================
120 **-a, --add** _<list of dracut modules>_::
121 add a space-separated list of dracut modules to the default set of modules.
122 This parameter can be specified multiple times.
125 ===============================
126 If [LIST] has multiple arguments, then you have to put these in quotes. For
129 # dracut --add "module1 module2" ...
131 ===============================
133 **--force-add** _<list of dracut modules>_::
134 force to add a space-separated list of dracut modules to the default set of
135 modules, when -H is specified. This parameter can be specified multiple
139 ===============================
140 If [LIST] has multiple arguments, then you have to put these in quotes. For
143 # dracut --force-add "module1 module2" ...
145 ===============================
147 **-d, --drivers** _<list of kernel modules>_::
148 specify a space-separated list of kernel modules to exclusively include
149 in the initramfs. The kernel modules have to be specified without the ".ko"
150 suffix. This parameter can be specified multiple times.
153 ===============================
154 If [LIST] has multiple arguments, then you have to put these in quotes. For
157 # dracut --drivers "kmodule1 kmodule2" ...
159 ===============================
161 **--add-drivers** _<list of kernel modules>_::
162 specify a space-separated list of kernel modules to add to the initramfs.
163 The kernel modules have to be specified without the ".ko" suffix. This
164 parameter can be specified multiple times.
167 ===============================
168 If [LIST] has multiple arguments, then you have to put these in quotes. For
171 # dracut --add-drivers "kmodule1 kmodule2" ...
173 ===============================
175 **--omit-drivers** _<list of kernel modules>_::
176 specify a space-separated list of kernel modules not to add to the
178 The kernel modules have to be specified without the ".ko" suffix. This
179 parameter can be specified multiple times.
182 ===============================
183 If [LIST] has multiple arguments, then you have to put these in quotes. For
186 # dracut --omit-drivers "kmodule1 kmodule2" ...
188 ===============================
190 **--filesystems** _<list of filesystems>_::
191 specify a space-separated list of kernel filesystem modules to exclusively
192 include in the generic initramfs. This parameter can be specified multiple
196 ===============================
197 If [LIST] has multiple arguments, then you have to put these in quotes. For
200 # dracut --filesystems "filesystem1 filesystem2" ...
202 ===============================
204 **-k, --kmoddir** _<kernel directory>_::
205 specify the directory, where to look for kernel modules
207 **--fwdir** _<dir>[:<dir>...]++_::
208 specify additional directories, where to look for firmwares. This parameter
209 can be specified multiple times.
212 only install kernel drivers and firmware files
215 do not install kernel drivers and firmware files
218 include local _/etc/mdadm.conf_
221 do not include local _/etc/mdadm.conf_
224 include local _/etc/lvm/lvm.conf_
227 do not include local _/etc/lvm/lvm.conf_
230 add a space-separated list of fsck tools, in addition to _dracut.conf_'s
231 specification; the installation is opportunistic (non-existing tools are
235 ===============================
236 If [LIST] has multiple arguments, then you have to put these in quotes. For
239 # dracut --fscks "fsck.foo barfsck" ...
241 ===============================
244 inhibit installation of any fsck tools
247 strip binaries in the initramfs
250 do not strip binaries in the initramfs (default)
253 hardlink files in the initramfs (default)
256 do not hardlink files in the initramfs
258 **--prefix** _<dir>_::
259 prefix initramfs files with the specified directory
262 do not prefix initramfs files (default)
265 display help text and exit.
268 output debug information of the build process
271 increase verbosity level (default is info(4))
273 **-q, --quiet**:: decrease verbosity level (default is info(4))
275 **-c, --conf** _<dracut configuration file>_::
276 specify configuration file to use.
281 **--confdir** _<configuration directory>_::
282 specify configuration directory to use.
287 **--tmpdir** _<temporary directory>_::
288 specify temporary directory to use.
293 **--sshkey** _<sshkey file>_:: ssh key file used with ssh-client module.
296 activates the local mode. dracut will use modules from the current working
297 directory instead of the system-wide installed modules in
298 _/usr/lib/dracut/modules.d_.
299 This is useful when running dracut from a git checkout.
302 Host-Only mode: Install only what is needed for booting the local host
303 instead of a generic host and generate host-specific configuration.
307 If chrooted to another root other than the real root device, use "--fstab" and
308 provide a valid _/etc/fstab_.
312 Disable Host-Only mode
315 Use _/etc/fstab_ instead of _/proc/self/mountinfo_.
317 **--add-fstab** _<filename>_ ::
318 Add entries of _<filename>_ to the initramfs /etc/fstab.
320 **--mount** "_<device>_ _<mountpoint>_ _<filesystem type>_ _<filesystem options>_"::
321 Mount _<device>_ on _<mountpoint>_ with _<filesystem type>_ and _<filesystem
322 options>_ in the initramfs
324 **-i, --include** _<SOURCE>_ _<TARGET>_::
325 include the files in the SOURCE directory into the
326 TARGET directory in the final initramfs. If SOURCE is a file, it will be
327 installed to TARGET in the final initramfs. This parameter can be specified
330 **-I, --install** _<file list>_::
331 install the space separated list of files into the initramfs.
334 ===============================
335 If [LIST] has multiple arguments, then you have to put these in quotes. For
338 # dracut --install "/bin/foo /sbin/bar" ...
340 ===============================
343 Compress the generated initramfs using gzip. This will be done by default,
344 unless another compression option or --no-compress is passed. Equivalent to
348 Compress the generated initramfs using bzip2.
352 Make sure your kernel has bzip2 decompression support compiled in, otherwise you
353 will not be able to boot. Equivalent to "--compress=bzip2"
357 Compress the generated initramfs using lzma.
361 Make sure your kernel has lzma decompression support compiled in, otherwise you
362 will not be able to boot. Equivalent to "--compress=lzma -9"
366 Compress the generated initramfs using xz.
370 Make sure your kernel has xz decompression support compiled in, otherwise you
371 will not be able to boot. Equivalent to "--compress=xz --check=crc32
375 **--compress** _<compressor>_::
376 Compress the generated initramfs using the passed compression program. If
377 you pass it just the name of a compression program, it will call that
378 program with known-working arguments. If you pass a quoted string with
379 arguments, it will be called with exactly those arguments. Depending on what
380 you pass, this may result in an initramfs that the kernel cannot decompress.
383 Do not compress the generated initramfs. This will override any other
387 List all available dracut modules.
389 **-M, --show-modules**::
390 Print included module's name to standard output during build.
393 Keep the initramfs temporary directory for debugging purposes.
397 _/var/log/dracut.log_::
398 logfile of initramfs image creation
401 logfile of initramfs image creation, if _/var/log/dracut.log_ is not
407 _/etc/dracut.conf.d/*.conf_::
410 Configuration in the initramfs
411 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
413 Any files found in _/etc/conf.d/_ will be sourced in the initramfs to
414 set initial values. Command line options will override these values
415 set in the configuration files.
418 Can contain additional command line options.
422 The dracut command is part of the dracut package and is available from
423 link:$$https://dracut.wiki.kernel.org$$[https://dracut.wiki.kernel.org]
445 *dracut.cmdline*(7) *dracut.conf*(5)