What is Initial Ramdisk?

Home / What is Initial Ramdisk?

What is Initial Ramdisk?

November 24, 2015 | Article | 2 Comments

Initial ramdisk is a scheme for loading a temporary filesystem into memory in the boot process of the Linux kernel. You could say it is a pseudo filesystem reflect / mirror to system. There are two scheme, initrd and initramfs. They are refer to slightly different methods and commonly used to make preparations before the real root filesystem can be mounted.

Many Linux distributions ship a single generic kernel image. They do that as they expect a wide variation of user’s hardware that might be met and thus the kernel need to be as flexible as possible. Therefore, developers need to avoid to hardcoded handling for so many special cases into the kernel body but still have to handle thus cases. The initial boot stage with a temporary root filesystem is used. This root filesystem can contain user-space halpers which do the hardware detection, module loading, and device discovery necessary to get the real root filesystem mounted.

As said before, initial ramdisk is an image of initial root filesystem (along with the kernel image), it must be stored somewhere accessible by the Linux bootloader or the boot firmware.

Prior to linux version 2.6.12, Linux use initrd scheme. The image may be a filesystem image (optionally compressed) which is made available in a special block device (/dev/ram) that is then mounted as the initial root filesystem. Once the initial root filesystem is up, the kernel executes /linuxrc as its first process. When it exits, the kernel assumes that the real root file system has been mounted and executes “/sbin/init” to begin normal user-space boot process.

In initramfs (Linux 2.6.13 onward) scheme, the image may be a cpio archive (optionally compressed). The archive is unpacked by the kernel into a special instance of a tmpfs that becomes the initial root filesystem. With this scheme, there is no requirement of intermediate filesystem or block drivers to be compiled into kernel.

,

About Author

about author

xathrya

A man who is obsessed to low level technology.

2 Comments
  1. Running Kernel Image and RootFS on QEMU - Xathrya.ID

    […] self-explaining. We run machine and gives it 256MB RAM with kernel vmlinuz-3.2.0-4-versatile and initial ramdisk initrd.img, as […]

  2. Slackware on Slackware using QEMU - Xathrya.ID

    […] that you have finish download it. Then we will download the initial ramdisk for it, […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Social media & sharing icons powered by UltimatelySocial