dracut(8)
dracut generates a bootable initramfs image for the Linux kernel.
Synopsis
dracut [OPTION]... [<image>] [<kernel-version>]Description
dracut creates an initramfs (initial RAM filesystem) that is loaded by the bootloader before the main kernel. It includes kernel modules, drivers, and init scripts needed to boot the system, mount the root filesystem, and hand control to the main init system.
The generated initramfs is essential for systems with modular kernels, LVM, RAID, encrypted partitions, or complex storage configurations. dracut automatically detects most hardware and dependencies, but can be customized via configuration files and command-line options.
Common options
| Flag | What it does |
|---|---|
-f, --force | Overwrite existing initramfs image without confirmation |
-o, --omit MODULE | Omit a dracut module from the initramfs (e.g., plymouth, crypt) |
-a, --add MODULE | Add a dracut module to the initramfs |
-m, --modules | Specify modules to include; overrides auto-detection |
--hostonly | Include only drivers and modules for detected hardware (faster boot, less portable) |
--no-hostonly | Build a generic initramfs for any hardware (larger, more compatible) |
-H, --hostonly-cmdline | Include kernel command-line parameters detected at build time |
-l, --list | List the contents of an existing initramfs image |
-v, --verbose | Increase verbosity; show detailed build process |
-N, --no-hostonly-default-device-modules | Don't add hostonly device modules unless explicitly required |
--kver VERSION | Specify kernel version; defaults to current running kernel |
--reproducible | Create reproducible initramfs (fixed timestamps, no randomness) |
Examples
Generate initramfs for the current kernel, overwriting if it exists
dracut -fCreate initramfs for kernel version 5.15.0-generic at a custom path
dracut -f /boot/initramfs-custom.img 5.15.0-genericBuild a hardware-specific initramfs for faster boot on this machine
dracut --hostonly -fGenerate initramfs without crypt and lvm modules (for unencrypted, non-LVM systems)
dracut -o crypt -o lvm -fExplicitly include crypt and lvm modules even if not auto-detected
dracut -a crypt -a lvm -fList the first 20 files in an existing initramfs image
dracut -l /boot/initramfs-5.15.0.img | head -20Build with verbose output and show which modules are being added
dracut -v -f 2>&1 | grep -i 'adding modules'Create a hardware-optimized, reproducible initramfs for consistent builds
dracut --reproducible --hostonly -f