1DRACUT(8)                           dracut                           DRACUT(8)
2
3
4

NAME

6       dracut - low-level tool for generating an initramfs/initrd image
7

SYNOPSIS

9       dracut [OPTION...] [<image> [<kernel version>]]
10

DESCRIPTION

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,
15       depending on bootloader specification, the default location can be
16       /efi/<machine-id>/<kernel-version>/initrd,
17       /boot/<machine-id>/<kernel-version>/initrd,
18       /boot/efi/<machine-id>/<kernel-version>/initrd,
19       /lib/modules/<kernel-version>/initrd or
20       /boot/initramfs-<kernel-version>.img.
21
22       dracut creates an initial image used by the kernel for preloading the
23       block device modules (such as IDE, SCSI or RAID) which are needed to
24       access the root filesystem, mounting the root filesystem and booting
25       into the real system.
26
27       At boot time, the kernel unpacks that archive into RAM disk, mounts and
28       uses it as initial root file system. All finding of the root device
29       happens in this early userspace.
30
31       Initramfs images are also called "initrd".
32
33       For a complete list of kernel command line options see
34       dracut.cmdline(7).
35
36       If you are dropped to an emergency shell, while booting your initramfs,
37       the file /run/initramfs/rdsosreport.txt is created, which can be saved
38       to a (to be mounted by hand) partition (usually /boot) or a USB stick.
39       Additional debugging info can be produced by adding rd.debug to the
40       kernel command line. /run/initramfs/rdsosreport.txt contains all logs
41       and the output of some tools. It should be attached to any report about
42       dracut problems.
43

USAGE

