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 module initramfs-module.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 --version
697 display version and exit
698
699 -q, --quiet
700 decrease verbosity level (default is info(4))
701
702 -c, --conf <dracut configuration file>
703 specify configuration file to use.
704
705 Default: /etc/dracut.conf
706
707 --confdir <configuration directory>
708 specify configuration directory to use.
709
710 Default: /etc/dracut.conf.d
711
712 --tmpdir <temporary directory>
713 specify temporary directory to use.
714
715 Default: /var/tmp
716
717 -r, --sysroot <sysroot directory>
718 specify the sysroot directory to collect files from. This is useful
719 to create the initramfs image from a cross-compiled sysroot
720 directory. For the extra helper variables, see ENVIRONMENT below.
721
722 Default: empty
723
724 --sshkey <sshkey file>
725 ssh key file used with ssh-client module.
726
727 --logfile <logfile>
728 logfile to use; overrides any setting from the configuration files.
729
730 Default: /var/log/dracut.log
731
732 -l, --local
733 activates the local mode. dracut will use modules from the current
734 working directory instead of the system-wide installed modules in
735 /usr/lib/dracut/modules.d. This is useful when running dracut from
736 a git checkout.
737
738 -H, --hostonly
739 Host-Only mode: Install only what is needed for booting the local
740 host instead of a generic host and generate host-specific
741 configuration.
742
743 Warning
744 If chrooted to another root other than the real root device,
745 use "--fstab" and provide a valid /etc/fstab.
746
747 -N, --no-hostonly
748 Disable Host-Only mode
749
750 --hostonly-cmdline: Store kernel command line arguments needed in the
751 initramfs
752
753 --no-hostonly-cmdline: Do not store kernel command line arguments
754 needed in the initramfs
755
756 --no-hostonly-default-device: Do not generate implicit host devices
757 like root, swap, fstab, etc. Use "--mount" or "--add-device" to
758 explicitly add devices as needed.
759
760 --hostonly-i18n: Install only needed keyboard and font files according
761 to the host configuration (default).
762
763 --no-hostonly-i18n: Install all keyboard and font files available.
764
765 --persistent-policy <policy>
766 Use <policy> to address disks and partitions. <policy> can be any
767 directory name found in /dev/disk. E.g. "by-uuid", "by-label"
768
769 --fstab
770 Use /etc/fstab instead of /proc/self/mountinfo.
771
772 --add-fstab <filename>
773 Add entries of <filename> to the initramfs /etc/fstab.
774
775 --mount "<device> <mountpoint> <filesystem type> [<filesystem options>
776 [<dump frequency> [<fsck order>]]]"
777 Mount <device> on <mountpoint> with <filesystem type> in the
778 initramfs. <filesystem options>, <dump options> and <fsck order>
779 can be specified, see fstab manpage for the details. The default
780 <filesystem options> is "defaults". The default <dump frequency> is
781 "0". the default <fsck order> is "2".
782
783 --mount "<mountpoint>"
784 Like above, but <device>, <filesystem type> and <filesystem
785 options> are determined by looking at the current mounts.
786
787 --add-device <device>
788 Bring up <device> in initramfs, <device> should be the device name.
789 This can be useful in hostonly mode for resume support when your
790 swap is on LVM or an encrypted partition. [NB --device can be used
791 for compatibility with earlier releases]
792
793 -i, --include <SOURCE> <TARGET>
794 include the files in the SOURCE directory into the TARGET directory
795 in the final initramfs. If SOURCE is a file, it will be installed
796 to TARGET in the final initramfs. This parameter can be specified
797 multiple times.
798
799 -I, --install <file list>
800 install the space separated list of files into the initramfs.
801
802 Note
803 If [LIST] has multiple arguments, then you have to put these in
804 quotes. For example:
805
806 # dracut --install "/bin/foo /sbin/bar" ...
807
808 --install-optional <file list>
809 install the space separated list of files into the initramfs, if
810 they exist.
811
812 --gzip
813 Compress the generated initramfs using gzip. This will be done by
814 default, unless another compression option or --no-compress is
815 passed. Equivalent to "--compress=gzip -9"
816
817 --bzip2
818 Compress the generated initramfs using bzip2.
819
820 Warning
821 Make sure your kernel has bzip2 decompression support compiled
822 in, otherwise you will not be able to boot. Equivalent to
823 "--compress=bzip2"
824
825 --lzma
826 Compress the generated initramfs using lzma.
827
828 Warning
829 Make sure your kernel has lzma decompression support compiled
830 in, otherwise you will not be able to boot. Equivalent to "lzma
831 --compress=lzma -9"
832
833 --xz
834 Compress the generated initramfs using xz.
835
836 Warning
837 Make sure your kernel has xz decompression support compiled in,
838 otherwise you will not be able to boot. Equivalent to "lzma
839 --compress=xz --check=crc32 --lzma2=dict=1MiB"
840
841 --lzo
842 Compress the generated initramfs using lzop.
843
844 Warning
845 Make sure your kernel has lzo decompression support compiled in,
846 otherwise you will not be able to boot.
847
848 --lz4
849 Compress the generated initramfs using lz4.
850
851 Warning
852 Make sure your kernel has lz4 decompression support compiled in,
853 otherwise you will not be able to boot.
854
855 --zstd
856 Compress the generated initramfs using Zstandard.
857
858 Warning
859 Make sure your kernel has zstd decompression support compiled in,
860 otherwise you will not be able to boot.
861
862 --compress <compressor>
863 Compress the generated initramfs using the passed compression
864 program. If you pass it just the name of a compression program, it
865 will call that program with known-working arguments. If you pass a
866 quoted string with arguments, it will be called with exactly those
867 arguments. Depending on what you pass, this may result in an
868 initramfs that the kernel cannot decompress. The default value can
869 also be set via the INITRD_COMPRESS environment variable.
870
871 --no-compress
872 Do not compress the generated initramfs. This will override any
873 other compression options.
874
875 --reproducible
876 Create reproducible images.
877
878 --no-reproducible
879 Do not create reproducible images.
880
881 --list-modules
882 List all available dracut modules.
883
884 -M, --show-modules
885 Print included module’s name to standard output during build.
886
887 --keep
888 Keep the initramfs temporary directory for debugging purposes.
889
890 --printsize
891 Print out the module install size
892
893 --profile: Output profile information of the build process
894
895 --ro-mnt: Mount / and /usr read-only by default.
896
897 -L, --stdlog <level>
898 [0-6] Specify logging level (to standard error)
899
900 0 - suppress any messages
901 1 - only fatal errors
902 2 - all errors
903 3 - warnings
904 4 - info
905 5 - debug info (here starts lots of output)
906 6 - trace info (and even more)
907
908 --regenerate-all
909 Regenerate all initramfs images at the default location with the
910 kernel versions found on the system. Additional parameters are
911 passed through.
912
913 --loginstall <DIR>
914 Log all files installed from the host to <DIR>.
915
916 --uefi
917 Instead of creating an initramfs image, dracut will create an UEFI
918 executable, which can be executed by an UEFI BIOS. The default
919 output filename is
920 <EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi. <EFI>
921 might be /efi, /boot or /boot/efi depending on where the ESP
922 partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
923 /usr/lib/os-release or if it exists /etc/os-release and is left
924 out, if BUILD_ID is non-existant or empty.
925
926 --no-uefi
927 Disables UEFI mode.
928
929 --no-machineid
930 affects the default output filename of --uefi and will discard the
931 <MACHINE_ID> part.
932
933 --uefi-stub <FILE>
934 Specifies the UEFI stub loader, which will load the attached
935 kernel, initramfs and kernel command line and boots the kernel. The
936 default is
937 $prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub
938
939 --uefi-splash-image <FILE>
940 Specifies the UEFI stub loader’s splash image. Requires bitmap
941 (.bmp) image format.
942
943 --kernel-image <FILE>
944 Specifies the kernel image, which to include in the UEFI
945 executable. The default is /lib/modules/<KERNEL-VERSION>/vmlinuz or
946 /boot/vmlinuz-<KERNEL-VERSION>
947
949 INITRD_COMPRESS
950 sets the default compression program. See --compress.
951
952 DRACUT_LDCONFIG
953 sets the ldconfig program path and options. Optional. Used for
954 --sysroot.
955
956 Default: ldconfig
957
958 DRACUT_LDD
959 sets the ldd program path and options. Optional. Used for
960 --sysroot.
961
962 Default: ldd
963
964 DRACUT_TESTBIN
965 sets the initially tested binary for detecting library paths.
966 Optional. Used for --sysroot. In the cross-compiled sysroot, the
967 default value (/bin/sh) is unusable, as it is an absolute symlink
968 and points outside the sysroot directory.
969
970 Default: /bin/sh
971
972 DRACUT_INSTALL
973 overrides path and options for executing dracut-install internally.
974 Optional. Can be used to debug dracut-install while running the
975 main dracut script.
976
977 Default: dracut-install
978
979 Example: DRACUT_INSTALL="valgrind dracut-install"
980
981 DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2,
982 DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP,
983 DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD,
984 DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT
985 overrides for compression utilities to support using them from
986 non-standard paths.
987
988 Default values are the default compression utility names to be
989 found in PATH.
990
991 DRACUT_ARCH
992 overrides the value of uname -m. Used for --sysroot.
993
994 Default: empty (the value of uname -m on the host system)
995
996 SYSTEMD_VERSION
997 overrides systemd version. Used for --sysroot.
998
999 SYSTEMCTL
1000 overrides the systemctl binary. Used for --sysroot.
1001
1002 NM_VERSION
1003 overrides the NetworkManager version. Used for --sysroot.
1004
1005 DRACUT_INSTALL_PATH
1006 overrides PATH environment for dracut-install to look for binaries
1007 relative to --sysroot. In a cross-compiled environment (e.g.
1008 Yocto), PATH points to natively built binaries that are not in the
1009 host’s /bin, /usr/bin, etc. dracut-install still needs plain /bin
1010 and /usr/bin that are relative to the cross-compiled sysroot.
1011
1012 Default: PATH
1013
1014 DRACUT_INSTALL_LOG_TARGET
1015 overrides DRACUT_LOG_TARGET for dracut-install. It allows running
1016 dracut-install* to run with different log target that dracut** runs
1017 with.
1018
1019 Default: DRACUT_LOG_TARGET
1020
1021 DRACUT_INSTALL_LOG_LEVEL
1022 overrides DRACUT_LOG_LEVEL for dracut-install. It allows running
1023 dracut-install* to run with different log level that dracut** runs
1024 with.
1025
1026 Default: DRACUT_LOG_LEVEL
1027
1029 /var/log/dracut.log
1030 logfile of initramfs image creation
1031
1032 /tmp/dracut.log
1033 logfile of initramfs image creation, if /var/log/dracut.log is not
1034 writable
1035
1036 /etc/dracut.conf
1037 see dracut.conf5
1038
1039 /etc/dracut.conf.d/*.conf
1040 see dracut.conf5
1041
1042 /usr/lib/dracut/dracut.conf.d/*.conf
1043 see dracut.conf5
1044
1045 Configuration in the initramfs
1046 /etc/conf.d/
1047 Any files found in /etc/conf.d/ will be sourced in the initramfs to
1048 set initial values. Command line options will override these values
1049 set in the configuration files.
1050
1051 /etc/cmdline
1052 Can contain additional command line options. Deprecated, better use
1053 /etc/cmdline.d/*.conf.
1054
1055 /etc/cmdline.d/*.conf
1056 Can contain additional command line options.
1057
1059 The dracut command is part of the dracut package and is available from
1060 https://dracut.wiki.kernel.org
1061
1063 Harald Hoyer
1064
1065 Victor Lowther
1066
1067 Amadeusz Żołnowski
1068
1069 Hannes Reinecke
1070
1071 Daniel Molkentin
1072
1073 Will Woods
1074
1075 Philippe Seewer
1076
1077 Warren Togami
1078
1080 dracut.cmdline(7) dracut.conf(5) lsinitrd(1)
1081
1082
1083
1084dracut 054 05/14/2021 DRACUT(8)