initramfs
by running the dracut
command. However, you usually don't need to create an initramfs
manually: this step is automatically performed if the kernel and its associated packages are installed or upgraded from RPM packages distributed by The Fedora Project.
initramfs
corresponding to your current kernel version exists and is specified correctly in the /boot/grub2/grub.cfg
configuration file by following this procedure:
Procedure 20.1. Verifying the Initial RAM Disk Image
root
, list the contents in the /boot
directory and find the kernel (vmlinuz-kernel_version
) and initramfs-kernel_version
with the latest (most recent) version number:
~]# ls /boot
config-3.1.0-0.rc6.git0.3.fc16.x86_64
config-3.1.0-0.rc9.git0.0.fc16.x86_64
elf-memtest86+-4.20
grub
grub2
initramfs-3.1.0-0.rc6.git0.3.fc16.x86_64.img
initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
initrd-plymouth.img
memtest86+-4.20
System.map-3.1.0-0.rc6.git0.3.fc16.x86_64
System.map-3.1.0-0.rc9.git0.0.fc16.x86_64
vmlinuz-3.1.0-0.rc6.git0.3.fc16.x86_64
vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64
/boot
directory),
vmlinuz-vmlinuz-3.1.0-0.rc9.git0.0.fc16.x86_64
, and
initramfs
file matching our kernel version, initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
, also exists.
initrd files in the /boot directory are not the same as initramfs files
/boot
directory you may find several initrd-<kernel_version>kdump.img
files. These are special files created by the kdump
mechanism for kernel debugging purposes, are not used to boot the system, and can safely be ignored. For more information on kdump
, refer to Chapter 22, The kdump Crash Recovery Service.
initramfs-kernel_version
file does not match the version of the latest kernel in /boot
, or, in certain other situations, you may need to generate an initramfs
file with the Dracut utility. Simply invoking dracut
as root
without options causes it to generate an initramfs
file in the /boot
directory for the latest kernel present in that directory:
~]# dracut
--force
option if you want dracut
to overwrite an existing initramfs
(for example, if your initramfs
has become corrupt). Otherwise dracut
will refuse to overwrite the existing initramfs
file:
~]# dracut
F: Will not override existing initramfs (/boot/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img) without --force
dracut initramfs_name kernel_version
, for example:
~]# dracut "initramfs-$(uname -r).img" $(uname -r)
.ko
) inside the parentheses of the add_dracutmodules="module [more_modules]"
directive of the /etc/dracut.conf
configuration file. You can list the file contents of an initramfs
image file created by dracut by using the lsinitrd initramfs_file
command:
~]# lsinitrd /boot/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
/boot/initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img: 16M
========================================================================
dracut-013-15.fc16
========================================================================
drwxr-xr-x 8 root root 0 Oct 11 20:36 .
lrwxrwxrwx 1 root root 17 Oct 11 20:36 lib -> run/initramfs/lib
drwxr-xr-x 2 root root 0 Oct 11 20:36 sys
drwxr-xr-x 2 root root 0 Oct 11 20:36 proc
lrwxrwxrwx 1 root root 17 Oct 11 20:36 etc -> run/initramfs/etc
[output truncated]
man dracut
and man dracut.conf
for more information on options and usage.
/boot/grub2/grub.cfg
configuration file to ensure that an initrd /path/initramfs-kernel_version.img
exists for the kernel version you are booting. For example:
~]# grep initrd /boot/grub2/grub.cfg
initrd /initramfs-3.1.0-0.rc6.git0.3.fc16.x86_64.img
initrd /initramfs-3.1.0-0.rc9.git0.0.fc16.x86_64.img
/boot/grub2/grub.cfg
file.
addRamDisk
command. This step is performed automatically if the kernel and its associated packages are installed or upgraded from the RPM packages distributed by The Fedora Project; thus, it does not need to be executed manually. To verify that it was created, run the following command as root
to make sure the /boot/vmlinitrd-kernel_version
file already exists:
ls -l /boot