免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1259 | 回复: 0
打印 上一主题 下一主题

什么是根文件系统 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-08-26 18:46 |只看该作者 |倒序浏览

简单来说,(根文件系统)就是系统第一个mount的文件系统
  
下面是从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   mountedeither   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.

  • 转载自:http://www.91linux.com/html/article/go/20071206/8876.html
    简单的来说,我认为根文件系统就是一种目录结构,那么根文件系统和普通的文件系统有什么区别呢?我认为根文件系统就是要包括Linux启动时所必须的目录
    和关键性的文件,例如Linux启动时都需要有init目录下的相关文件,在Linux挂载分区时Linux一定会找/etc/fstab这个挂载文件
    等,根文件系统中还包括了许多的应用程序bin目录等,任何包括这些Linux系统启动所必须的文件都可以成为根文件系统。
        Linux支持多种文件系统类型,在嵌入式上常用的有:ROMFS,JFFS2,NFS,CRAMFS,YAFFS等等。在Linux系统中是通过mount命令来挂载不同的文件系统。
    在ARM Linux中常用的文件系统的配置:
    RAM Disk Driver + EXT2;
    MTD Driver + JFFS2/YAFFS;
    NFS;
    uclinux中常见的文件系统配置为:
    Blkmem Driver + ROMFS(支持 Nor Flash);
    RAM Disk Driver + ROMFS(不支持FLASH);
    MTD Driver + JFFS2/YAFFS(支持多种flash);
       建立根文件系统的步骤:
    1.创建根文件系统目录。
    2.创建各种必要的系统文件目录。
    3.创建设备文件。
    4.建立启动相关的配置文件。
    5.编译安装库文件glibc/uclibc。
    6.编译busybox,安装系统软件和应用。
    这里重点要建立启动相关的配置文件(Linux-2.6):
    [color="#ff0000"]创建/etc/inittab
    ::sysinit:/etc/init.d/rcS
    ::respawn:/sbin/getty 115200 s3c2410_serial0
    ::restart:/sbin/init
    ::shutdown:/bin/umount -a -r
    [color="#ff0000"]创建/etc/init.d文件
    #!/bin/sh
    mount -a
    /etc/init.d/udev  start
    mkdir  /dev/pts
    mount -t devpts devpts /dev/pts
    hwclock --hctosys
    ifup eth0
    ifup lo
    /etc/init.d/sshd start
    thttpd -C /etc/thttpd.conf
    [color="#ff0000"]建立开发板上的文件系统配置文件/etc/fstab
    proc       /proc      proc      defaults    0    0
    sys        /sys       sysfs     defaults    0    0
                   
                   
                   

    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u2/61322/showart_1149479.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP