文件系统指的是存储在计算机上的文件和目录。文件系统可以有不同的格式,这些格式叫做文件系统类型,这些格式决定了信息是如何被贮存为文件和目录。
根文件系统就是一种目录结构,那么根文件系统和普通的文件系统有什么区别呢?我认为根文件系统就是要包括Linux启动时所必须的目录和关键性 的文件,例如Linux启动时都需要有init目录下的相关文件,在Linux挂载分区时Linux一定会找/etc/fstab这个挂载文件等,根文件 系统中还包括了许多的应用程序bin目录等,任何包括这些Linux系统启动所必须的文件都可以成为根文件系统。
根文件系统就是一种目录结构,那么根文件系统和普通的文件系统有什么区别呢?我认为根文件系统就是要包括Linux启动时所必须的目录和关键性 的文件,例如Linux启动时都需要有init目录下的相关文件,在Linux挂载分区时Linux一定会找/etc/fstab这个挂载文件等,根文件 系统中还包括了许多的应用程序bin目录等,任何包括这些Linux系统启动所必须的文件都可以成为根文件系统。
Linux支持多种文件系统类型,在嵌入式上常用的有:ROMFS,JFFS2,NFS,CRAMFS,YAFFS等等。在Linux系统中是通过mount命令来挂载不同的文件系统。
建立根文件系统的步骤:
建立根文件系统的步骤:
1.创建根文件系统目录。
2.创建各种必要的系统文件目录。
3.创建设备文件。
4.建立启动相关的配置文件。
5.编译安装库文件glibc/uclibc。
6.编译busybox,安装系统软件和应用。
下面是从Undertanding the linux kernel 3rd摘录的
12.4. Filesystem Handling
下面是从Undertanding the linux kernel 3rd摘录的
12.4. Filesystem Handling
Like every traditional Unix system, Linux makes use of a system 's root filesystem : it is the filesystem that is directly mounted by the kernel during the booting phase and that holds the system initialization scripts and the most essential system programs.
Other filesystems can be mounted either by the initialization scripts or directly by the userson directories of already mounted filesystems. Being a tree of directories, every filesystem has its own root directory. The directory on which a filesystem is mounted is called the mount point. A mounted filesystem is a child of the mounted filesystem to which the mount point directory belongs. For instance, the /proc virtual filesystem is a child of the system 's root filesystem (and the system 's root filesystem is the parent of /proc). The root directory of a mounted filesystem hides the content of the mount point directory of the parent filesystem, as well as the whole subtree of the parent filesystem below the mount point.
Other filesystems can be mounted either by the initialization scripts or directly by the userson directories of already mounted filesystems. Being a tree of directories, every filesystem has its own root directory. The directory on which a filesystem is mounted is called the mount point. A mounted filesystem is a child of the mounted filesystem to which the mount point directory belongs. For instance, the /proc virtual filesystem is a child of the system 's root filesystem (and the system 's root filesystem is the parent of /proc). The root directory of a mounted filesystem hides the content of the mount point directory of the parent filesystem, as well as the whole subtree of the parent filesystem below the mount point.