Initramfs is a CPIO format archive, that every Linux kernel contains, which is extracted into rootfs when the kernel boots up. It contains a complete root file system for Linux. It then helps to assemble and mount the real root file system. The initramfs or early userspace is necessary for complex setups, like network boot, LVM, raid, which needs additional user space utilities to get rootfs accessed. initramfs does not need to contain every module that a user might want to use, instead it only contains the modules which are required to access the root filesystem. Rest major modules will be loaded later by udev during init process. After extracting, kernel checks for /init file. If it finds, then it is executed as PID 1. This /init program helps in finding real root device if there is any. If kernel does not find /init in rootfs, it falls back to older code to locate and mount a root partition and then executes /sbin/init . Thanks Ayush
Glimpse to the world of Linux & Networking.