Dracut linux что это
Dracut linux что это
SYNOPSIS
DESCRIPTION
dracut creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem, mounting the root filesystem and booting into the real system.
At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it as initial root file system. All finding of the root device happens in this early userspace.
Initramfs images are also called «initrd».
For a complete list of kernel command line options see dracut.cmdline(7).
If you are dropped to an emergency shell, while booting your initramfs, the file /run/initramfs/rdsosreport.txt is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick. Additional debugging info can be produced by adding rd.debug to the kernel command line. /run/initramfs/rdsosreport.txt contains all logs and the output of some tools. It should be attached to any report about dracut problems.
USAGE
To create a initramfs image, the most simple command is:
If you want to specify another filename for the resulting image you would issue a command like:
To generate an image for a specific kernel version, the command would be:
A shortcut to generate the image at the default location for a specific kernel version is:
Inspecting the Contents
To see the contents of the image created by dracut, you can use the lsinitrd tool.
To display the contents of a file in the initramfs also use the lsinitrd tool:
Adding dracut Modules
Omitting dracut Modules
Adding Kernel Modules
Boot parameters
An initramfs generated without the «hostonly» mode, does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image. So, you could completly change your root partition (move it inside a md raid with encryption and LVM on top), as long as you specify the correct filesystem LABEL or UUID on the kernel command line for your root device, dracut will find it and boot from it.
The kernel command line can also be provided by the dhcp server with the root-path option. See the section called «Network Boot».
For a full reference of all kernel command line parameters, see dracut.cmdline(5).
To get a quick start for the suitable kernel command line on your system, use the —print-cmdline option:
Specifying the root Device
This is the only option dracut really needs to boot from your root partition. Because your root partition can live in various environments, there are a lot of formats for the root= option. The most basic one is root=
Because device node names can change, dependent on the drive ordering, you are encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) to specify your root partition:
To see all UUIDs or LABELs on your system, do:
If your root partition is on the network see the section called «Network Boot».
If you have to input passwords for encrypted disk volumes, you might want to set the keyboard layout and specify a display font.
A typical german kernel command would contain:
Setting these options can override the setting stored on your system, if you use a modern init system, like systemd.
Blacklisting Kernel Modules
The option can be specified multiple times on the kernel command line.
Speeding up the Boot Process
If you want to speed up the boot process, you can specify as much information for dracut on the kernel command as possible. For example, you can tell dracut, that you root partition is not on a LVM volume or not on a raid partition, or that it lives inside a specific crypto LUKS encrypted volume. By default, dracut searches everywhere. A typical dracut kernel command line for a plain primary or logical partition would contain:
This turns off every automatic assembly of LVM, MD raids, DM raids and crypto LUKS.
Of course, you could also omit the dracut modules in the initramfs creation process, but then you would lose the posibility to turn it on on demand.
Injecting custom Files
To add your own files to the initramfs image, you have several possibilities.
This will put the contents of the rd.live.overlay directory into the root of the initramfs image.
Network Boot
If your root partition is on a network drive, you have to have the network dracut modules installed to create a network aware initramfs image.
If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp server about the ip adress for the machine. The dhcp server can also serve an additional root-path, which will set the root device for dracut. With this mechanism, you have static configuration on your client machine and a centralized boot configuration on your TFTP/DHCP server. If you can’t pass a kernel command line, then you can inject /etc/cmdline.d/mycmdline.conf, with a method described in the section called «Injecting custom Files».
Reducing the Image Size
To reduce the size of the initramfs, you should create it with by ommitting all dracut modules, which you know, you don’t need to boot the machine.
You can also specify the exact dracut and kernel modules to produce a very tiny initramfs image.
For example for a NFS image, you would do:
This will reduce the size of the initramfs image significantly.
TROUBLESHOOTING
If the boot process does not succeed, you have several options to debug the situation. Some of the basic operations are covered here. For more information you should also visit: m[blue]https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.htmlm[]
Identifying your problem area
1. Remove ‘rhgb‘ and ‘quiet‘ from the kernel command line
2. Add ‘rd.shell‘ to the kernel command line. This will present a shell should dracut be unable to locate your root device
3. Add ‘rd.shell rd.debug log_buf_len=1M‘ to the kernel command line so that dracut shell commands are printed as they are executed
4. The file /run/initramfs/rdsosreport.txt is generated, which contains all the logs and the output of all significant tools, which are mentioned later.
If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that. Then you can store the output for later inspection.
Information to include in your report
In all cases, the following should be mentioned and attached to your bug report:
• The exact kernel command-line used. Typically from the bootloader configuration file (e.g. /boot/grub2/grub.cfg) or from /proc/cmdline.
• A copy of your disk partition information from /etc/fstab, which might be obtained booting an old working initramfs or a rescue medium.
• Turn on dracut debugging (see the debugging dracut section), and attach the file /run/initramfs/rdsosreport.txt.
• If you use a dracut configuration file, please include /etc/dracut.conf and all files in /etc/dracut.conf.d/*.conf
Network root device related problems
This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e.g. iSCSI, NFS or NBD). As well as the information from the section called «All bug reports», include the following information:
• Please include the output of
Debugging dracut
Configure a serial console
Successfully debugging dracut will require some form of console logging during the system boot. This section documents configuring a serial console connection to record boot messages.
1. First, enable serial console output for both the kernel and the bootloader.
2. Open the file /boot/grub2/grub.cfg for editing. Below the line ‘timeout=5‘, add the following:
3. Also in /boot/grub2/grub.cfg, add the following boot arguemnts to the ‘kernel‘ line:
4. When finished, the /boot/grub2/grub.cfg file should look similar to the example below.
5. More detailed information on how to configure the kernel for console output can be found at m[blue]http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNELm[].
6. Redirecting non-interactive output
Note
You can redirect all non-interactive output to /dev/kmsg and the kernel will put it out on the console when it reaches the kernel buffer by doing
Using the dracut shell
dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:
1. Add the boot parameter ‘rd.shell‘ to your bootloader configuration file (e.g. /boot/grub2/grub.cfg)
2. Remove the boot arguments ‘rhgb‘ and ‘quiet‘
A sample /boot/grub2/grub.cfg bootloader configuration file is listed below.
3. If system boot fails, you will be dropped into a shell as seen in the example below.
4. Use this shell prompt to gather the information requested above (see the section called «All bug reports»).
Accessing the root volume from the dracut shell
From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:
• A block device (e.g. /dev/sda7)
• A LVM logical volume (e.g. /dev/VolGroup00/LogVol00)
• An encrypted device (e.g. /dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83)
• A network attached device (e.g. netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all)
The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink /dev/root which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume.
1. Inspect your partitions using parted
2. You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes.
3. You should see any logical volumes now using the command blkid:
4. From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume.
5. Next, make a symbolic link to the unlocked root volume
6. With the root volume available, you may continue booting the system by exiting the dracut shell
Additional dracut boot parameters
For more debugging options, see dracut.cmdline(7).
Debugging dracut on shutdown
To debug the shutdown sequence on systemd systems, you can rd.break on pre-shutdown or shutdown.
To do this from an already booted system:
This will give you a dracut shell after the system pivot’ed back in the initramfs.
OPTIONS
set the kernel version. This enables to specify the kernel version, without specifying the location of the initramfs image. For example:
overwrite existing initramfs file.
add a space-separated list of dracut modules to the default set of modules. This parameter can be specified multiple times.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
omit a space-separated list of dracut modules. This parameter can be specified multiple times.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of dracut modules to call when building the initramfs. Modules are located in /usr/lib/dracut/modules.d. This parameter can be specified multiple times. This option forces dracut to only include the specified dracut modules. In most cases the «—add» option is what you want to use.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel modules to exclusively include in the initramfs. The kernel modules have to be specified without the «.ko» suffix. This parameter can be specified multiple times.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel modules to add to the initramfs. The kernel modules have to be specified without the «.ko» suffix. This parameter can be specified multiple times.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
See add-drivers above. But in this case it is ensured that the drivers are tried to be loaded early via modprobe.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel modules not to add to the initramfs. The kernel modules have to be specified without the «.ko» suffix. This parameter can be specified multiple times.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs. This parameter can be specified multiple times.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify the directory, where to look for kernel modules
specify additional directories, where to look for firmwares. This parameter can be specified multiple times.
specify default kernel command line parameters
only install kernel drivers and firmware files
do not install kernel drivers and firmware files
Combine early microcode with ramdisk
Do not combine early microcode with ramdisk
print the kernel command line for the current disk layout
include local /etc/mdadm.conf
do not include local /etc/mdadm.conf
include local /etc/lvm/lvm.conf
do not include local /etc/lvm/lvm.conf
add a space-separated list of fsck tools, in addition to dracut.conf‘s specification; the installation is opportunistic (non-existing tools are ignored)
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
inhibit installation of any fsck tools
strip binaries in the initramfs (default)
do not strip binaries in the initramfs
prelink binaries in the initramfs (default)
do not prelink binaries in the initramfs
hardlink files in the initramfs (default)
do not hardlink files in the initramfs
prefix initramfs files with the specified directory
do not prefix initramfs files (default)
display help text and exit.
output debug information of the build process
increase verbosity level (default is info(4))
decrease verbosity level (default is info(4))
specify configuration file to use.
specify configuration directory to use.
specify temporary directory to use.
ssh key file used with ssh-client module.
logfile to use; overrides any setting from the configuration files.
activates the local mode. dracut will use modules from the current working directory instead of the system-wide installed modules in /usr/lib/dracut/modules.d. This is useful when running dracut from a git checkout.
Host-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration.
Warning
If chrooted to another root other than the real root device, use «—fstab» and provide a valid /etc/fstab.
Disable Host-Only mode
—hostonly-cmdline: Store kernel command line arguments needed in the initramfs
—no-hostonly-cmdline: Do not store kernel command line arguments needed in the initramfs
—hostonly-i18n: Install only needed keyboard and font files according to the host configuration (default).
—no-hostonly-i18n: Install all keyboard and font files available.
can be any directory name found in /dev/disk. E.g. «by-uuid», «by-label»
Use /etc/fstab instead of /proc/self/mountinfo.
Add entries of to the initramfs /etc/fstab.
include the files in the SOURCE directory into the TARGET directory in the final initramfs. If SOURCE is a file, it will be installed to TARGET in the final initramfs. This parameter can be specified multiple times.
install the space separated list of files into the initramfs.
Note
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
install the space separated list of files into the initramfs, if they exist.
Compress the generated initramfs using bzip2.
Warning
Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot. Equivalent to «—compress=bzip2»
Compress the generated initramfs using lzma.
Compress the generated initramfs using xz.
Compress the generated initramfs using lzop.
Make sure your kernel has lzo decompression support compiled in, otherwise you will not be able to boot.
Compress the generated initramfs using lz4.
Make sure your kernel has lz4 decompression support compiled in, otherwise you will not be able to boot.
Compress the generated initramfs using the passed compression program. If you pass it just the name of a compression program, it will call that program with known-working arguments. If you pass a quoted string with arguments, it will be called with exactly those arguments. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress.
Do not compress the generated initramfs. This will override any other compression options.
Create reproducible images.
Do not create reproducible images.
List all available dracut modules.
Print included module’s name to standard output during build.
Keep the initramfs temporary directory for debugging purposes.
Print out the module install size
—profile: Output profile information of the build process
—ro-mnt: Mount / and /usr read-only by default.
2 Specify logging level (to standard error)
Regenerate all initramfs images at the default location with the kernel versions found on the system. Additional parameters are passed through.
Instead of creating an initramfs image, dracut will create an UEFI executable, which can be executed by an UEFI BIOS.
Specifies the kernel image, which to include in the UEFI executable. The default is /lib/modules/ /vmlinuz or /boot/vmlinuz-
FILES
logfile of initramfs image creation
logfile of initramfs image creation, if /var/log/dracut.log is not writable
Configuration in the initramfs
Any files found in /etc/conf.d/ will be sourced in the initramfs to set initial values. Command line options will override these values set in the configuration files.
Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf.
Can contain additional command line options.
dracut 054
Harald Hoyer
Table of Contents
PartВ I.В Introduction
Table of Contents
This section is a modified version of http://en.wikipedia.org/wiki/Initrd which is licensed under the Creative Commons Attribution/Share-Alike License.
ChapterВ 1.В Definition
An initial ramdisk is a temporary file system used in the boot process of the Linux kernel. initrd and initramfs refer to slightly different schemes for loading this file system into memory. Both are commonly used to make preparations before the real root file system can be mounted.
ChapterВ 2.В Rationale
Many Linux distributions ship a single, generic kernel image that is intended to boot as wide a variety of hardware as possible. The device drivers for this generic kernel image are included as loadable modules, as it is not possible to statically compile them all into the one kernel without making it too large to boot from computers with limited memory or from lower-capacity media like floppy disks.
This then raises the problem of detecting and loading the modules necessary to mount the root file system at boot time (or, for that matter, deducing where or what the root file system is).
To further complicate matters, the root file system may be on a software RAID volume, LVM, NFS (on diskless workstations), or on an encrypted partition. All of these require special preparations to mount.
Another complication is kernel support for hibernation, which suspends the computer to disk by dumping an image of the entire system to a swap partition or a regular file, then powering off. On next boot, this image has to be made accessible before it can be loaded back into memory.
To avoid having to hardcode handling for so many special cases into the kernel, an initial boot stage with a temporary root file system —now dubbed early user space— is used. This root file system would contain user-space helpers that would do the hardware detection, module loading and device discovery necessary to get the real root file system mounted.
ChapterВ 3.В Implementation
An image of this initial root file system (along with the kernel image) must be stored somewhere accessible by the Linux bootloader or the boot firmware of the computer. This can be:
The bootloader will load the kernel and initial root file system image into memory and then start the kernel, passing in the memory address of the image.
Depending on which algorithms were compiled statically into it, the kernel can currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.
ChapterВ 4.В Mount preparations
dracut can generate a customized initramfs image which contains only whatever is necessary to boot some particular computer, such as ATA, SCSI and filesystem kernel modules (host-only mode).
dracut can also generate a more generic initramfs image (default mode).
dracut’s initramfs starts only with the device name of the root file system (or its UUID) and must discover everything else at boot time. A complex cascade of tasks must be performed to get the root file system mounted:
If the root file system is on NFS, dracut does then:
If the root file system is on an encrypted block device:
dracut uses udev, an event-driven hotplug agent, which invokes helper programs as hardware devices, disk partitions and storage volumes matching certain rules come online. This allows discovery to run in parallel, and to progressively cascade into arbitrary nestings of LVM, RAID or encryption to get at the root file system.
When the root file system finally becomes visible:
The final root file system cannot simply be mounted over /, since that would make the scripts and tools on the initial root file system inaccessible for any final cleanup tasks. On an initramfs, the initial root file system cannot be rotated away. Instead, it is simply emptied and the final root file system mounted over the top.
If the systemd module is used in the initramfs, the ordering of the services started looks like ChapterВ 12, DRACUT.BOOTUP(7).
ChapterВ 5.В Dracut on shutdown
On a systemd driven system, the dracut initramfs is also used for the shutdown procedure.
The following steps are executed during a shutdown:
This ensures, that all devices are disassembled and unmounted cleanly.
PartВ II.В User Manual
Table of Contents
ChapterВ 6.В DRACUT(8)
Table of Contents
SYNOPSIS
dracut [ OPTION… ] [ [ ]]
DESCRIPTION
dracut creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem, mounting the root filesystem and booting into the real system.
At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it as initial root file system. All finding of the root device happens in this early userspace.
Initramfs images are also called «initrd».
For a complete list of kernel command line options see dracut.cmdline (7).
If you are dropped to an emergency shell, while booting your initramfs, the file /run/initramfs/rdsosreport.txt is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick. Additional debugging info can be produced by adding rd.debug to the kernel command line. /run/initramfs/rdsosreport.txt contains all logs and the output of some tools. It should be attached to any report about dracut problems.
USAGE
To create a initramfs image, the most simple command is:
If you want to specify another filename for the resulting image you would issue a command like:
To generate an image for a specific kernel version, the command would be:
A shortcut to generate the image at the default location for a specific kernel version is:
Inspecting the Contents
To see the contents of the image created by dracut, you can use the lsinitrd tool.
To display the contents of a file in the initramfs also use the lsinitrd tool:
Adding dracut Modules
Omitting dracut Modules
Adding Kernel Modules
Boot parameters
An initramfs generated without the «hostonly» mode, does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image. So, you could completely change your root partition (move it inside a md raid with encryption and LVM on top), as long as you specify the correct filesystem LABEL or UUID on the kernel command line for your root device, dracut will find it and boot from it.
The kernel command line can also be provided by the dhcp server with the root-path option. See the section called “Network Boot”.
For a full reference of all kernel command line parameters, see dracut.cmdline (5).
To get a quick start for the suitable kernel command line on your system, use the —print-cmdline option:
Specifying the root Device
This is the only option dracut really needs to boot from your root partition. Because your root partition can live in various environments, there are a lot of formats for the root= option. The most basic one is root=
Because device node names can change, dependent on the drive ordering, you are encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) to specify your root partition:
To see all UUIDs or LABELs on your system, do:
If your root partition is on the network see the section called “Network Boot”.
Keyboard Settings
If you have to input passwords for encrypted disk volumes, you might want to set the keyboard layout and specify a display font.
A typical german kernel command line would contain:
Setting these options can override the setting stored on your system, if you use a modern init system, like systemd.
Blacklisting Kernel Modules
The option can be specified multiple times on the kernel command line.
Speeding up the Boot Process
If you want to speed up the boot process, you can specify as much information for dracut on the kernel command as possible. For example, you can tell dracut, that you root partition is not on a LVM volume or not on a raid partition, or that it lives inside a specific crypto LUKS encrypted volume. By default, dracut searches everywhere. A typical dracut kernel command line for a plain primary or logical partition would contain:
This turns off every automatic assembly of LVM, MD raids, DM raids and crypto LUKS.
Of course, you could also omit the dracut modules in the initramfs creation process, but then you would lose the possibility to turn it on on demand.
Injecting custom Files
To add your own files to the initramfs image, you have several possibilities.
This will put the contents of the rd.live.overlay directory into the root of the initramfs image.
Network Boot
If your root partition is on a network drive, you have to have the network dracut modules installed to create a network aware initramfs image.
Reducing the Image Size
To reduce the size of the initramfs, you should create it with by omitting all dracut modules, which you know, you don’t need to boot the machine.
You can also specify the exact dracut and kernel modules to produce a very tiny initramfs image.
For example for a NFS image, you would do:
This will reduce the size of the initramfs image significantly.
Troubleshooting
If the boot process does not succeed, you have several options to debug the situation. Some of the basic operations are covered here. For more information you should also visit: https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html
Identifying your problem area
If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that. Then you can store the output for later inspection.
Information to include in your report
All bug reports
In all cases, the following should be mentioned and attached to your bug report:
Network root device related problems
This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e.g. iSCSI, NFS or NBD). As well as the information from the section called “All bug reports”, include the following information:
Please include the output of
Debugging dracut
Configure a serial console
Successfully debugging dracut will require some form of console logging during the system boot. This section documents configuring a serial console connection to record boot messages.
Open the file /boot/grub2/grub.cfg for editing. Below the line ‘timeout=5 ‘, add the following:
When finished, the /boot/grub2/grub.cfg file should look similar to the example below.
Redirecting non-interactive output
You can redirect all non-interactive output to /dev/kmsg and the kernel will put it out on the console when it reaches the kernel buffer by doing
Using the dracut shell
dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:
Remove the boot arguments ‘rhgb ‘ and ‘quiet ‘
A sample /boot/grub2/grub.cfg bootloader configuration file is listed below.
If system boot fails, you will be dropped into a shell as seen in the example below.
Accessing the root volume from the dracut shell
From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:
The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink /dev/root which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume.
Inspect your partitions using parted
You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes.
You should see any logical volumes now using the command blkid:
From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume.
Next, make a symbolic link to the unlocked root volume
With the root volume available, you may continue booting the system by exiting the dracut shell
Additional dracut boot parameters
For more debugging options, see dracut.cmdline (7).
Debugging dracut on shutdown
To do this from an already booted system:
This will give you a dracut shell after the system pivot’ed back in the initramfs.
OPTIONS
add a space-separated list of dracut modules to the default set of modules. This parameter can be specified multiple times.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
omit a space-separated list of dracut modules. This parameter can be specified multiple times.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel modules to exclusively include in the initramfs. The kernel modules have to be specified without the «.ko» suffix. This parameter can be specified multiple times.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel modules to add to the initramfs. The kernel modules have to be specified without the «.ko» suffix. This parameter can be specified multiple times.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
See add-drivers above. But in this case it is ensured that the drivers are tried to be loaded early via modprobe.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel modules not to add to the initramfs. The kernel modules have to be specified without the «.ko» suffix. This parameter can be specified multiple times.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs. This parameter can be specified multiple times.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify default kernel command line parameters —kernel-only only install kernel drivers and firmware files —no-kernel do not install kernel drivers and firmware files —early-microcode Combine early microcode with ramdisk —no-early-microcode Do not combine early microcode with ramdisk —print-cmdline print the kernel command line for the current disk layout —mdadmconf include local /etc/mdadm.conf —nomdadmconf do not include local /etc/mdadm.conf —lvmconf include local /etc/lvm/lvm.conf —nolvmconf do not include local /etc/lvm/lvm.conf —fscks [LIST]
add a space-separated list of fsck tools, in addition to dracut.conf ‘s specification; the installation is opportunistic (non-existing tools are ignored)
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
specify configuration file to use.
—confdir В
specify configuration directory to use.
—tmpdir В
specify temporary directory to use.
specify the sysroot directory to collect files from. This is useful to create the initramfs image from a cross-compiled sysroot directory. For the extra helper variables, see ENVIRONMENT below.
—sshkey В ssh key file used with ssh-client module. —logfile В
logfile to use; overrides any setting from the configuration files.
Host-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration.
Warning
—hostonly-cmdline : Store kernel command line arguments needed in the initramfs
—no-hostonly-cmdline : Do not store kernel command line arguments needed in the initramfs
—no-hostonly-default-device : Do not generate implicit host devices like root, swap, fstab, etc. Use «—mount» or «—add-device» to explicitly add devices as needed.
—hostonly-i18n : Install only needed keyboard and font files according to the host configuration (default).
—no-hostonly-i18n : Install all keyboard and font files available.
install the space separated list of files into the initramfs.
If [LIST] has multiple arguments, then you have to put these in quotes. For example:
Compress the generated initramfs using bzip2.
Warning
Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot. Equivalent to «—compress=bzip2»
Compress the generated initramfs using lzma.
Warning
Compress the generated initramfs using xz.
Warning
Warning
Make sure your kernel has lzo decompression support compiled in, otherwise you will not be able to boot.
Warning
Make sure your kernel has lz4 decompression support compiled in, otherwise you will not be able to boot.
Warning
Make sure your kernel has zstd decompression support compiled in, otherwise you will not be able to boot.
—profile : Output profile information of the build process
—ro-mnt : Mount / and /usr read-only by default.
ENVIRONMENT
overrides path and options for executing dracut-install internally. Optional. Can be used to debug dracut-install while running the main dracut script.
Example: DRACUT_INSTALL=»valgrind dracut-install»
overrides for compression utilities to support using them from non-standard paths.
FILES
Configuration in the initramfs
AVAILABILITY
The dracut command is part of the dracut package and is available from https://dracut.wiki.kernel.org
AUTHORS
SEE ALSO
dracut.cmdline (7) dracut.conf (5) lsinitrd (1)
ChapterВ 7.В DRACUT.CONF(5)
Table of Contents
SYNOPSIS
/etc/dracut.conf /etc/dracut.conf.d/*.conf /usr/lib/dracut/dracut.conf.d/*.conf
Description
dracut.conf is loaded during the initialisation phase of dracut. Command line parameter will override any values set here.
dracut command line options will override any values set here.
can be any directory name found in /dev/disk. E.g. «by-uuid», «by-label» tmpdir= » » Specify temporary directory to use.
Warning
Files
AUTHOR
See Also
dracut (8) dracut.cmdline (7)
ChapterВ 8.В DRACUT.CMDLINE(7)
Table of Contents
DESCRIPTION
The root device used by the kernel is specified in the boot configuration file on the kernel command line, as always.
The traditional root=/dev/sda1 style device specification is allowed, but not encouraged. The root device should better be identified by LABEL or UUID. If a label is used, as in root=LABEL= the initramfs will search all available devices for a filesystem with the appropriate label, and mount that device as the root filesystem. root=UUID= will mount the partition with that UUID as the root filesystem.
In the following all kernel command line parameters, which are processed by dracut, are described.
Standard
specify the block device to use as the root filesystem.
Example.В
rootfstype=
«auto» if not specified.
Example.В
resume from a swap partition
Example.В
iso-scan/filename
Mount all mountable devices and search for ISO pointed by the argument. When the ISO is found set it up as a loop device. Device containing this ISO image will stay mounted at /run/initramfs/isoscandev. Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work by copying the original kernel cmdline parameters.
Example.В
Debug
If you are dropped to an emergency shell, the file /run/initramfs/rdsosreport.txt is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick. Additional debugging info can be produced by adding rd.debug to the kernel command line. /run/initramfs/rdsosreport.txt contains all logs and the output of some tools. It should be attached to any report about dracut problems.
Print memory usage info at various points, set the verbose level from 0 to 5.
rd.break drop to a shell at the end rd.break= drop to a shell on defined breakpoint rd.udev.info set udev to loglevel info rd.udev.debug set udev to loglevel debug
keyboard translation table loaded by loadkeys; taken from keymaps directory; will be written as KEYMAP to /etc/vconsole.conf in the initramfs.
Example.В
rd.vconsole.keymap.ext= list of extra keymaps to bo loaded (sep. by space); will be written as EXT_KEYMAP to /etc/vconsole.conf in the initramfs rd.vconsole.unicode boolean, indicating UTF-8 mode; will be written as UNICODE to /etc/vconsole.conf in the initramfs rd.vconsole.font=
console font; taken from consolefonts directory; will be written as FONT to /etc/vconsole.conf in the initramfs.
Example.В
rd.vconsole.font.map= see description of -m parameter in setfont manual; taken from consoletrans directory; will be written as FONT_MAP to /etc/vconsole.conf in the initramfs rd.vconsole.font.unimap= see description of -u parameter in setfont manual; taken from unimaps directory; will be written as FONT_UNIMAP to /etc/vconsole.conf in the initramfs rd.locale.LANG=
taken from the environment; if no UNICODE is defined we set its value in basis of LANG value (whether it ends with «.utf8» (or similar) or not); will be written as LANG to /etc/locale.conf in the initramfs.
Example.В
rd.locale.LC_ALL= taken from the environment; will be written as LC_ALL to /etc/locale.conf in the initramfs
crypto LUKS
is the pathname of a key file, relative to the root of the filesystem on some device. It’s REQUIRED. When ends with .gpg it’s considered to be key encrypted symmetrically with GPG. You will be prompted for the GPG password on boot. GPG support comes with the crypt-gpg module, which needs to be added explicitly.
identifies the device on which the key file resides. It may be the kernel name of the device (should start with «/dev/»), a UUID (prefixed with «UUID=») or a label (prefix with «LABEL=»). You don’t have to specify a full UUID. Just its beginning will suffice, even if its ambiguous. All matching devices will be probed. This parameter is recommended, but not required. If it’s not present, all block devices will be probed, which may significantly increase boot time.
Example.В
As you see, you can skip colons in such a case.
Your LUKS partition must match your key file.
Here is an example for a key encrypted with GPG (warning: —batch-mode will overwrite the device without asking for confirmation):
If you use unencrypted key files, just use the key file pathname instead of the standard input. For a random key with 256 bits of entropy, you might use:
Compared to using GPG encrypted keyfiles on an unencrypted device this provides the following advantages:
To boot this configuration you could use:
MD RAID
DM RAID
MULTIPATH
specify the device, where /boot is located.
Example.В
rd.fips.skipkernel skip checksum check of the kernel image. Useful, if the kernel image is not in a separate boot partition.
Network
Important
It is recommended to either bind an interface to a MAC with the ifname argument, or to use the systemd-udevd predictable network interface names.
Predictable network interface device names based on:
Two character prefixes based on the type of interface:
][..][c ][i ] USB port number chain
All multi-function PCI devices will carry the [f ] number in the device name, including the function 0 device.
When using PCI geography, The PCI domain is only prepended when it is not 0.
For USB devices the full chain of port numbers of hubs is composed. If the name gets longer than the maximum number of 15 characters, the name is not exported. The usual USB configuration == 1 and interface == 0 values are suppressed.
This parameter can be specified multiple times.
explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple times.
is optional and is the address of the remote endpoint for pointopoint interfaces and it may be followed by a slash and a decimal number, encoding the network prefix length.
is optional and is the address of the remote endpoint for pointopoint interfaces and it may be followed by a slash and a decimal number, encoding the network prefix length. ifname= :
Warning
Do not use the default kernel naming scheme for the interface name, as it can conflict with the kernel names. So, don’t use «eth5+» for the interface name. Better name it «bootnet» or «bluesocket».
Add a static route with route options, which are separated by a colon. IPv6 addresses have to be put in brackets.
Example.В
bootdev= specify network interface to use routing and netroot information from. Required if multiple ip= lines are used. BOOTIF= specify network interface to use routing and netroot information from. rd.bootif=0 Disable BOOTIF parsing, which is provided by PXE nameserver= [ nameserver= …] specify nameserver(s) to use rd.peerdns=0 Disable DNS setting of DHCP parameters. biosdevname=0 boolean, turn off biosdevname network interface renaming rd.neednet=1 boolean, bring up network even without netroot set vlan= :
Setup vlan device named on
netroot=dhcp alone directs initrd to look at the DHCP root-path where NFS options can be specified.
Example.В
Warning
Passwords specified on the kernel command line are visible for all users via the file /proc/cmdline and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.
Set the cifs password, if not specified as part of the root.
Warning
Passwords specified on the kernel command line are visible for all users via the file /proc/cmdline and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.
iSCSI
protocol defaults to «6», LUN defaults to «0». If the «servername» field is provided by BOOTP or DHCP, then that field is used in conjunction with other associated fields to contact the boot server in the Boot stage. However, if the «servername» field is not provided, then the «targetname» field is then used in the Discovery Service stage in conjunction with other associated fields. See rfc4173.
Warning
Passwords specified on the kernel command line are visible for all users via the file /proc/cmdline and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.
Example.В
If servername is an IPv6 address, it has to be put in brackets:
Example.В
root= . netroot= iscsi:[ :
multiple netroot options allow setting up multiple iscsi disks:
Example.В
If servername is an IPv6 address, it has to be put in brackets:
Example.В
Warning
Passwords specified on the kernel command line are visible for all users via the file /proc/cmdline and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path. You may want to use rd.iscsi.firmware.
rd.iscsi.in.username= rd.iscsi.in.password=
Warning
Passwords specified on the kernel command line are visible for all users via the file /proc/cmdline and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path. You may want to use rd.iscsi.firmware.
will be passed as «—param
» to iscsistart. This parameter can be specified multiple times.
Example.В
rd.iscsi.ibft rd.iscsi.ibft=1 : Turn on iBFT autoconfiguration for the interfaces
rd.iscsi.mp rd.iscsi.mp=1 : Configure all iBFT interfaces, not only used for booting (multipath)
rd.iscsi.waitnet=0 : Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.
rd.iscsi.testroute=0 : Turn off checking, if the route to the iSCSI target IP is possible before trying to login.
Try to connect to a FCoE SAN through the NIC specified by or or EDD settings. The second argument specifies if DCB should be used. The optional third argument specifies whether fabric or VN2VN mode should be used. This parameter can be specified multiple times.
letters in the MAC-address must be lowercase!
NOTE: If «exportname» instead of «port» is given the standard port is used. Newer versions of nbd are only supported with «exportname».
root=/dev/root netroot=dhcp with dhcp root-path= nbd: :
netroot=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified. This syntax is only usable in cases where you are directly mounting the volume as the rootfs.
NOTE: If «exportname» instead of «port» is given the standard port is used. Newer versions of nbd are only supported with «exportname».
If NPIV is enabled and the allow_lun_scan parameter to the zfcp module is set to Y then the zfcp adaptor will be initiating a scan internally and the and parameters can be omitted.
Example.В
rd.zfcp.conf=0 ignore zfcp.conf included in the initramfs
Assign network device name (i.e. «bootnet») to the NIC corresponds to the subchannels. This is useful when dracut’s default «ifname=» doesn’t work due to device having a changing MAC address.
Example.В
Booting live images
Dracut offers multiple options for live booted images:
The filesystem structure is traditionally expected to be:
For OverlayFS mount overlays, the filesystem structure may also be a direct compression of the root filesystem:
Dracut uses one of the overlay methods of live booting by default. No additional command line options are required other than root=live: to specify the location of your squashed filesystem.
The filesystem structure is expected to be:
To use this boot option, ensure that rd.writable.fsimg=1 is in your kernel command line and add the root=live: to specify the location of your compressed filesystem image tarball or SquashFS image.
There must be enough free RAM available to hold the complete image.
This method is very suitable for diskless boots.
root= live:
Examples.В
rd.live.debug= 1 Enables debug output from the live boot process. rd.live.dir=
Manage the usage of a permanent overlay.
is the path to a file within that filesystem, which shall be used to persist the changes made to the device specified by the root=live: option.
If a persistent overlay is detected at the standard LiveOS path, the overlay & overlay type detected, whether Device-mapper or OverlayFS, will be used.
Examples.В
Enables the use of the OverlayFS kernel module, if available, to provide a copy-on-write union directory for the root filesystem. OverlayFS overlays are directories of the files that have changed on the read-only base (lower) filesystem. The root filesystem is provided through a special overlay type mount that merges the lower and upper directories. If an OverlayFS upper directory is not present on the boot device, a tmpfs directory will be created at /run/overlayfs to provide temporary storage. Persistent storage can be provided on vfat or msdos formatted devices by supplying the OverlayFS upper directory within an embedded filesystem that supports the creation of trusted.* extended attributes and provides a valid d_type in readdir responses, such as with ext4 and xfs. On non-vfat-formatted devices, a persistent OverlayFS overlay can extend the available root filesystem storage up to the capacity of the LiveOS disk device.
If a persistent overlay is detected at the standard LiveOS path, the overlay & overlay type detected, whether OverlayFS or Device-mapper, will be used.