initrd provides the capability to load a RAM disk by the boot loader.
This RAM disk can then be mounted as the root file system and programs
can be run from it.
config BLK_DEV_RAM
tristate "RAM block device support"
help
Saying Y here will allow you to use a portion of your RAM memory as
a block device, so that you can make file systems on it, read and
write to it and do all the other things that you can do with normal
block devices (such as hard drives). It is usually used to load and
store a copy of a minimal root file system off of a floppy into RAM
during the initial install of Linux.
Note that the kernel command line option "ramdisk=XX" is now obsolete.
For details, read <file:Documentation/admin-guide/blockdev/ramdisk.rst>.
To compile this driver as a module, choose M here: the
module will be called brd. An alias "rd" has been defined
for historical reasons.
initrd: 又名RAM disk,是一个基于内存的磁盘,依赖内核的BLK_DEV_RAM配置项。
config BLK_DEV_INITRD
bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
help
The initial RAM filesystem is a ramfs which is loaded by the
boot loader (loadlin or lilo) and that is mounted as root
before the normal boot procedure. It is typically used to
load modules needed to mount the "real" root file system,
etc. See <file:Documentation/admin-guide/initrd.rst> for details.
If RAM disk support (BLK_DEV_RAM) is also included, this
also enables initial RAM disk (initrd) support and adds
15 Kbytes (more on some other architectures) to the kernel size.
If unsure say Y.
initramfs: 被bootloader引导器加载的基于内存的根文件系统。通常用于加载一些闭源内核模块和挂在真正的根文件系统。
initramfs是ramfs的继承实现。
ramfs: 是采用linux的磁盘缓冲机制实现的、可以调整大小的、基于内存的文件系统。是替代initrd的方案。
tmpfs: 是为了弥补ramfs的缺陷而开发的。它是ramfs的一个继承者,在ramfs的基础上实现了对内存使用大小的限制以及写交换分区的特性。
rootfs: 是一种特殊的ramfs,它不能被umount掉,但是rootfs可以在运行被切换。
参考文献:
Using the initial RAM disk (initrd) — The Linux Kernel documentation