top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Can someone give detailed view about initial RAM based file system (initramfs) and its contents ?

+2 votes
609 views
Can someone give detailed view about initial RAM based file system (initramfs) and its contents ?
posted Jan 5, 2015 by Sachidananda Sahu

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

The boot loader loads both the kernel and an initial RAM–based file system (initramfs) into memory so it can be used directly by the kernel.  

When the kernel is loaded in RAM, it immediately initializes and configures the computer’s memory and also configures all the hardware attached to the system. This includes all processors, I/O subsystems, storage devices, etc. The kernel also loads some necessary user space applications.

The initramfs filesystem image contains programs and binary files that perform all actions needed to mount the proper root filesystem, like providing kernel functionality for the needed filesystem and device drivers for mass storage controllers with a facility called udev (for User Device) which is responsible for figuring out which devices are present, locating the drivers they need to operate properly, and loading them. After the root filesystem has been found, it is checked for errors and mounted.

The mount program instructs the operating system that a filesystem is ready for use, and associates it with a particular point in the overall hierarchy of the filesystem (the mount point). If this is successful, the initramfs is cleared from RAM and the init program on the root filesystem (/sbin/init) is executed.

init handles the mounting and pivoting over to the final real root filesystem. If special hardware drivers are needed before the mass storage can be accessed, they must be in the initramfs image.

Ref: Introduction to Linux Course https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-2 you can enroll for free

answer Jan 5, 2015 by Pavankumar Survepalli
Hello pavan, I am also going through the same course and wanted a detailed view
+1 vote

The only purpose of an initramfs is to mount the root filesystem. The initramfs is a complete set of directories that you would find on a normal root filesystem. It is bundled into a single cpio archive and compressed with one of several compression algorithms.

At boot time, the boot loader loads the kernel and the initramfs image into memory and starts the kernel. The kernel checks for the presence of the initramfs and, if found, mounts it as / and runs /init. The init program is typically a shell script. Note that the boot process takes longer, possibly significantly longer, if an initramfs is used.

For most distributions, kernel modules are the biggest reason to have an initramfs. In a general distribution, there are many unknowns such as file system types and disk layouts. In a way, this is the opposite of LFS where the system capabilities and layout are known and a custom kernel is normally built. In this situation, an initramfs is rarely needed.

There are only four primary reasons to have an initramfs in the LFS environment: loading the rootfs from a network, loading it from an LVM logical volume, having an encrypted rootfs where a password is required, or for the convenience of specifying the rootfs as a LABEL or UUID. Anything else usually means that the kernel was not configured properly.

Source: http://www.linuxfromscratch.org/blfs/view/svn/postlfs/initramfs.html

answer Jan 6, 2015 by Salil Agrawal
Similar Questions
+3 votes

Any link or detailed info available to understand snooping ?

+1 vote

As far as I know, 32 bit operating system can point only 4 GB of memory, does it mean that maximum size of binary it can run on 32-bit operating system is 4 GB?

...