What is Checken/Egg Problem.

Chicken/Egg problem occurred in booting process of Linux. A Linux kernel required modules to mount root partition which typically uses ext3 file system, LVM, RAID, etc. All the Linux modules resides in /var/lib/($uname -r) directory but Linux kernel could not access them without mounting it. So the problem was that how Linux kernel access modules required to mount root partition.

Advertisement
How Linux Kernel Get it Solve

The grub boot loader and Linux kernel works together to get solve this problem using Initial Ram Disk ( initrd ), which is part of GRUB specification for a Linux kernel.

An Initial RAM Disk ( initrd ) is specific to particular hardware and software platform. Its created at system install time and include modules which needs to mount file-system.

Recreate initrd file

Some times we required to recreate initrd file. mkinitrd creates an initial ram disk image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem.

# mkinitrd -f /boot/initrd-$(uname -r).img $(uname -r)
  • First argument is location of initrd image.
  • Second argument tells the directory name in /var/lib/ which contains modules.

Its also possible to force to add particular module in initrd image file using –with keyword.

#  mkinitrd --with=scsi_mod -f /boot/initrd-$(uname -r).img $(uname -r)

This article is based on RHEL/CentOS 5 Systems. RHEL/CentOS 6 system modules directory is different than 5.

Share.

1 Comment

Leave A Reply

Exit mobile version