1DRACUT(8) dracut DRACUT(8)
2
3
4
6 dracut - low-level tool for generating an initramfs/initrd image
7
9 dracut [OPTION...] [<image> [<kernel version>]]
10
12 Create an initramfs <image> for the kernel with the version <kernel
13 version>. If <kernel version> is omitted, then the version of the
14 actual running kernel is used. If <image> is omitted or empty, then the
15 default location /boot/initramfs-<kernel version>.img is used.
16
17 dracut creates an initial image used by the kernel for preloading the
18 block device modules (such as IDE, SCSI or RAID) which are needed to
19 access the root filesystem, mounting the root filesystem and booting
20 into the real system.
21
22 At boot time, the kernel unpacks that archive into RAM disk, mounts and
23 uses it as initial root file system. All finding of the root device
24 happens in this early userspace.
25
26 Initramfs images are also called "initrd".
27
28 For a complete list of kernel command line options see
29 dracut.cmdline(7).
30
31 If you are dropped to an emergency shell, while booting your initramfs,
32 the file /run/initramfs/rdsosreport.txt is created, which can be saved
33 to a (to be mounted by hand) partition (usually /boot) or a USB stick.
34 Additional debugging info can be produced by adding rd.debug to the
35 kernel command line. /run/initramfs/rdsosreport.txt contains all logs
36 and the output of some tools. It should be attached to any report about
37 dracut problems.
38
40 To create a initramfs image, the most simple command is:
41
42 # dracut
43
44 This will generate a general purpose initramfs image, with all possible
45 functionality resulting of the combination of the installed dracut
46 modules and system tools. The image is /boot/initramfs-<kernel
47 version>.img and contains the kernel modules of the currently active
48 kernel with version <kernel version>.
49
50 If the initramfs image already exists, dracut will display an error
51 message, and to overwrite the existing image, you have to use the
52 --force option.
53
54 # dracut --force
55
56 If you want to specify another filename for the resulting image you
57 would issue a command like:
58
59 # dracut foobar.img
60
61 To generate an image for a specific kernel version, the command would
62 be:
63
64 # dracut foobar.img 2.6.40-1.rc5.f20
65
66 A shortcut to generate the image at the default location for a specific
67 kernel version is:
68
69 # dracut --kver 2.6.40-1.rc5.f20
70
71 If you want to create lighter, smaller initramfs images, you may want
72 to specify the --hostonly or -H option. Using this option, the
73 resulting image will contain only those dracut modules, kernel modules
74 and filesystems, which are needed to boot this specific machine. This
75 has the drawback, that you can’t put the disk on another controller or
76 machine, and that you can’t switch to another root filesystem, without
77 recreating the initramfs image. The usage of the --hostonly option is
78 only for experts and you will have to keep the broken pieces. At least
79 keep a copy of a general purpose image (and corresponding kernel) as a
80 fallback to rescue your system.
81
82 Inspecting the Contents
83 To see the contents of the image created by dracut, you can use the
84 lsinitrd tool.
85
86 # lsinitrd | less
87
88 To display the contents of a file in the initramfs also use the
89 lsinitrd tool:
90
91 # lsinitrd -f /etc/ld.so.conf
92 include ld.so.conf.d/*.conf
93
94 Adding dracut Modules
95 Some dracut modules are turned off by default and have to be activated
96 manually. You can do this by adding the dracut modules to the
97 configuration file /etc/dracut.conf or /etc/dracut.conf.d/myconf.conf.
98 See dracut.conf(5). You can also add dracut modules on the command line
99 by using the -a or --add option:
100
101 # dracut --add bootchart initramfs-bootchart.img
102
103 To see a list of available dracut modules, use the --list-modules
104 option:
105
106 # dracut --list-modules
107
108 Omitting dracut Modules
109 Sometimes you don’t want a dracut module to be included for reasons of
110 speed, size or functionality. To do this, either specify the
111 omit_dracutmodules variable in the dracut.conf or
112 /etc/dracut.conf.d/myconf.conf configuration file (see dracut.conf(5)),
113 or use the -o or --omit option on the command line:
114
115 # dracut -o "multipath lvm" no-multipath-lvm.img
116
117 Adding Kernel Modules
118 If you need a special kernel module in the initramfs, which is not
119 automatically picked up by dracut, you have the use the --add-drivers
120 option on the command line or the drivers variable in the
121 /etc/dracut.conf or /etc/dracut.conf.d/myconf.conf configuration file
122 (see dracut.conf(5)):
123
124 # dracut --add-drivers mymod initramfs-with-mymod.img
125
126 Boot parameters
127 An initramfs generated without the "hostonly" mode, does not contain
128 any system configuration files (except for some special exceptions), so
129 the configuration has to be done on the kernel command line. With this
130 flexibility, you can easily boot from a changed root partition, without
131 the need to recompile the initramfs image. So, you could completely
132 change your root partition (move it inside a md raid with encryption
133 and LVM on top), as long as you specify the correct filesystem LABEL or
134 UUID on the kernel command line for your root device, dracut will find
135 it and boot from it.
136
137 The kernel command line can also be provided by the dhcp server with
138 the root-path option. See the section called “Network Boot”.
139
140 For a full reference of all kernel command line parameters, see
141 dracut.cmdline(5).
142
143 To get a quick start for the suitable kernel command line on your
144 system, use the --print-cmdline option:
145
146 # dracut --print-cmdline
147 root=UUID=8b8b6f91-95c7-4da2-831b-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4
148
149 Specifying the root Device
150 This is the only option dracut really needs to boot from your root
151 partition. Because your root partition can live in various
152 environments, there are a lot of formats for the root= option. The
153 most basic one is root=<path to device node>:
154
155 root=/dev/sda2
156
157 Because device node names can change, dependent on the drive
158 ordering, you are encouraged to use the filesystem identifier
159 (UUID) or filesystem label (LABEL) to specify your root partition:
160
161 root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331
162
163 or
164
165 root=LABEL=myrootpartitionlabel
166
167 To see all UUIDs or LABELs on your system, do:
168
169 # ls -l /dev/disk/by-uuid
170
171 or
172
173 # ls -l /dev/disk/by-label
174
175 If your root partition is on the network see the section called
176 “Network Boot”.
177
178 Keyboard Settings
179 If you have to input passwords for encrypted disk volumes, you
180 might want to set the keyboard layout and specify a display font.
181
182 A typical german kernel command line would contain:
183
184 rd.vconsole.font=eurlatgr rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
185
186 Setting these options can override the setting stored on your
187 system, if you use a modern init system, like systemd.
188
189 Blacklisting Kernel Modules
190 Sometimes it is required to prevent the automatic kernel module
191 loading of a specific kernel module. To do this, just add
192 rd.blacklist=<kernel module name>, with <kernel module name> not
193 containing the .ko suffix, to the kernel command line. For example:
194
195 rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau
196
197 The option can be specified multiple times on the kernel command
198 line.
199
200 Speeding up the Boot Process
201 If you want to speed up the boot process, you can specify as much
202 information for dracut on the kernel command as possible. For
203 example, you can tell dracut, that you root partition is not on a
204 LVM volume or not on a raid partition, or that it lives inside a
205 specific crypto LUKS encrypted volume. By default, dracut searches
206 everywhere. A typical dracut kernel command line for a plain
207 primary or logical partition would contain:
208
209 rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0
210
211 This turns off every automatic assembly of LVM, MD raids, DM raids
212 and crypto LUKS.
213
214 Of course, you could also omit the dracut modules in the initramfs
215 creation process, but then you would lose the possibility to turn
216 it on on demand.
217
218 Injecting custom Files
219 To add your own files to the initramfs image, you have several
220 possibilities.
221
222 The --include option let you specify a source path and a target path.
223 For example
224
225 # dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img
226
227 will create an initramfs image, where the file cmdline-preset will be
228 copied inside the initramfs to /etc/cmdline.d/mycmdline.conf. --include
229 can only be specified once.
230
231 # mkdir -p rd.live.overlay/etc/cmdline.d
232 # mkdir -p rd.live.overlay/etc/conf.d
233 # echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
234 # echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
235 # echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
236 # tree rd.live.overlay/
237 rd.live.overlay/
238 `-- etc
239 |-- cmdline.d
240 | `-- mycmdline.conf
241 `-- conf.d
242 `-- testvar.conf
243
244 # dracut --include rd.live.overlay / initramfs-rd.live.overlay.img
245
246 This will put the contents of the rd.live.overlay directory into the
247 root of the initramfs image.
248
249 The --install option let you specify several files, which will get
250 installed in the initramfs image at the same location, as they are
251 present on initramfs creation time.
252
253 # dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img
254
255 This will create an initramfs with the strace, fsck.ext3 and ssh
256 executables, together with the libraries needed to start those. The
257 --install option can be specified multiple times.
258
259 Network Boot
260 If your root partition is on a network drive, you have to have the
261 network dracut modules installed to create a network aware initramfs
262 image.
263
264 If you specify ip=dhcp on the kernel command line, then dracut asks a
265 dhcp server about the ip address for the machine. The dhcp server can
266 also serve an additional root-path, which will set the root device for
267 dracut. With this mechanism, you have static configuration on your
268 client machine and a centralized boot configuration on your TFTP/DHCP
269 server. If you can’t pass a kernel command line, then you can inject
270 /etc/cmdline.d/mycmdline.conf, with a method described in the section
271 called “Injecting custom Files”.
272
273 Reducing the Image Size
274 To reduce the size of the initramfs, you should create it with by
275 omitting all dracut modules, which you know, you don’t need to boot
276 the machine.
277
278 You can also specify the exact dracut and kernel modules to produce
279 a very tiny initramfs image.
280
281 For example for a NFS image, you would do:
282
283 # dracut -m "nfs network base" initramfs-nfs-only.img
284
285 Then you would boot from this image with your target machine and
286 reduce the size once more by creating it on the target machine with
287 the --host-only option:
288
289 # dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img
290
291 This will reduce the size of the initramfs image significantly.
292
294 If the boot process does not succeed, you have several options to debug
295 the situation. Some of the basic operations are covered here. For more
296 information you should also visit:
297 https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
298
299 Identifying your problem area
300 1. Remove 'rhgb' and 'quiet' from the kernel command line
301
302 2. Add 'rd.shell' to the kernel command line. This will present a
303 shell should dracut be unable to locate your root device
304
305 3. Add 'rd.shell rd.debug log_buf_len=1M' to the kernel command line
306 so that dracut shell commands are printed as they are executed
307
308 4. The file /run/initramfs/rdsosreport.txt is generated, which
309 contains all the logs and the output of all significant tools,
310 which are mentioned later.
311
312 If you want to save that output, simply mount /boot by hand or insert
313 an USB stick and mount that. Then you can store the output for later
314 inspection.
315
316 Information to include in your report
317 All bug reports
318 In all cases, the following should be mentioned and attached to
319 your bug report:
320
321 · The exact kernel command-line used. Typically from the
322 bootloader configuration file (e.g. /boot/grub2/grub.cfg) or
323 from /proc/cmdline.
324
325 · A copy of your disk partition information from /etc/fstab,
326 which might be obtained booting an old working initramfs or a
327 rescue medium.
328
329 · Turn on dracut debugging (see the debugging dracut section),
330 and attach the file /run/initramfs/rdsosreport.txt.
331
332 · If you use a dracut configuration file, please include
333 /etc/dracut.conf and all files in /etc/dracut.conf.d/*.conf
334
335 Network root device related problems
336 This section details information to include when experiencing
337 problems on a system whose root device is located on a network
338 attached volume (e.g. iSCSI, NFS or NBD). As well as the
339 information from the section called “All bug reports”, include the
340 following information:
341
342 · Please include the output of
343
344 # /sbin/ifup <interfacename>
345 # ip addr show
346
347 Debugging dracut
348 Configure a serial console
349 Successfully debugging dracut will require some form of console
350 logging during the system boot. This section documents configuring
351 a serial console connection to record boot messages.
352
353 1. First, enable serial console output for both the kernel and the
354 bootloader.
355
356 2. Open the file /boot/grub2/grub.cfg for editing. Below the line
357 'timeout=5', add the following:
358
359 serial --unit=0 --speed=9600
360 terminal --timeout=5 serial console
361
362 3. Also in /boot/grub2/grub.cfg, add the following boot arguments
363 to the 'kernel' line:
364
365 console=tty0 console=ttyS0,9600
366
367 4. When finished, the /boot/grub2/grub.cfg file should look
368 similar to the example below.
369
370 default=0
371 timeout=5
372 serial --unit=0 --speed=9600
373 terminal --timeout=5 serial console
374 title Fedora (2.6.29.5-191.fc11.x86_64)
375 root (hd0,0)
376 kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
377 initrd /dracut-2.6.29.5-191.fc11.x86_64.img
378
379 5. More detailed information on how to configure the kernel for
380 console output can be found at
381 http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL.
382
383 6. Redirecting non-interactive output
384
385 Note
386 You can redirect all non-interactive output to /dev/kmsg
387 and the kernel will put it out on the console when it
388 reaches the kernel buffer by doing
389
390 # exec >/dev/kmsg 2>&1 </dev/console
391
392 Using the dracut shell
393 dracut offers a shell for interactive debugging in the event dracut
394 fails to locate your root filesystem. To enable the shell:
395
396 1. Add the boot parameter 'rd.shell' to your bootloader
397 configuration file (e.g. /boot/grub2/grub.cfg)
398
399 2. Remove the boot arguments 'rhgb' and 'quiet'
400
401 A sample /boot/grub2/grub.cfg bootloader configuration file is
402 listed below.
403
404 default=0
405 timeout=5
406 serial --unit=0 --speed=9600
407 terminal --timeout=5 serial console
408 title Fedora (2.6.29.5-191.fc11.x86_64)
409 root (hd0,0)
410 kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
411 initrd /dracut-2.6.29.5-191.fc11.x86_64.img
412
413 3. If system boot fails, you will be dropped into a shell as seen
414 in the example below.
415
416 No root device found
417 Dropping to debug shell.
418
419 #
420
421 4. Use this shell prompt to gather the information requested above
422 (see the section called “All bug reports”).
423
424 Accessing the root volume from the dracut shell
425 From the dracut debug shell, you can manually perform the task of
426 locating and preparing your root volume for boot. The required
427 steps will depend on how your root volume is configured. Common
428 scenarios include:
429
430 · A block device (e.g. /dev/sda7)
431
432 · A LVM logical volume (e.g. /dev/VolGroup00/LogVol00)
433
434 · An encrypted device (e.g.
435 /dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83)
436
437 · A network attached device (e.g.
438 netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all)
439
440 The exact method for locating and preparing will vary. However, to
441 continue with a successful boot, the objective is to locate your
442 root volume and create a symlink /dev/root which points to the file
443 system. For example, the following example demonstrates accessing
444 and booting a root volume that is an encrypted LVM Logical volume.
445
446 1. Inspect your partitions using parted
447
448 # parted /dev/sda -s p
449 Model: ATA HTS541060G9AT00 (scsi)
450 Disk /dev/sda: 60.0GB
451 Sector size (logical/physical): 512B/512B
452 Partition Table: msdos
453 Number Start End Size Type File system Flags
454 1 32.3kB 10.8GB 107MB primary ext4 boot
455 2 10.8GB 55.6GB 44.7GB logical lvm
456
457 2. You recall that your root volume was a LVM logical volume. Scan
458 and activate any logical volumes.
459
460 # lvm vgscan
461 # lvm vgchange -ay
462
463 3. You should see any logical volumes now using the command blkid:
464
465 # blkid
466 /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
467 /dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
468 /dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
469 /dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
470 /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
471
472 4. From the output above, you recall that your root volume exists
473 on an encrypted block device. Following the guidance disk
474 encryption guidance from the Installation Guide, you unlock
475 your encrypted root volume.
476
477 # UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
478 # cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
479 Enter passphrase for /dev/mapper/linux-root:
480 Key slot 0 unlocked.
481
482 5. Next, make a symbolic link to the unlocked root volume
483
484 # ln -s /dev/mapper/luks-$UUID /dev/root
485
486 6. With the root volume available, you may continue booting the
487 system by exiting the dracut shell
488
489 # exit
490
491 Additional dracut boot parameters
492 For more debugging options, see dracut.cmdline(7).
493
494 Debugging dracut on shutdown
495 To debug the shutdown sequence on systemd systems, you can rd.break
496 on pre-shutdown or shutdown.
497
498 To do this from an already booted system:
499
500 # mkdir -p /run/initramfs/etc/cmdline.d
501 # echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
502 # touch /run/initramfs/.need_shutdown
503
504 This will give you a dracut shell after the system pivot’ed back in
505 the initramfs.
506
508 --kver <kernel version>
509 set the kernel version. This enables to specify the kernel version,
510 without specifying the location of the initramfs image. For
511 example:
512
513 # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
514
515 -f, --force
516 overwrite existing initramfs file.
517
518 -a, --add <list of dracut modules>
519 add a space-separated list of dracut modules to the default set of
520 modules. This parameter can be specified multiple times.
521
522 Note
523 If [LIST] has multiple arguments, then you have to put these in
524 quotes. For example:
525
526 # dracut --add "module1 module2" ...
527
528 --force-add <list of dracut modules>
529 force to add a space-separated list of dracut modules to the
530 default set of modules, when -H is specified. This parameter can be
531 specified multiple times.
532
533 Note
534 If [LIST] has multiple arguments, then you have to put these in
535 quotes. For example:
536
537 # dracut --force-add "module1 module2" ...
538
539 -o, --omit <list of dracut modules>
540 omit a space-separated list of dracut modules. This parameter can
541 be specified multiple times.
542
543 Note
544 If [LIST] has multiple arguments, then you have to put these in
545 quotes. For example:
546
547 # dracut --omit "module1 module2" ...
548
549 -m, --modules <list of dracut modules>
550 specify a space-separated list of dracut modules to call when
551 building the initramfs. Modules are located in
552 /usr/lib/dracut/modules.d. This parameter can be specified multiple
553 times. This option forces dracut to only include the specified
554 dracut modules. In most cases the "--add" option is what you want
555 to use.
556
557 Note
558 If [LIST] has multiple arguments, then you have to put these in
559 quotes. For example:
560
561 # dracut --modules "module1 module2" ...
562
563 -d, --drivers <list of kernel modules>
564 specify a space-separated list of kernel modules to exclusively
565 include in the initramfs. The kernel modules have to be specified
566 without the ".ko" suffix. This parameter can be specified multiple
567 times.
568
569 Note
570 If [LIST] has multiple arguments, then you have to put these in
571 quotes. For example:
572
573 # dracut --drivers "kmodule1 kmodule2" ...
574
575 --add-drivers <list of kernel modules>
576 specify a space-separated list of kernel modules to add to the
577 initramfs. The kernel modules have to be specified without the
578 ".ko" suffix. This parameter can be specified multiple times.
579
580 Note
581 If [LIST] has multiple arguments, then you have to put these in
582 quotes. For example:
583
584 # dracut --add-drivers "kmodule1 kmodule2" ...
585
586 --force-drivers <list of kernel modules>
587 See add-drivers above. But in this case it is ensured that the
588 drivers are tried to be loaded early via modprobe.
589
590 Note
591 If [LIST] has multiple arguments, then you have to put these in
592 quotes. For example:
593
594 # dracut --force-drivers "kmodule1 kmodule2" ...
595
596 --omit-drivers <list of kernel modules>
597 specify a space-separated list of kernel modules not to add to the
598 initramfs. The kernel modules have to be specified without the
599 ".ko" suffix. This parameter can be specified multiple times.
600
601 Note
602 If [LIST] has multiple arguments, then you have to put these in
603 quotes. For example:
604
605 # dracut --omit-drivers "kmodule1 kmodule2" ...
606
607 --filesystems <list of filesystems>
608 specify a space-separated list of kernel filesystem modules to
609 exclusively include in the generic initramfs. This parameter can be
610 specified multiple times.
611
612 Note
613 If [LIST] has multiple arguments, then you have to put these in
614 quotes. For example:
615
616 # dracut --filesystems "filesystem1 filesystem2" ...
617
618 -k, --kmoddir <kernel directory>
619 specify the directory, where to look for kernel modules
620
621 --fwdir <dir>[:<dir>...]++
622 specify additional directories, where to look for firmwares. This
623 parameter can be specified multiple times.
624
625 --kernel-cmdline <parameters>
626 specify default kernel command line parameters
627
628 --kernel-only
629 only install kernel drivers and firmware files
630
631 --no-kernel
632 do not install kernel drivers and firmware files
633
634 --early-microcode
635 Combine early microcode with ramdisk
636
637 --no-early-microcode
638 Do not combine early microcode with ramdisk
639
640 --print-cmdline
641 print the kernel command line for the current disk layout
642
643 --mdadmconf
644 include local /etc/mdadm.conf
645
646 --nomdadmconf
647 do not include local /etc/mdadm.conf
648
649 --lvmconf
650 include local /etc/lvm/lvm.conf
651
652 --nolvmconf
653 do not include local /etc/lvm/lvm.conf
654
655 --fscks [LIST]
656 add a space-separated list of fsck tools, in addition to
657 dracut.conf's specification; the installation is opportunistic
658 (non-existing tools are ignored)
659
660 Note
661 If [LIST] has multiple arguments, then you have to put these in
662 quotes. For example:
663
664 # dracut --fscks "fsck.foo barfsck" ...
665
666 --nofscks
667 inhibit installation of any fsck tools
668
669 --strip
670 strip binaries in the initramfs (default)
671
672 --nostrip
673 do not strip binaries in the initramfs
674
675 --hardlink
676 hardlink files in the initramfs (default)
677
678 --nohardlink
679 do not hardlink files in the initramfs
680
681 --prefix <dir>
682 prefix initramfs files with the specified directory
683
684 --noprefix
685 do not prefix initramfs files (default)
686
687 -h, --help
688 display help text and exit.
689
690 --debug
691 output debug information of the build process
692
693 -v, --verbose
694 increase verbosity level (default is info(4))
695
696 -q, --quiet
697 decrease verbosity level (default is info(4))
698
699 -c, --conf <dracut configuration file>
700 specify configuration file to use.
701
702 Default: /etc/dracut.conf
703
704 --confdir <configuration directory>
705 specify configuration directory to use.
706
707 Default: /etc/dracut.conf.d
708
709 --tmpdir <temporary directory>
710 specify temporary directory to use.
711
712 Default: /var/tmp
713
714 -r, --sysroot <sysroot directory>
715 specify the sysroot directory to collect files from. This is useful
716 to create the initramfs image from a cross-compiled sysroot
717 directory. For the extra helper variables, see ENVIRONMENT below.
718
719 Default: empty
720
721 --sshkey <sshkey file>
722 ssh key file used with ssh-client module.
723
724 --logfile <logfile>
725 logfile to use; overrides any setting from the configuration files.
726
727 Default: /var/log/dracut.log
728
729 -l, --local
730 activates the local mode. dracut will use modules from the current
731 working directory instead of the system-wide installed modules in
732 /usr/lib/dracut/modules.d. This is useful when running dracut from
733 a git checkout.
734
735 -H, --hostonly
736 Host-Only mode: Install only what is needed for booting the local
737 host instead of a generic host and generate host-specific
738 configuration.
739
740 Warning
741 If chrooted to another root other than the real root device,
742 use "--fstab" and provide a valid /etc/fstab.
743
744 -N, --no-hostonly
745 Disable Host-Only mode
746
747 --hostonly-cmdline: Store kernel command line arguments needed in the
748 initramfs
749
750 --no-hostonly-cmdline: Do not store kernel command line arguments
751 needed in the initramfs
752
753 --no-hostonly-default-device: Do not generate implicit host devices
754 like root, swap, fstab, etc. Use "--mount" or "--add-device" to
755 explicitly add devices as needed.
756
757 --hostonly-i18n: Install only needed keyboard and font files according
758 to the host configuration (default).
759
760 --no-hostonly-i18n: Install all keyboard and font files available.
761
762 --persistent-policy <policy>
763 Use <policy> to address disks and partitions. <policy> can be any
764 directory name found in /dev/disk. E.g. "by-uuid", "by-label"
765
766 --fstab
767 Use /etc/fstab instead of /proc/self/mountinfo.
768
769 --add-fstab <filename>
770 Add entries of <filename> to the initramfs /etc/fstab.
771
772 --mount "<device> <mountpoint> <filesystem type> [<filesystem options>
773 [<dump frequency> [<fsck order>]]]"
774 Mount <device> on <mountpoint> with <filesystem type> in the
775 initramfs. <filesystem options>, <dump options> and <fsck order>
776 can be specified, see fstab manpage for the details. The default
777 <filesystem options> is "defaults". The default <dump frequency> is
778 "0". the default <fsck order> is "2".
779
780 --mount "<mountpoint>"
781 Like above, but <device>, <filesystem type> and <filesystem
782 options> are determined by looking at the current mounts.
783
784 --add-device <device>
785 Bring up <device> in initramfs, <device> should be the device name.
786 This can be useful in hostonly mode for resume support when your
787 swap is on LVM or an encrypted partition. [NB --device can be used
788 for compatibility with earlier releases]
789
790 -i, --include <SOURCE> <TARGET>
791 include the files in the SOURCE directory into the TARGET directory
792 in the final initramfs. If SOURCE is a file, it will be installed
793 to TARGET in the final initramfs. This parameter can be specified
794 multiple times.
795
796 -I, --install <file list>
797 install the space separated list of files into the initramfs.
798
799 Note
800 If [LIST] has multiple arguments, then you have to put these in
801 quotes. For example:
802
803 # dracut --install "/bin/foo /sbin/bar" ...
804
805 --install-optional <file list>
806 install the space separated list of files into the initramfs, if
807 they exist.
808
809 --gzip
810 Compress the generated initramfs using gzip. This will be done by
811 default, unless another compression option or --no-compress is
812 passed. Equivalent to "--compress=gzip -9"
813
814 --bzip2
815 Compress the generated initramfs using bzip2.
816
817 Warning
818 Make sure your kernel has bzip2 decompression support compiled
819 in, otherwise you will not be able to boot. Equivalent to
820 "--compress=bzip2"
821
822 --lzma
823 Compress the generated initramfs using lzma.
824
825 Warning
826 Make sure your kernel has lzma decompression support compiled
827 in, otherwise you will not be able to boot. Equivalent to "lzma
828 --compress=lzma -9"
829
830 --xz
831 Compress the generated initramfs using xz.
832
833 Warning
834 Make sure your kernel has xz decompression support compiled in,
835 otherwise you will not be able to boot. Equivalent to "lzma
836 --compress=xz --check=crc32 --lzma2=dict=1MiB"
837
838 --lzo
839 Compress the generated initramfs using lzop.
840
841 Warning
842 Make sure your kernel has lzo decompression support compiled in,
843 otherwise you will not be able to boot.
844
845 --lz4
846 Compress the generated initramfs using lz4.
847
848 Warning
849 Make sure your kernel has lz4 decompression support compiled in,
850 otherwise you will not be able to boot.
851
852 --zstd
853 Compress the generated initramfs using Zstandard.
854
855 Warning
856 Make sure your kernel has zstd decompression support compiled in,
857 otherwise you will not be able to boot.
858
859 --compress <compressor>
860 Compress the generated initramfs using the passed compression
861 program. If you pass it just the name of a compression program, it
862 will call that program with known-working arguments. If you pass a
863 quoted string with arguments, it will be called with exactly those
864 arguments. Depending on what you pass, this may result in an
865 initramfs that the kernel cannot decompress. The default value can
866 also be set via the INITRD_COMPRESS environment variable.
867
868 --no-compress
869 Do not compress the generated initramfs. This will override any
870 other compression options.
871
872 --reproducible
873 Create reproducible images.
874
875 --no-reproducible
876 Do not create reproducible images.
877
878 --list-modules
879 List all available dracut modules.
880
881 -M, --show-modules
882 Print included module’s name to standard output during build.
883
884 --keep
885 Keep the initramfs temporary directory for debugging purposes.
886
887 --printsize
888 Print out the module install size
889
890 --profile: Output profile information of the build process
891
892 --ro-mnt: Mount / and /usr read-only by default.
893
894 -L, --stdlog <level>
895 [0-6] Specify logging level (to standard error)
896
897 0 - suppress any messages
898 1 - only fatal errors
899 2 - all errors
900 3 - warnings
901 4 - info
902 5 - debug info (here starts lots of output)
903 6 - trace info (and even more)
904
905 --regenerate-all
906 Regenerate all initramfs images at the default location with the
907 kernel versions found on the system. Additional parameters are
908 passed through.
909
910 --loginstall <DIR>
911 Log all files installed from the host to <DIR>.
912
913 --uefi
914 Instead of creating an initramfs image, dracut will create an UEFI
915 executable, which can be executed by an UEFI BIOS. The default
916 output filename is
917 <EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi. <EFI>
918 might be /efi, /boot or /boot/efi depending on where the ESP
919 partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
920 /usr/lib/os-release or if it exists /etc/os-release and is left
921 out, if BUILD_ID is non-existant or empty.
922
923 --no-machineid
924 affects the default output filename of --uefi and will discard the
925 <MACHINE_ID> part.
926
927 --uefi-stub <FILE>
928 Specifies the UEFI stub loader, which will load the attached
929 kernel, initramfs and kernel command line and boots the kernel. The
930 default is
931 $prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub
932 or $prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub
933
934 --uefi-splash-image <FILE>
935 Specifies the UEFI stub loader’s splash image. Requires bitmap
936 (.bmp) image format.
937
938 --kernel-image <FILE>
939 Specifies the kernel image, which to include in the UEFI
940 executable. The default is /lib/modules/<KERNEL-VERSION>/vmlinuz or
941 /boot/vmlinuz-<KERNEL-VERSION>
942
944 INITRD_COMPRESS
945 sets the default compression program. See --compress.
946
947 DRACUT_LDCONFIG
948 sets the ldconfig program path and options. Optional. Used for
949 --sysroot.
950
951 Default: ldconfig
952
953 DRACUT_LDD
954 sets the ldd program path and options. Optional. Used for
955 --sysroot.
956
957 Default: ldd
958
959 DRACUT_TESTBIN
960 sets the initially tested binary for detecting library paths.
961 Optional. Used for --sysroot. In the cross-compiled sysroot, the
962 default value (/bin/sh) is unusable, as it is an absolute symlink
963 and points outside the sysroot directory.
964
965 Default: /bin/sh
966
967 DRACUT_INSTALL
968 overrides path and options for executing dracut-install internally.
969 Optional. Can be used to debug dracut-install while running the
970 main dracut script.
971
972 Default: dracut-install
973
974 Example: DRACUT_INSTALL="valgrind dracut-install"
975
976 DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2,
977 DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP,
978 DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD,
979 DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT
980 overrides for compression utilities to support using them from
981 non-standard paths.
982
983 Default values are the default compression utility names to be
984 found in PATH.
985
986 DRACUT_ARCH
987 overrides the value of uname -m. Used for --sysroot.
988
989 Default: empty (the value of uname -m on the host system)
990
991 SYSTEMD_VERSION
992 overrides systemd version. Used for --sysroot.
993
994 DRACUT_INSTALL_PATH
995 overrides PATH environment for dracut-install to look for binaries
996 relative to --sysroot. In a cross-compiled environment (e.g.
997 Yocto), PATH points to natively built binaries that are not in the
998 host’s /bin, /usr/bin, etc. dracut-install still needs plain /bin
999 and /usr/bin that are relative to the cross-compiled sysroot.
1000
1001 Default: PATH
1002
1003 DRACUT_INSTALL_LOG_TARGET
1004 overrides DRACUT_LOG_TARGET for dracut-install. It allows running
1005 dracut-install* to run with different log target that dracut** runs
1006 with.
1007
1008 Default: DRACUT_LOG_TARGET
1009
1010 DRACUT_INSTALL_LOG_LEVEL
1011 overrides DRACUT_LOG_LEVEL for dracut-install. It allows running
1012 dracut-install* to run with different log level that dracut** runs
1013 with.
1014
1015 Default: DRACUT_LOG_LEVEL
1016
1018 /var/log/dracut.log
1019 logfile of initramfs image creation
1020
1021 /tmp/dracut.log
1022 logfile of initramfs image creation, if /var/log/dracut.log is not
1023 writable
1024
1025 /etc/dracut.conf
1026 see dracut.conf5
1027
1028 /etc/dracut.conf.d/*.conf
1029 see dracut.conf5
1030
1031 /usr/lib/dracut/dracut.conf.d/*.conf
1032 see dracut.conf5
1033
1034 Configuration in the initramfs
1035 /etc/conf.d/
1036 Any files found in /etc/conf.d/ will be sourced in the initramfs to
1037 set initial values. Command line options will override these values
1038 set in the configuration files.
1039
1040 /etc/cmdline
1041 Can contain additional command line options. Deprecated, better use
1042 /etc/cmdline.d/*.conf.
1043
1044 /etc/cmdline.d/*.conf
1045 Can contain additional command line options.
1046
1048 The dracut command is part of the dracut package and is available from
1049 https://dracut.wiki.kernel.org
1050
1052 Harald Hoyer
1053
1054 Victor Lowther
1055
1056 Philippe Seewer
1057
1058 Warren Togami
1059
1060 Amadeusz Żołnowski
1061
1062 Jeremy Katz
1063
1064 David Dillow
1065
1066 Will Woods
1067
1069 dracut.cmdline(7) dracut.conf(5) lsinitrd(1)
1070
1071
1072
1073dracut 050 03/04/2020 DRACUT(8)