45       To create a initramfs image, the most simple command is:
46
47           # dracut
48
49       This will generate a general purpose initramfs image, with all possible
50       functionality resulting of the combination of the installed dracut
51       modules and system tools. The image, depending on bootloader
52       specification, can be /efi/<machine-id>/<kernel-version>/initrd,
53       /boot/<machine-id>/<kernel-version>/initrd,
54       /boot/efi/<machine-id>/<kernel-version>/initrd,
55       /lib/modules/<kernel-version>/initrd or
56       /boot/initramfs-<kernel-version>.img and contains the kernel modules of
57       the currently active kernel with version <kernel-version>.
58
59       If the initramfs image already exists, dracut will display an error
60       message, and to overwrite the existing image, you have to use the
61       --force option.
62
63           # dracut --force
64
65       If you want to specify another filename for the resulting image you
66       would issue a command like:
67
68           # dracut foobar.img
69
70       To generate an image for a specific kernel version, the command would
71       be:
72
73           # dracut foobar.img 2.6.40-1.rc5.f20
74
75       A shortcut to generate the image at the default location for a specific
76       kernel version is:
77
78           # dracut --kver 2.6.40-1.rc5.f20
79
80       If you want to create lighter, smaller initramfs images, you may want
81       to specify the --hostonly or -H option. Using this option, the
82       resulting image will contain only those dracut modules, kernel modules
83       and filesystems, which are needed to boot this specific machine. This
84       has the drawback, that you can’t put the disk on another controller or
85       machine, and that you can’t switch to another root filesystem, without
86       recreating the initramfs image. The usage of the --hostonly option is
87       only for experts and you will have to keep the broken pieces. At least
88       keep a copy of a general purpose image (and corresponding kernel) as a
89       fallback to rescue your system.
90
91   Inspecting the Contents
92       To see the contents of the image created by dracut, you can use the
93       lsinitrd tool.
94
95           # lsinitrd | less
96
97       To display the contents of a file in the initramfs also use the
98       lsinitrd tool:
99
100           # lsinitrd -f /etc/ld.so.conf
101           include ld.so.conf.d/*.conf
102
103   Adding dracut Modules
104       Some dracut modules are turned off by default and have to be activated
105       manually. You can do this by adding the dracut modules to the
106       configuration file /etc/dracut.conf or /etc/dracut.conf.d/myconf.conf.
107       See dracut.conf(5). You can also add dracut modules on the command line
108       by using the -a or --add option:
109
110           # dracut --add module initramfs-module.img
111
112       To see a list of available dracut modules, use the --list-modules
113       option:
114
115           # dracut --list-modules
116
117   Omitting dracut Modules
118       Sometimes you don’t want a dracut module to be included for reasons of
119       speed, size or functionality. To do this, either specify the
120       omit_dracutmodules variable in the dracut.conf or
121       /etc/dracut.conf.d/myconf.conf configuration file (see dracut.conf(5)),
122       or use the -o or --omit option on the command line:
123
124           # dracut -o "multipath lvm" no-multipath-lvm.img
125
126   Adding Kernel Modules
127       If you need a special kernel module in the initramfs, which is not
128       automatically picked up by dracut, you have the use the --add-drivers
129       option on the command line or the drivers variable in the
130       /etc/dracut.conf or /etc/dracut.conf.d/myconf.conf configuration file
131       (see dracut.conf(5)):
132
133           # dracut --add-drivers mymod initramfs-with-mymod.img
134
135   Boot parameters
136       An initramfs generated without the "hostonly" mode, does not contain
137       any system configuration files (except for some special exceptions), so
138       the configuration has to be done on the kernel command line. With this
139       flexibility, you can easily boot from a changed root partition, without
140       the need to recompile the initramfs image. So, you could completely
141       change your root partition (move it inside a md raid with encryption
142       and LVM on top), as long as you specify the correct filesystem LABEL or
143       UUID on the kernel command line for your root device, dracut will find
144       it and boot from it.
145
146       The kernel command line can also be provided by the dhcp server with
147       the root-path option. See the section called “Network Boot”.
148
149       For a full reference of all kernel command line parameters, see
150       dracut.cmdline(7).
151
152       To get a quick start for the suitable kernel command line on your
153       system, use the --print-cmdline option:
154
155           # dracut --print-cmdline
156            root=UUID=8b8b6f91-95c7-4da2-831b-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4
157
158       Specifying the root Device
159           This is the only option dracut really needs to boot from your root
160           partition. Because your root partition can live in various
161           environments, there are a lot of formats for the root= option. The
162           most basic one is root=<path to device node>:
163
164               root=/dev/sda2
165
166           Because device node names can change, dependent on the drive
167           ordering, you are encouraged to use the filesystem identifier
168           (UUID) or filesystem label (LABEL) to specify your root partition:
169
170               root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331
171
172           or
173
174               root=LABEL=myrootpartitionlabel
175
176           To see all UUIDs or LABELs on your system, do:
177
178               # ls -l /dev/disk/by-uuid
179
180           or
181
182               # ls -l /dev/disk/by-label
183
184           If your root partition is on the network see the section called
185           “Network Boot”.
186
187       Keyboard Settings
188           If you have to input passwords for encrypted disk volumes, you
189           might want to set the keyboard layout and specify a display font.
190
191           A typical german kernel command line would contain:
192
193               rd.vconsole.font=eurlatgr rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8
194
195           Setting these options can override the setting stored on your
196           system, if you use a modern init system, like systemd.
197
198       Blacklisting Kernel Modules
199           Sometimes it is required to prevent the automatic kernel module
200           loading of a specific kernel module. To do this, just add
201           rd.blacklist=<kernel module name>, with <kernel module name> not
202           containing the .ko suffix, to the kernel command line. For example:
203
204               rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau
205
206           The option can be specified multiple times on the kernel command
207           line.
208
209       Speeding up the Boot Process
210           If you want to speed up the boot process, you can specify as much
211           information for dracut on the kernel command as possible. For
212           example, you can tell dracut, that you root partition is not on a
213           LVM volume or not on a raid partition, or that it lives inside a
214           specific crypto LUKS encrypted volume. By default, dracut searches
215           everywhere. A typical dracut kernel command line for a plain
216           primary or logical partition would contain:
217
218               rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0
219
220           This turns off every automatic assembly of LVM, MD raids, DM raids
221           and crypto LUKS.
222
223           Of course, you could also omit the dracut modules in the initramfs
224           creation process, but then you would lose the possibility to turn
225           it on on demand.
226
227   Injecting custom Files
228       To add your own files to the initramfs image, you have several
229       possibilities.
230
231       The --include option let you specify a source path and a target path.
232       For example
233
234           # dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img
235
236       will create an initramfs image, where the file cmdline-preset will be
237       copied inside the initramfs to /etc/cmdline.d/mycmdline.conf. --include
238       can only be specified once.
239
240           # mkdir -p rd.live.overlay/etc/cmdline.d
241           # mkdir -p rd.live.overlay/etc/conf.d
242           # echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf
243           # echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
244           # echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf
245           # tree rd.live.overlay/
246           rd.live.overlay/
247           `-- etc
248               |-- cmdline.d
249               |   `-- mycmdline.conf
250               `-- conf.d
251                   `-- testvar.conf
252
253           # dracut --include rd.live.overlay / initramfs-rd.live.overlay.img
254
255       This will put the contents of the rd.live.overlay directory into the
256       root of the initramfs image.
257
258       The --install option let you specify several files, which will get
259       installed in the initramfs image at the same location, as they are
260       present on initramfs creation time.
261
262           # dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img
263
264       This will create an initramfs with the strace, fsck.ext3 and ssh
265       executables, together with the libraries needed to start those. The
266       --install option can be specified multiple times.
267
268   Network Boot
269       If your root partition is on a network drive, you have to have the
270       network dracut modules installed to create a network aware initramfs
271       image.
272
273       If you specify ip=dhcp on the kernel command line, then dracut asks a
274       dhcp server about the ip address for the machine. The dhcp server can
275       also serve an additional root-path, which will set the root device for
276       dracut. With this mechanism, you have static configuration on your
277       client machine and a centralized boot configuration on your TFTP/DHCP
278       server. If you can’t pass a kernel command line, then you can inject
279       /etc/cmdline.d/mycmdline.conf, with a method described in the section
280       called “Injecting custom Files”.
281
282       Reducing the Image Size
283           To reduce the size of the initramfs, you should create it with by
284           omitting all dracut modules, which you know, you don’t need to boot
285           the machine.
286
287           You can also specify the exact dracut and kernel modules to produce
288           a very tiny initramfs image.
289
290           For example for a NFS image, you would do:
291
292               # dracut -m "nfs network base" initramfs-nfs-only.img
293
294           Then you would boot from this image with your target machine and
295           reduce the size once more by creating it on the target machine with
296           the --host-only option:
297
298               # dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img
299
300           This will reduce the size of the initramfs image significantly.
301

TROUBLESHOOTING

303       If the boot process does not succeed, you have several options to debug
304       the situation. Some of the basic operations are covered here. For more
305       information you should also visit:
306       https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
307
308   Identifying your problem area
309        1. Remove 'rhgb' and 'quiet' from the kernel command line
310
311        2. Add 'rd.shell' to the kernel command line. This will present a
312           shell should dracut be unable to locate your root device
313
314        3. Add 'rd.shell rd.debug log_buf_len=1M' to the kernel command line
315           so that dracut shell commands are printed as they are executed
316
317        4. The file /run/initramfs/rdsosreport.txt is generated, which
318           contains all the logs and the output of all significant tools,
319           which are mentioned later.
320
321       If you want to save that output, simply mount /boot by hand or insert
322       an USB stick and mount that. Then you can store the output for later
323       inspection.
324
325   Information to include in your report
326       All bug reports
327           In all cases, the following should be mentioned and attached to
328           your bug report:
329
330           •   The exact kernel command-line used. Typically from the
331               bootloader configuration file (e.g.  /boot/grub2/grub.cfg) or
332               from /proc/cmdline.
333
334           •   A copy of your disk partition information from /etc/fstab,
335               which might be obtained booting an old working initramfs or a
336               rescue medium.
337
338           •   Turn on dracut debugging (see the debugging dracut section),
339               and attach the file /run/initramfs/rdsosreport.txt.
340
341           •   If you use a dracut configuration file, please include
342               /etc/dracut.conf and all files in /etc/dracut.conf.d/*.conf
343
344       Network root device related problems
345           This section details information to include when experiencing
346           problems on a system whose root device is located on a network
347           attached volume (e.g. iSCSI, NFS or NBD). As well as the
348           information from the section called “All bug reports”, include the
349           following information:
350
351           •   Please include the output of
352
353                   # /sbin/ifup <interfacename>
354                   # ip addr show
355
356   Debugging dracut
357       Configure a serial console
358           Successfully debugging dracut will require some form of console
359           logging during the system boot. This section documents configuring
360           a serial console connection to record boot messages.
361
362            1. First, enable serial console output for both the kernel and the
363               bootloader.
364
365            2. Open the file /boot/grub2/grub.cfg for editing. Below the line
366               'timeout=5', add the following:
367
368                   serial --unit=0 --speed=9600
369                   terminal --timeout=5 serial console
370
371            3. Also in /boot/grub2/grub.cfg, add the following boot arguments
372               to the 'kernel' line:
373
374                   console=tty0 console=ttyS0,9600
375
376            4. When finished, the /boot/grub2/grub.cfg file should look
377               similar to the example below.
378
379                   default=0
380                   timeout=5
381                   serial --unit=0 --speed=9600
382                   terminal --timeout=5 serial console
383                   title Fedora (2.6.29.5-191.fc11.x86_64)
384                     root (hd0,0)
385                     kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600
386                     initrd /dracut-2.6.29.5-191.fc11.x86_64.img
387
388            5. More detailed information on how to configure the kernel for
389               console output can be found at
390               http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL.
391
392            6. Redirecting non-interactive output
393
394                   Note
395                   You can redirect all non-interactive output to /dev/kmsg
396                   and the kernel will put it out on the console when it
397                   reaches the kernel buffer by doing
398
399                   # exec >/dev/kmsg 2>&1 </dev/console
400
401       Using the dracut shell
402           dracut offers a shell for interactive debugging in the event dracut
403           fails to locate your root filesystem. To enable the shell:
404
405            1. Add the boot parameter 'rd.shell' to your bootloader
406               configuration file (e.g.  /boot/grub2/grub.cfg)
407
408            2. Remove the boot arguments 'rhgb' and 'quiet'
409
410               A sample /boot/grub2/grub.cfg bootloader configuration file is
411               listed below.
412
413                   default=0
414                   timeout=5
415                   serial --unit=0 --speed=9600
416                   terminal --timeout=5 serial console
417                   title Fedora (2.6.29.5-191.fc11.x86_64)
418                     root (hd0,0)
419                     kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell
420                     initrd /dracut-2.6.29.5-191.fc11.x86_64.img
421
422            3. If system boot fails, you will be dropped into a shell as seen
423               in the example below.
424
425                   No root device found
426                   Dropping to debug shell.
427
428                   #
429
430            4. Use this shell prompt to gather the information requested above
431               (see the section called “All bug reports”).
432
433       Accessing the root volume from the dracut shell
434           From the dracut debug shell, you can manually perform the task of
435           locating and preparing your root volume for boot. The required
436           steps will depend on how your root volume is configured. Common
437           scenarios include:
438
439           •   A block device (e.g.  /dev/sda7)
440
441           •   A LVM logical volume (e.g.  /dev/VolGroup00/LogVol00)
442
443           •   An encrypted device (e.g.
444               /dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83)
445
446           •   A network attached device (e.g.
447               netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all)
448
449           The exact method for locating and preparing will vary. However, to
450           continue with a successful boot, the objective is to locate your
451           root volume and create a symlink /dev/root which points to the file
452           system. For example, the following example demonstrates accessing
453           and booting a root volume that is an encrypted LVM Logical volume.
454
455            1. Inspect your partitions using parted
456
457                   # parted /dev/sda -s p
458                   Model: ATA HTS541060G9AT00 (scsi)
459                   Disk /dev/sda: 60.0GB
460                   Sector size (logical/physical): 512B/512B
461                   Partition Table: msdos
462                   Number  Start   End     Size    Type      File system  Flags
463                   1      32.3kB  10.8GB  107MB   primary   ext4         boot
464                   2      10.8GB  55.6GB  44.7GB  logical                lvm
465
466            2. You recall that your root volume was a LVM logical volume. Scan
467               and activate any logical volumes.
468
469                   # lvm vgscan
470                   # lvm vgchange -ay
471
472            3. You should see any logical volumes now using the command blkid:
473
474                   # blkid
475                   /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4"
476                   /dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member"
477                   /dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS"
478                   /dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3"
479                   /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"
480
481            4. From the output above, you recall that your root volume exists
482               on an encrypted block device. Following the guidance disk
483               encryption guidance from the Installation Guide, you unlock
484               your encrypted root volume.
485
486                   # UUID=$(cryptsetup luksUUID /dev/mapper/linux-root)
487                   # cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID
488                   Enter passphrase for /dev/mapper/linux-root:
489                   Key slot 0 unlocked.
490
491            5. Next, make a symbolic link to the unlocked root volume
492
493                   # ln -s /dev/mapper/luks-$UUID /dev/root
494
495            6. With the root volume available, you may continue booting the
496               system by exiting the dracut shell
497
498                   # exit
499
500       Additional dracut boot parameters
501           For more debugging options, see dracut.cmdline(7).
502
503       Debugging dracut on shutdown
504           To debug the shutdown sequence on systemd systems, you can rd.break
505           on pre-shutdown or shutdown.
506
507           To do this from an already booted system:
508
509               # mkdir -p /run/initramfs/etc/cmdline.d
510               # echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf
511               # touch /run/initramfs/.need_shutdown
512
513           This will give you a dracut shell after the system pivot’ed back in
514           the initramfs.
515

OPTIONS

517       --kver <kernel version>
518           Set the kernel version. This enables to specify the kernel version,
519           without specifying the location of the initramfs image. For
520           example:
521
522           # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64
523
524       -f, --force
525           Overwrite existing initramfs file.
526
527       <output file> --rebuild
528           Append the current arguments to those with which the input
529           initramfs image was built. This option helps in incrementally
530           building the initramfs for testing. If optional <output file> is
531           not provided, the input initramfs provided to rebuild will be used
532           as output file.
533
534       -a, --add <list of dracut modules>
535           Add a space-separated list of dracut modules to the default set of
536           modules. This parameter can be specified multiple times.
537
538               Note
539               If the list has multiple arguments, then you have to put these
540               in quotes. For example:
541
542                   # dracut --add "module1 module2"  ...
543
544       --force-add <list of dracut modules>
545           Force to add a space-separated list of dracut modules to the
546           default set of modules, when -H is specified. This parameter can be
547           specified multiple times.
548
549               Note
550               If the list has multiple arguments, then you have to put these
551               in quotes. For example:
552
553                   # dracut --force-add "module1 module2"  ...
554
555       -o, --omit <list of dracut modules>
556           Omit a space-separated list of dracut modules. This parameter can
557           be specified multiple times.
558
559               Note
560               If the list has multiple arguments, then you have to put these
561               in quotes. For example:
562
563                   # dracut --omit "module1 module2"  ...
564
565       -m, --modules <list of dracut modules>
566           Specify a space-separated list of dracut modules to call when
567           building the initramfs. Modules are located in
568           /usr/lib/dracut/modules.d. This parameter can be specified multiple
569           times. This option forces dracut to only include the specified
570           dracut modules. In most cases the "--add" option is what you want
571           to use.
572
573               Note
574               If the list has multiple arguments, then you have to put these
575               in quotes. For example:
576
577                   # dracut --modules "module1 module2"  ...
578
579       -d, --drivers <list of kernel modules>
580           Specify a space-separated list of kernel modules to exclusively
581           include in the initramfs. The kernel modules have to be specified
582           without the ".ko" suffix. This parameter can be specified multiple
583           times.
584
585               Note
586               If the list has multiple arguments, then you have to put these
587               in quotes. For example:
588
589                   # dracut --drivers "kmodule1 kmodule2"  ...
590
591       --add-drivers <list of kernel modules>
592           Specify a space-separated list of kernel modules to add to the
593           initramfs. The kernel modules have to be specified without the
594           ".ko" suffix. This parameter can be specified multiple times.
595
596               Note
597               If the list has multiple arguments, then you have to put these
598               in quotes. For example:
599
600                   # dracut --add-drivers "kmodule1 kmodule2"  ...
601
602       --force-drivers <list of kernel modules>
603           See add-drivers above. But in this case it is ensured that the
604           drivers are tried to be loaded early via modprobe.
605
606               Note
607               If the list has multiple arguments, then you have to put these
608               in quotes. For example:
609
610                   # dracut --force-drivers "kmodule1 kmodule2"  ...
611
612       --omit-drivers <list of kernel modules>
613           Specify a space-separated list of kernel modules not to add to the
614           initramfs. The kernel modules have to be specified without the
615           ".ko" suffix. This parameter can be specified multiple times.
616
617               Note
618               If the list has multiple arguments, then you have to put these
619               in quotes. For example:
620
621                   # dracut --omit-drivers "kmodule1 kmodule2"  ...
622
623       --filesystems <list of filesystems>
624           Specify a space-separated list of kernel filesystem modules to
625           exclusively include in the generic initramfs. This parameter can be
626           specified multiple times.
627
628               Note
629               If the list has multiple arguments, then you have to put these
630               in quotes. For example:
631
632                   # dracut --filesystems "filesystem1 filesystem2"  ...
633
634       -k, --kmoddir <kernel directory>
635           Specify the directory, where to look for kernel modules.
636
637       --fwdir <dir>[:<dir>...]++
638           Specify additional directories, where to look for firmwares. This
639           parameter can be specified multiple times.
640
641       --libdirs <list of directories>
642           Specify a space-separated list of directories to look for libraries
643           to include in the generic initramfs. This parameter can be
644           specified multiple times.
645
646               Note
647               If the list has multiple arguments, then you have to put these
648               in quotes. For example:
649
650                   # dracut --libdirs "dir1 dir2"  ...
651
652       --kernel-cmdline <parameters>
653           Specify default kernel command line parameters.
654
655       --kernel-only
656           Only install kernel drivers and firmware files.
657
658       --no-kernel
659           Do not install kernel drivers and firmware files.
660
661       --early-microcode
662           Combine early microcode with ramdisk.
663
664       --no-early-microcode
665           Do not combine early microcode with ramdisk.
666
667       --print-cmdline
668           Print the kernel command line for the current disk layout.
669
670       --mdadmconf
671           Include local /etc/mdadm.conf file.
672
673       --nomdadmconf
674           Do not include local /etc/mdadm.conf file.
675
676       --lvmconf
677           Include local /etc/lvm/lvm.conf file.
678
679       --nolvmconf
680           Do not include local /etc/lvm/lvm.conf file.
681
682       --fscks <list of fsck tools>
683           Add a space-separated list of fsck tools, in addition to
684           dracut.conf's specification; the installation is opportunistic
685           (non-existing tools are ignored).
686
687               Note
688               If the list has multiple arguments, then you have to put these
689               in quotes. For example:
690
691                   # dracut --fscks "fsck.foo barfsck"  ...
692
693       --nofscks
694           Inhibit installation of any fsck tools.
695
696       --strip
697           Strip binaries in the initramfs (default).
698
699       --aggresive-strip
700           Strip more than just debug symbol and sections, for a smaller
701           initramfs build. The --strip option must also be specified.
702
703       --nostrip
704           Do not strip binaries in the initramfs.
705
706       --hardlink
707           Hardlink files in the initramfs (default).
708
709       --nohardlink
710           Do not hardlink files in the initramfs.
711
712       --prefix <dir>
713           Prefix initramfs files with the specified directory.
714
715       --noprefix
716           Do not prefix initramfs files (default).
717
718       -h, --help
719           Display help text and exit.
720
721       --debug
722           Output debug information of the build process.
723
724       -v, --verbose
725           Increase verbosity level (default is info(4)).
726
727       --version
728           Display version and exit.
729
730       -q, --quiet
731           Decrease verbosity level (default is info(4)).
732
733       -c, --conf <dracut configuration file>
734           Specify configuration file to use.
735
736           Default: /etc/dracut.conf
737
738       --confdir <configuration directory>
739           Specify configuration directory to use.
740
741           Default: /etc/dracut.conf.d
742
743       --tmpdir <temporary directory>
744           Specify temporary directory to use.
745
746           Default: /var/tmp
747
748       -r, --sysroot <sysroot directory>
749           Specify the sysroot directory to collect files from. This is useful
750           to create the initramfs image from a cross-compiled sysroot
751           directory. For the extra helper variables, see ENVIRONMENT below.
752
753           Default: empty
754
755       --sshkey <sshkey file>
756           SSH key file used with ssh-client module.
757
758       --logfile <logfile>
759           Logfile to use; overrides any setting from the configuration files.
760
761           Default: /var/log/dracut.log
762
763       -l, --local
764           Activates the local mode. dracut will use modules from the current
765           working directory instead of the system-wide installed modules in
766           /usr/lib/dracut/modules.d. This is useful when running dracut from
767           a git checkout.
768
769       -H, --hostonly
770           Host-only mode: Install only what is needed for booting the local
771           host instead of a generic host and generate host-specific
772           configuration.
773
774               Warning
775               If chrooted to another root other than the real root device,
776               use "--fstab" and provide a valid /etc/fstab.
777
778       -N, --no-hostonly
779           Disable host-only mode.
780
781       --hostonly-mode <mode>
782           Specify the host-only mode to use.  <mode> could be one of "sloppy"
783           or "strict". In "sloppy" host-only mode, extra drivers and modules
784           will be installed, so minor hardware change won’t make the image
785           unbootable (e.g. changed keyboard), and the image is still portable
786           among similar hosts. With "strict" mode enabled, anything not
787           necessary for booting the local host in its current state will not
788           be included, and modules may do some extra job to save more space.
789           Minor change of hardware or environment could make the image
790           unbootable.
791
792           Default: sloppy
793
794       --hostonly-cmdline
795           Store kernel command line arguments needed in the initramfs.
796
797       --no-hostonly-cmdline
798           Do not store kernel command line arguments needed in the initramfs.
799
800       --no-hostonly-default-device
801           Do not generate implicit host devices like root, swap, fstab, etc.
802           Use "--mount" or "--add-device" to explicitly add devices as
803           needed.
804
805       --hostonly-i18n
806           Install only needed keyboard and font files according to the host
807           configuration (default).
808
809       --no-hostonly-i18n
810           Install all keyboard and font files available.
811
812       --hostonly-nics <list of nics>
813           Only enable listed NICs in the initramfs. The list can be empty, so
814           other modules can install only the necessary network drivers.
815
816       --persistent-policy <policy>
817           Use <policy> to address disks and partitions.  <policy> can be any
818           directory name found in /dev/disk. E.g. "by-uuid", "by-label"
819
820       --fstab
821           Use /etc/fstab instead of /proc/self/mountinfo.
822
823       --add-fstab <filename>
824           Add entries of <filename> to the initramfs /etc/fstab.
825
826       --mount "<device> <mountpoint> <filesystem type> [<filesystem options>
827       [<dump frequency> [<fsck order>]]]"
828           Mount <device> on <mountpoint> with <filesystem type> in the
829           initramfs.  <filesystem options>, <dump options> and <fsck order>
830           can be specified, see fstab manpage for the details. The default
831           <filesystem options> is "defaults". The default <dump frequency> is
832           "0". The default <fsck order> is "2".
833
834       --mount "<mountpoint>"
835           Like above, but <device>, <filesystem type> and <filesystem
836           options> are determined by looking at the current mounts.
837
838       --add-device <device>
839           Bring up <device> in initramfs, <device> should be the device name.
840           This can be useful in host-only mode for resume support when your
841           swap is on LVM or an encrypted partition. [NB --device can be used
842           for compatibility with earlier releases]
843
844       -i, --include <SOURCE> <TARGET>
845           Include the files in the SOURCE directory into the TARGET directory
846           in the final initramfs. If SOURCE is a file, it will be installed
847           to TARGET in the final initramfs. This parameter can be specified
848           multiple times.
849
850       -I, --install <file list>
851           Install the space separated list of files into the initramfs.
852
853               Note
854               If the list has multiple arguments, then you have to put these
855               in quotes. For example:
856
857                   # dracut --install "/bin/foo /sbin/bar"  ...
858
859       --install-optional <file list>
860           Install the space separated list of files into the initramfs, if
861           they exist.
862
863       --gzip
864           Compress the generated initramfs using gzip. This will be done by
865           default, unless another compression option or --no-compress is
866           passed. Equivalent to "--compress=gzip -9".
867
868       --bzip2
869           Compress the generated initramfs using bzip2.
870
871               Warning
872               Make sure your kernel has bzip2 decompression support compiled
873               in, otherwise you will not be able to boot. Equivalent to
874               "--compress=bzip2 -9".
875
876       --lzma
877           Compress the generated initramfs using lzma.
878
879               Warning
880               Make sure your kernel has lzma decompression support compiled
881               in, otherwise you will not be able to boot. Equivalent to
882               "--compress=lzma -9 -T0".
883
884       --xz
885           Compress the generated initramfs using xz.
886
887               Warning
888               Make sure your kernel has xz decompression support compiled in,
889               otherwise you will not be able to boot. Equivalent to
890               "--compress=xz --check=crc32 --lzma2=dict=1MiB -T0".
891
892       --lzo
893           Compress the generated initramfs using lzop.
894
895               Warning
896               Make sure your kernel has lzo decompression support compiled
897               in, otherwise you will not be able to boot. Equivalent to
898               "--compress=lzop -9".
899
900       --lz4
901           Compress the generated initramfs using lz4.
902
903               Warning
904               Make sure your kernel has lz4 decompression support compiled
905               in, otherwise you will not be able to boot. Equivalent to
906               "--compress=lz4 -l -9".
907
908       --zstd
909           Compress the generated initramfs using Zstandard.
910
911               Warning
912               Make sure your kernel has zstd decompression support compiled
913               in, otherwise you will not be able to boot. Equivalent to
914               "--compress=zstd -15 -q -T0".
915
916       --compress <compressor>
917           Compress the generated initramfs using the passed compression
918           program. If you pass it just the name of a compression program, it
919           will call that program with known-working arguments. If you pass a
920           quoted string with arguments, it will be called with exactly those
921           arguments. Depending on what you pass, this may result in an
922           initramfs that the kernel cannot decompress. The default value can
923           also be set via the INITRD_COMPRESS environment variable.
924
925       --squash-compressor <compressor>
926           Compress the squashfs image using the passed compressor and
927           compressor specific options for mksquashfs. You can refer to
928           mksquashfs manual for supported compressors and compressor specific
929           options. If squash module is not called when building the
930           initramfs, this option will not take effect.
931
932       --no-compress
933           Do not compress the generated initramfs. This will override any
934           other compression options.
935
936       --reproducible
937           Create reproducible images.
938
939       --no-reproducible
940           Do not create reproducible images.
941
942       --list-modules
943           List all available dracut modules.
944
945       -M, --show-modules
946           Print included module’s name to standard output during build.
947
948       --keep
949           Keep the initramfs temporary directory for debugging purposes.
950
951       --printsize
952           Print out the module install size.
953
954       --profile
955           Output profile information of the build process.
956
957       --ro-mnt
958           Mount / and /usr read-only by default.
959
960       -L, --stdlog <level>
961           [0-6] Specify logging level (to standard error).
962
963                     0 - suppress any messages
964                     1 - only fatal errors
965                     2 - all errors
966                     3 - warnings
967                     4 - info
968                     5 - debug info (here starts lots of output)
969                     6 - trace info (and even more)
970
971       --regenerate-all
972           Regenerate all initramfs images at the default location with the
973           kernel versions found on the system. Additional parameters are
974           passed through.
975
976       -p, --parallel
977           Try to execute tasks in parallel. Currently only supported with
978           --regenerate-all (build initramfs images for all kernel versions
979           simultaneously).
980
981       --noimageifnotneeded
982           Do not create an image in host-only mode, if no kernel driver is
983           needed and no /etc/cmdline/*.conf will be generated into the
984           initramfs.
985
986       --loginstall <directory>
987           Log all files installed from the host to <directory>.
988
989       --uefi
990           Instead of creating an initramfs image, dracut will create an UEFI
991           executable, which can be executed by an UEFI BIOS. The default
992           output filename is
993           <EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi. <EFI>
994           might be /efi, /boot or /boot/efi depending on where the ESP
995           partition is mounted. The <BUILD_ID> is taken from BUILD_ID in
996           /usr/lib/os-release or if it exists /etc/os-release and is left
997           out, if BUILD_ID is non-existant or empty.
998
999       --no-uefi
1000           Disables UEFI mode.
1001
1002       --no-machineid
1003           Affects the default output filename of --uefi and will discard the
1004           <MACHINE_ID> part.
1005
1006       --uefi-stub <file>
1007           Specifies the UEFI stub loader, which will load the attached
1008           kernel, initramfs and kernel command line and boots the kernel. The
1009           default is
1010           $prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub.
1011
1012       --uefi-splash-image <file>
1013           Specifies the UEFI stub loader’s splash image. Requires bitmap
1014           (.bmp) image format.
1015
1016       --kernel-image <file>
1017           Specifies the kernel image, which to include in the UEFI
1018           executable. The default is /lib/modules/<KERNEL-VERSION>/vmlinuz or
1019           /boot/vmlinuz-<KERNEL-VERSION>.
1020
1021       --enhanced-cpio
1022           Attempt to use the dracut-cpio binary, which optimizes archive
1023           creation for copy-on-write filesystems by using the
1024           copy_file_range(2) syscall via Rust’s io::copy(). When specified,
1025           initramfs archives are also padded to ensure optimal data alignment
1026           for extent sharing. To retain reflink data deduplication benefits,
1027           this should be used alongside the --no-compress and --no-strip
1028           parameters, with initramfs source files, --tmpdir staging area and
1029           destination all on the same copy-on-write capable filesystem.
1030

ENVIRONMENT

1032       INITRD_COMPRESS
1033           sets the default compression program. See --compress.
1034
1035       DRACUT_LDCONFIG
1036           sets the ldconfig program path and options. Optional. Used for
1037           --sysroot.
1038
1039           Default: ldconfig
1040
1041       DRACUT_LDD
1042           sets the ldd program path and options. Optional. Used for
1043           --sysroot.
1044
1045           Default: ldd
1046
1047       DRACUT_TESTBIN
1048           sets the initially tested binary for detecting library paths.
1049           Optional. Used for --sysroot. In the cross-compiled sysroot, the
1050           default value (/bin/sh) is unusable, as it is an absolute symlink
1051           and points outside the sysroot directory.
1052
1053           Default: /bin/sh
1054
1055       DRACUT_INSTALL
1056           overrides path and options for executing dracut-install internally.
1057           Optional. Can be used to debug dracut-install while running the
1058           main dracut script.
1059
1060           Default: dracut-install
1061
1062           Example: DRACUT_INSTALL="valgrind dracut-install"
1063
1064       DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_BZIP2, DRACUT_COMPRESS_LBZIP2,
1065       DRACUT_COMPRESS_LZMA, DRACUT_COMPRESS_XZ, DRACUT_COMPRESS_GZIP,
1066       DRACUT_COMPRESS_PIGZ, DRACUT_COMPRESS_LZOP, DRACUT_COMPRESS_ZSTD,
1067       DRACUT_COMPRESS_LZ4, DRACUT_COMPRESS_CAT
1068           overrides for compression utilities to support using them from
1069           non-standard paths.
1070
1071           Default values are the default compression utility names to be
1072           found in PATH.
1073
1074       DRACUT_ARCH
1075           overrides the value of uname -m. Used for --sysroot.
1076
1077           Default: empty (the value of uname -m on the host system)
1078
1079       SYSTEMD_VERSION
1080           overrides systemd version. Used for --sysroot.
1081
1082       SYSTEMCTL
1083           overrides the systemctl binary. Used for --sysroot.
1084
1085       NM_VERSION
1086           overrides the NetworkManager version. Used for --sysroot.
1087
1088       DRACUT_INSTALL_PATH
1089           overrides PATH environment for dracut-install to look for binaries
1090           relative to --sysroot. In a cross-compiled environment (e.g.
1091           Yocto), PATH points to natively built binaries that are not in the
1092           host’s /bin, /usr/bin, etc.  dracut-install still needs plain /bin
1093           and /usr/bin that are relative to the cross-compiled sysroot.
1094
1095           Default: PATH
1096
1097       DRACUT_INSTALL_LOG_TARGET
1098           overrides DRACUT_LOG_TARGET for dracut-install. It allows running
1099           dracut-install* to run with different log target that dracut** runs
1100           with.
1101
1102           Default: DRACUT_LOG_TARGET
1103
1104       DRACUT_INSTALL_LOG_LEVEL
1105           overrides DRACUT_LOG_LEVEL for dracut-install. It allows running
1106           dracut-install* to run with different log level that dracut** runs
1107           with.
1108
1109           Default: DRACUT_LOG_LEVEL
1110

FILES

1112       /var/log/dracut.log
1113           logfile of initramfs image creation
1114
1115       /tmp/dracut.log
1116           logfile of initramfs image creation, if /var/log/dracut.log is not
1117           writable
1118
1119       /etc/dracut.conf
1120           see dracut.conf5
1121
1122       /etc/dracut.conf.d/*.conf
1123           see dracut.conf5
1124
1125       /usr/lib/dracut/dracut.conf.d/*.conf
1126           see dracut.conf5
1127
1128   Configuration in the initramfs
1129       /etc/conf.d/
1130           Any files found in /etc/conf.d/ will be sourced in the initramfs to
1131           set initial values. Command line options will override these values
1132           set in the configuration files.
1133
1134       /etc/cmdline
1135           Can contain additional command line options. Deprecated, better use
1136           /etc/cmdline.d/*.conf.
1137
1138       /etc/cmdline.d/*.conf
1139           Can contain additional command line options.
1140

AVAILABILITY

1142       The dracut command is part of the dracut package and is available from
1143       https://dracut.wiki.kernel.org
1144

AUTHORS

1146       Harald Hoyer
1147
1148       Victor Lowther
1149
1150       Amadeusz Żołnowski
1151
1152       Hannes Reinecke
1153
1154       Daniel Molkentin
1155
1156       Will Woods
1157
1158       Philippe Seewer
1159
1160       Warren Togami
1161

SEE ALSO

1163       dracut.cmdline(7) dracut.conf(5) lsinitrd(1)
1164
1165
1166
1167dracut 057-4-gb46b3749            07/01/2022                         DRACUT(8)
Impressum