initrd, ramfs and initramfs

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值