虚拟根文件系统,指的是掉电就消失的文件系统,比如linux真正第一个挂载的“根”,就是一个基于内存的根文件系统,它是虚拟的,没有对应外部非易失性存储介质。
Ramfs-rootfs-initramfs.txt
==========================================================
All 2.6 Linux kernels contain a gzipped "cpio" format archive, which is
extracted into rootfs when the kernel boots up. After extracting, the kernel
checks to see if rootfs contains a file "init", and if so it executes it as PID
1. If found, this init process is responsible for bringing the system the rest
of the way up, including locating and mounting the real root device (if any).
If rootfs does not contain an init program after the embedded cpio archive is
extracted into it, the kernel will fall through to the older code to locate and
mount a root partition, then exec some variant of /sbin/init out of that.
he initial RAM disk is necessary for booting linux system.
the RAM disk image is created by mkinitrd.
Why is it necessary?
because we try to avoid a classic problem: "which comes first the chicken or the egg". Think about it: how do you boot the root file system if it resides on a device that requires a module in the root file system to initialize? The answer is: by using the initrd with the required module in it that is available to the kernel before the root file system is mounted. Kernel will then be started after RAM disk image is loaded.