8:mkinitrd

From Linux Man Pages

Jump to: navigation, search
      mkinitrd, mk_initrd - create initrd disk image
      
      mkinitrd [options] [root_dir]

Contents

DESCRIPTION

      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 know by the kernel, 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 filesystem.
 
      A few options can be specified via the kernel command line to modify some hardcoded values in the "/init" script.
      They are read from /proc/cmdline.
 
      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.

OPTIONS

      -h     This Text.
 
      -k  "kernel list"
             list  of kernel images for which initrd files are created (relative to boot_dir), defaults to "vmlinux" on
             powerpc, "image" on s390 and "vmlinuz" for everything else.
 
      -i "initrd list"
             list of file names (relativ to boot_dir) for the initrd;  positions  have  to  match  the  "kernel  list",
             defaults to "initrd"
 
      -m "module list"
             modules to include in initrd, defaults to INITRD_MODULES variable in /etc/sysconfig/kernel
 
      -f "feature list"
             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.
 
      -b boot_dir
             boot dir, defaults to "/boot", where the initrd is created.
 
      -d root_device
             root device, defaults to the device from which the root_dir is mounted; overwrites the rootdev  enviroment
             variable if set
 
      -s size
             Add splash animation and bootscreen to initrd.
 
      -D interface
             Run dhcp on the specified interface.
 
      -I interface
             Configure the specified interface statically.
 
      -a acpi_dsdt
             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.
 
      -t tmp_dir
             tmp dir, defaults to "/tmp".
 
      -e     Use static binaries where possible. (currently unavailable)
 
      -P     Include modules for all IDE devices on the PCI bus.
 
      -V script
             Vendor specific script to run in linuxrc.
 
      -M map System.map file to use.
 
      -j device
             External journal device to use for the root filesystem.
 
      root_dir
             the directory the root partition is mounted to defaults to "/"

KERNEL COMMAND-LINE PARAMETER

      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 parameter are supported:
 
      linuxrc=trace
             Enabling command tracing of the init script
 
      noresume
             Do not check for a resume device
 
      sysrq=yes
             sysrq=1 Enable sysrq
 
      resume=<device>
             Resume from device <device>
 
      journal=<device>
             Use device <device> as external journal device.  This is only valid for reiser and xfs filesystems.
 
      mduuid=<UUID>
             Mount md RAID with uuid <UUID as the root filesystem.
 
      TargetAddress=<IP Address>
             [iSCSI] IP Address of the iSCSI Target
 
      InitiatorName=<iqn>
             [iSCSI] Use <iqn> as the iSCIS initiatorname.
 
      ip=<ipspec>
             Use  <ipspec>  to  configure  the  network  interface.  Format of the <ipspec> is <client>:<server>:<gate-
             way>:<netmask>:<hostname>:<device>:<proto>.  <client>, <server>, <gateway>, <netmask> are in the  standard
             dotted-decimal IP notation. <proto> is currently ignored.
 
      udev_timeout=<secs>
             Set the timeout for root device detection to <secs> seconds. Default is 10.

FEATURES

      Normally  mkinitrd  detects all required features automatically, based upon the current root filesystem. If addi-
      tional features should be enabled, the -f option can be specified.
 
      Currently, the following features can be selected:
 
      iscsi  Include iSCSI support
 
      mpath  Add support for multipathing
 
      md     Add support for Software RAID (md)
 
      lvm2   Add support for LVM2
 
      evms   Add support for EVMS
 
      lvm    Add support for LVM1

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 -m "nfs e1000" -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=1.2.3.4:/exported/directory
 
      mkinitrd -m "nfs e1000" -I eth0
             This will add the required kernel modules to the initrd, a static IP address must be specified on the ker-
             nel cmdline.  Boot the NFS client with these additional command line options to  mount  the  server:  nfs-
             root=1.2.3.4:/exported/directory  ip=1.2.3.42:1.2.3.4:1.2.3.1:255.255.255.0:clienthostname:eth0:none . See
             the ip= description above for details about the ip= option.

NOTE

      mk_initrd is now a symbolic link to mkinitrd.

ENVIRONMENT VARIABLES

      You can specify the root device via the environment variable rootdev (e.g.  "rootdev=/dev/hda mk_initrd").

CATEGORY

Personal tools