Linux File System 文件系统 VFS VFS的作用 基于ⅤFS的文件访问 VFS重要数据结构 文件系统的注册与安装 ext2、ext3文件系统 文件操作 proc文件系统 CRAMFS文件系统
1 Linux File System • 文件系统 • VFS VFS的作用 基于VFS的文件访问 VFS重要数据结构 • 文件系统的注册与安装 • ext2、ext3文件系统 • 文件操作 • proc文件系统 • CRAMFS文件系统
各种各样的文件系统 o Windows Fat16Fat32. NTFS o传统UNIX:UFS( Unix File System) OBSD文件系统FFS( Fast File system) o Proc File system:只存在于内存中 o Linux File system ext2( is first introduced in kernel 2.0.x reiserfs( is first introduced in kernel 2.2. x) ext3( is first introduced in kernel 2. 4.x, default in RedHat now) xfs (from SGI) Jfs (from IBM) o嵌入式小型文件系统 O CRAMFS O JFFS2
2 各种各样的文件系统 Windows FAT16,FAT32, NTFS 传统UNIX: UFS (Unix File System) BSD文件系统FFS(Fast File System) Proc File System:只存在于内存中 Linux File System – ext2 ( is first introduced in kernel 2.0.x ) – reiserfs ( is first introduced in kernel 2.2.x ) – ext3 ( is first introduced in kernel 2.4.x ,default in RedHat now) – xfs (from SGI ) – Jfs (from IBM ) 嵌入式小型文件系统 CRAMFS JFFS2
inux文件系统目录布局 To comply with FSStND(File System STaNDard first of mount point in linux lete -keep linux default configuration /boot -keep important linux booting files(can be a separate file system) /bin -Essential command binaries for both root and ord. users /sbin -Essential system binaries for administrator /dev -keep all device files /usr -keep all user binary and X library /home -keep user home directory /proc pseudo file system for tracking running process and state of linux system /var -keeping mail, log file and printer spooling /ib -contain shared library that is required by system program /tmp -contain system temporary file /opt -Add-on application software packages
3 linux文件系统目录布局 To comply with FSSTND(File System STaNDard): / - first of mount point in linux /etc - keep linux default configuration /boot - keep important linux booting files(can be a separate file system) /bin - Essential command binaries for both root and ord. users /sbin - Essential system binaries for administrator /dev - keep all device files /usr - keep all user binary and X library /home - keep user home directory /proc - is pseudo file system for tracking running process and state of linux system /var - keeping mail, log file and printer spooling /lib - contain shared library that is required by system program /tmp - contain system temporary file /opt - Add-on application software packages
UNIX文件系统文件类型 Directory -- catalogue of file name Normal file --> format of data source file text file Symbolic link--> a pointer to another file Special file --> use for device controller in kernel Named pipe--> communication channel which can be used by serveral processes(may be irrelevant) in order to exchange data
4 UNIX文件系统文件类型 • Directory --> catalogue of file name • Normal file --> format of data –source file –text file • Symbolic link --> a pointer to another file • Special file --> use for device controller in kernel • Named pipe --> communication channel which can be used by serveral processes(may be irrelevant) in order to exchange data
硬链接( Hard link) [root@localhost link]# Is-1 total 1 -rW-r--r--1 root root 6670ct1513:39a [@localhost link]# ln a b [root@localhost link]# Is-1 total 2 2 root 667oct1513:39 root root 6670ct1513:39b [root@localhost link]# rm a rm: remove a?y [root@localhost link]# Is-1 total 1 1 root root 667oct1513:39b Inode /root/link L匚b了 5
5 硬链接(Hard Link) [root@localhost link]# ls -l total 1 -rw-r--r-- 1 root root 667 Oct 15 13:39 a [root@localhost link]# ln a b [root@localhost link]# ls -l total 2 -rw-r--r-- 2 root root 667 Oct 15 13:39 a -rw-r--r-- 2 root root 667 Oct 15 13:39 b [root@localhost link]# rm a rm: remove `a'? y [root@localhost link]# ls -l total 1 -rw-r--r-- 1 root root 667 Oct 15 13:39 b inode /root/link a b