• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

mkinitcpio Command Examples in Linux

by admin

mkinitcpio” is a tool in Arch Linux used to generate an initial RAM disk (initrd or initramfs) image. This image is used to boot the Linux kernel and prepare the environment for the main operating system. The initrd image contains all the necessary files, drivers, and tools needed to mount the root file system and start the main operating system.

The “mkinitcpio” command takes one or more presets as input, which define the configuration of the initrd image. The presets specify the kernel modules to be included, the files to be copied, and the hooks to be executed during the boot process. The tool then creates the initrd image and saves it to a specified location.

The initrd image is loaded into memory by the boot loader and executed before the main operating system starts. It performs various tasks, such as setting up the device tree, loading necessary kernel modules, and mounting the root file system. The initrd image is an important component of the boot process and plays a crucial role in ensuring the stability and compatibility of the system.

mkinitcpio Command Examples

1. Perform a dry run (print what would be done without actually doing it):

# mkinitcpio

2. Generate a ramdisk environment based on the `linux` preset:

# mkinitcpio --preset linux

3. Generate a ramdisk environment based on the `linux-lts` preset:

# mkinitcpio --preset linux-lts

4. Generate ramdisk environments based on all existing presets (used to regenerate all the initramfs images after a change in `/etc/mkinitcpio.conf`):

# mkinitcpio --allpresets

5. Generate an initramfs image using an alternative configuration file:

# mkinitcpio --config path/to/mkinitcpio.conf --generate path/to/initramfs.img

6. Generate an initramfs image for a kernel other than the one currently running (the installed kernel releases can be found in `/usr/lib/modules/`):

# mkinitcpio --kernel kernel_version --generate path/to/initramfs.img

7. List all available hooks:

# mkinitcpio --listhooks

8. Display help for a specific hook:

# mkinitcpio --hookhelp hook_name

Filed Under: Linux

Some more articles you might also be interested in …

  1. How To Configure sssd To Work With Multiple Active Directory Domains in Different Forests (CentOS/RHEL)
  2. How to disable “Alt+Ctrl+Del” causing system reboot in CentOS/RHEL 7
  3. ncat: command not found
  4. nmtui Command Examples in Linux
  5. CentOS / RHEL 6 : How to disable Transparent Huge pages (THP)
  6. apparmor_status: command not found
  7. lxterminal: command not found
  8. How to Create An LVM Snapshot Of The Root Filesystem And Restore To An Earlier State
  9. “WARNING: Duplicate VG name [vgname]” – error while running LVM commands
  10. CentOS / RHEL 6,7 : How to enable or disable XDMCP service (GDM)

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright