MKINITRD(8) User Manuals MKINITRD(8)
mkinitrd - create initrd disk image
mkinitrd [options] [root_dir]
mkinitrd creates initial ramdisk images for booting Linux. The "/init" script in the compressed cpio archive loads all driver modules,
creates all device nodes currently known by the kernel, initializes vital subsystems (e.g. networking when doing nfs), does a filesystem
check on the root filesystem and finally passes control to /sbin/init. udev is used to create the device nodes in a tmpfs mounted /dev
directory. This directory is moved over to the final root filesystem, essentially hiding the on-disk content below /dev on the root
A few options can be specified via the kernel command line to modify some hardcoded values in the "/init" script. They are read from
While in the old days the Linux kernel was responsible for mounting the rootfilesystem and running /sbin/init, all the work is now done by
the "/init" script.
Shows help output and exits.
Prints the version and exits. We use -R (release) because -v (verbose) and -V (vendor scripts) are already taken.
List of kernel images for which initrd files are created (relative to boot_dir), defaults to vmlinux on ppc/ppc64, image on s390/s390x
and vmlinuz for everything else.
List of file names (relative to boot_dir) for the initrd; positions have to match the kernel_list, defaults to initrd.
Modules to include in initrd, defaults to INITRD_MODULES variable in /etc/sysconfig/kernel.
Features to be enabled for the initrd. In general mkinitrd configures the initrd for the root device it is started from. With this
option additional feature can be enabled.
Boot directory, defaults to /boot, where the initrd is created.
Root device, defaults to the device from which the root_dir is mounted; overwrites the rootdev enviroment variable if set
Add splash animation and bootscreen to initrd.
Run dhcp on the specified interface (for example "eth0").
It's also possible to specify "default" here if the default interface should be used. If there's a file /etc/install.inf (which is from
the installation system), then the interface that was used for installation is used as default interface. Otherwise, if NFS root is
used and one of the network configuration files in /etc/sysconfig/network contain the option STARTMODE=nfsroot, than this interface is
used as default. Finally, the interface which is used for the default route (in the output of /sbin/route is used as default interface
in the initrd.
Configure the specified interface statically.
Attach compiled ACPI DSDT (Differentiated System Description Table) to initrd. This replaces the DSDT of the BIOS. Defaults to the
ACPI_DSDT variable in /etc/sysconfig/kernel.
Use static binaries where possible. (currently unavailable)
Include modules for all IDE devices on the PCI bus.
Vendor specific script to run in linuxrc.
System.map file to use.
External journal device to use for the root filesystem.
Directory to use for mkinitrd files instead of /lib/mkinitrd.
Don't run the update-bootloader(8) script after the initrd(s) have been created. This is useful if you call mkinitrd(8) not for the
running system but for example in a spec file to pre-generate an initrd or to generate a special kdump initrd (which mkdumprd(8) does).
Create a so called "monster initrd" which includes all available features and modules.
Do not include all libata modules by default.
Verbose mode. Prints more information to standard error. By default the information that would be printed in verbose mode is also
appended to the log file /var/log/YaST2/mkinitrd.log, so it's not necessary to re-run mkinitrd with the -v option to create bug
Disable logging to /var/log/YaST2/mkinitrd.log. This is useful for testing if you don't want to clutter the system log.
The directory the root partition is mounted to defaults to "/".
KERNEL COMMAND-LINE PARAMETERS
mkinitrd implements a set of additional kernel command-line parameters which are interpreted by the generated init script. In addition to
the standard kernel parameters the following parameters are supported:
Enabling command tracing of the init script
Execute a shell after the linuxrc has finished and before the normal system is booted. Useful for debugging.
Do not check for a resume device
sysrq=yes | sysrq=1-9
Enable sysrq. If a numeric value is specified, the log level of the console will be set to that value.
Resume from device device.
Use device device as external journal device. This is only valid for reiser and xfs filesystems.
Mount md RAID with uuid UUID as the root filesystem.
[iSCSI] IP Address of the iSCSI Target
InitiatorName=iqn. [iSCSI] Use iqn as the iSCIS initiatorname.
Use ipspec to configure the network interface. Format of the ipspec is client:server:gateway:netmask:hostname:device:proto. client,
server, gateway, netmask are in the standard dotted-decimal IP notation. proto is currently ignored.
Set the timeout for root device detection to secs seconds. Default is 10.
Normally mkinitrd detects all required features automatically, based upon the current root, resume, dump and journal device. If additional
features should be enabled, the -f option can be specified. Of course you can write your own features as well. Just take a look at
Currently, the following features can be selected (if a feature is available depends on the installed packages):
Include support for block devices (SCSI and IDE)
Replace and add all tools known as safe with the busybox versions
Include support for dasd storage devices (s390)
Include support for Software-Raid over device mapper (known as Fake-Raid)
Include support for device mapper in general
Include firewire storage
Include all network devices configured via ifup. The user should ensure to set the STARTMODE to onboot in the corresponding ifcfg
Include iSCSI support
Include support for kpartx partitioning. Always use this if you have device mapper devices.
Include encryption support using luks
Include support for LVM2
Include support for Software RAID (md)
Include support for multipathing
Include support for debugging using netconsole
Include networking support
Include support for nfs(-root)
Include resume support using the kernel resume code
Include resume support using the userspace program
Include USB-support (keyboard and storage)
Include vendor script support
Include support for zfcp storage devices (s390)
USING NFS AS ROOT FILESYSTEM
To configure an initrd for an NFS client, specify these options to add nfs and network driver support into the initrd:
mkinitrd -f nfs -D eth0
This will add the required kernel modules and a dhcp client to the initrd, which will try to get an IP address via eth0. Boot the NFS
client with these additional command line options to mount the server: nfsroot=18.104.22.168:/exported/directory.
mkinitrd -f nfs -I eth0
This will add the required kernel modules to the initrd, a static IP address must be specified on the kernel cmdline. Boot the NFS
client with the nfsroot parameter as specified above to mount the server and the additional parameter
ip=22.214.171.124:126.96.36.199:188.8.131.52:255.255.255.0:hostname:eth0:none to configure the network interface. See the ip= description above for
details about the ip= option.
Due to the new autodetection in mkinitrd it should suffice if the /-entry in /etc/fstab is an nfs target. The network device which will
be used should have STARTMODE set to nfsroot.
What should you do if the initrd is broken and you want to fix it using a chroot? I assume /mnt is your target root and /boot is mounted
1. mount --bind /dev /mnt/dev
2. chroot /mnt
3. mount /proc
4. mount /sys
The log file of this program. Always attach that log file in Bugzilla if something goes wrong. It's also included in the usual YaST
logs that are created with save_y2logs(8).
You can specify the root device via the environment variable rootdev (e.g. "rootdev=/dev/hda mkinitrd").
Also, the temporary directory which is used to build the initrd can be specified using the TMPDIR environment. If not set, /dev/shm is used
as root (when it's writable) and /tmp otherwise.
Steffen Winterfeldt <firstname.lastname@example.org>, Susanne Oberhauser <email@example.com>, Andreas Grunbacher <firstname.lastname@example.org>, Hannes Reinecke
<email@example.com>, Alexander Graf <firstname.lastname@example.org>, Bernhard Walle <email@example.com>
mkinitrd 07/05/2010 MKINITRD(8)