Linux ramfs,rootfs,tmpfs,ramdisk,initrd and initramfs

简介

1、ramfs

Ramfs is a very simple filesystem that exports Linux's disk caching mechanisms (the page cache and dentry cache) as a dynamically resizable RAM-based filesystem. 

2、rootfs

Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is always present in 2.6 systems.  You can't unmount rootfs for approximately the same reason you can't kill the init process; rather than having special code to check for and handle an empty list, it's smaller and simpler for the kernel to just make sure certain lists can't become empty.

3、tmpfs

tmpfs is a file system which keeps all files in virtual memory.

4、ramdisk

The RAM disk driver is a way to use main system memory as a block device.  It is required for initrd, an initial filesystem used if you need to load modules in order to access the root filesystem (see Documentation/initrd.txt).  It can also be used for a temporary filesystem for crypto work, since the contents are erased on reboot.

5、initrd

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. Afterwards, a new root file system can be mounted from a different device. The previous root (from initrd) is then moved to a directory and can be subsequently unmounted.

6、initramfs

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.

应用

 一般initramfs+ramfs,initrd+ramdisk+(ext2,ext3,ext4)可作为rootfs。其中initramfs,initrd是一种image格式的文件,PC有相应的工具制作这些image。
tmpfs可存储设备节点,mount到/dev下。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值