?? os-faq-fs.html
字號:
<html><head> <title>Operating Systems FAQ :: Filesystems</title> <link rel=stylesheet type="text/css" href="default.css"></head><body><TABLE border="0" width="100%"> <TR> <TD><H2><A name="file_systems">Tell me about Filesystems</A></H2> </TD> </TR> <TR> <TD>There are many different kinds of filesystems around, from the well known to the more obscure ones. The most unfortunate thing about filesystems is that every hobbyist OS programmer thinks that the filesystem they design is the ants pants when all it is, is a knock off of DOS FAT with a change here and there.<P>The world doesn't need another crap filesystem. Investigate all the possibilites before you decide you have to create your own.</P> <UL> <LI><A href="#fs_fat">FAT</A> <LI><a href="#fs_vfat">VFAT</a> <LI><a href="#fs_fat32">FAT32</a> <LI><a href="#fs_hpfs">HPFS (High Performance File System)</a> <LI><a href="#fs_ntfs">NTFS (New Technology File System)</a> <LI><a href="#fs_ext2fs">EXT2FS (Second Extended File System)</a> <LI><a href="#fs_befs">BeFS</a> <LI><a href="#fs_ffs_amiga">FFS (Fast File System) AMIGA</a> <li><a href="#fs_ffs_bsd">FFS BSD</a> <li><a href="#fs_nfs">NFS (Networked File System)</a> <li><a href="#fs_afs">AFS (Andrew File System)</a> <li><a HREF="#fs_rfs">RFS (Remote File System)</a> <li><a href="#fs_xfs">XFS (SGI File System)</a> </UL> </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_fat">Filesystems :: FAT</A></H2> </TD> </TR> <TR> <TD>File Allocation Table (FAT) was introduced with DOS v1.0 (and possably CP/M) and was supposedly written by Bill Gates. FAT is a very simple filesystem which is nothing more than a singular linked list of clusters. FAT filesystems use very little memory and is one of, if not the most basic of filesystems in existance today.<P></P><P>There are two versions of this simplified FAT, FAT12 and FAT16. FAT12 was designed for floppy disks and can manage a maximum size of 16mb using 12bit cluster numbers. FAT16 was designed for early hard disks and could handle a maximum size of 64kb * cluster_size. The larger the hard disk, the larger the cluster size would be, which lead to large amounts of "slack space" on the disk.</P><P>FAT12+FAT16 filesystems have fixed size for filenames of "8.3" and limited support for file attributes.</P> </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_vfat">Filesystems :: VFAT</A></H2> </TD> </TR> <TR> <TD>VFAT is an extension of FAT16 and FAT12 that has the ability to use long filenames (up to 255 characters i think). First introduced by Windows95. It uses a "cludge" whereby long filenames are marked with an "volume lable"e; attribute and filenames are subsequently stored in the 8.3 format in sequential directory entries. (This is a bit of an oversimplification, but close enough). </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_fat32">Filesystems :: FAT32</A></H2> </TD> </TR> <TR> <TD>FAT32 was introduced to us by Windows95-B and Windows98. FAT32 broke through some of FAT's problems. No more 64kb max clusters! FAT32 as its name suggests, can handle a maximum of 4gig clusters per partition. This enables very large hard disks to still maintain very small cluster sizes and thus reduce slack space between files. </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_hpfs">Filesystems :: HPFS (High Performace Filesystem)</A></H2> </TD> </TR> <TR> <TD>The HPFS was designed by IBM/Microsoft for IBMs new windowing system, OS/2.<P>HPFS was designed to be fast, remove all the shortcomings of FAT, support long filenames, small cluster sizes, remove degfragmentation as much as possible and support more attributes.</P><P>HPFS is the precursor to NTFS and is, in a nutshell, NTFS minus all the securty features embeded into NTFS. Instead of storing cluster chains in a single linked list format, HPFS stores its information in sorted B-Tree's. This makes searching for files blindingly fast.</P><P>HPFS is a member of the "inode" family if filesystems as opposed to the "FAT" family. Other examples of INODE type filesystems are, NTFS, ext2fs and most unix filesystems.</P><P>Instead of keeping the directory tables and other descriptors at the start of the disk, HPFS bands them at regular intervals through out the disk and in the middle of the disk, the theory being, the heads only have to move half as much in any direction as maximum to get to the middle of the disk.</P> </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_ntfs">Filesystems :: NTFS (New Technology Filesystem)</A></H2> </TD> </TR> <TR> <TD>NTFS is the native filesystem of WindowsNT. It is much like HPFS but supports security features in the filesystem such as access controls. Since WindowsNT is entirly unicode, NTFS is a unicode filesystem, each "character" being 16bits wide. <p> NTFS adds quite a bit more to HPFS than just security features. First, it adds quite a bit of builtin redundancy -- with HPFS, wiping out one sector in the wrong place can render an entire volume inaccessible. Second, it adds support for multiple hard-links to a file (up 'til now, the only easy access has been via the POSIX subsystem, but NT 5/Win2K adds this to Win32 as well). Third, it supports an arbitrary number of file forks al la MacOS (except MacOS always has exactly 2 forks per file). Fourth, HPFS decrees that a cluster is always 512 bytes, and a cluster is always one sector. For the sake of performance and compatibility with some (especially Japanese) machines, NTFS allows sectors of other sizes. It also supports clusters of more than one sector, which tends to help performance a little. </p> </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_ext2fs">Filesystems :: ext2fs (Second Extended Filesystem)</A></H2> </TD> </TR> <TR> <TD>The Second Extended Filesystem is the native filesystem of Linux. It is another "inode" based system.... <p> An ext2fs-partition is made up from blocks, which normally are 1K each. The first block (the bootblock) is zeroized, all the other blocks are divided into so-called block groups (normally, between 256 and 8192 blocks form a group). Each block group contains: <ul> <li>a copy of the superblock (which is a mighty useful structure containing info about the filesystem) <li>the filesystem descriptors (dunno what that is exactly) <li>the block bitmap, tells which blocks are used <li>the inode bitmap, tells which inodes are used (difference?) <li>the inode table, which contains the inodes themselves <li>the data blocks referenced by the inodes </ul> </p> <p> The first inode is a special one; it is the bad blocks inode, which references all the damaged sectors of the partition. The fifth inode contains the bootloader, whereas the 11th contains the root directory. </p> </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_befs">Filesystems :: BeFS</A></H2> </TD> </TR> <TR> <TD>BeFS is the new filesystem for the Be Operating system. It is very much like the MacOS Filesystem. It supports multiple forks and is a 64bit filesystem. <p> more info required. </TD> </TR></TABLE><P> </P><TABLE border="0" width="100%"> <TR> <TD><H2><A name="fs_ffs_amiga">Filesystems :: FFS (Amiga)</A></H2> </TD> </TR> <TR> <TD>Here's info on the Amiga FFS, version 1.3 or 2.0, can't remember which... Expect spelling errors to abound, as I am writing this while drop-dead tired..<p>1.1 Root Block<p>The root of the tree is the root block, which is at a fixed place on thedisk. The root is like any other directory, except that it has no parent,and it's secondary type is different. AmigaDOS stores the name of the diskvolume in the name field of the root block.<p>Each filing system blck contains a checksum, where the sum (ignoringoverflow) of all the words in the block is zero.<pre> +---------------+ 0 | T. SHORT | Type |---------------| 1 | 0 | header key (always 0) |---------------| 2 | 0 | Highest seq number (always 0) |---------------| 3 | HT SIZE | Hashtable size (=blocksize -56) |---------------| 4 | 0 | |---------------| 5 | CHECKSUM | |---------------| 6 | hash | | table | / / \ \ SIZE-51 | | |---------------| SIZE-50 | BMFLAG | TRUE if bitmap on disk is valid |---------------| SIZE-49 | bitmap | Used to indicate the blocks SIZE-24 | pages | containing the bitmap |---------------| SIZE-23 | DAYS | Volume last altered date and time |---------------| SIZE-22 | MINS | |---------------| SIZE-21 | TICKS | |---------------| SIZE-20 | DISK | Volume name as a BCPL string | NAME | of <= 30 characters |---------------| SIZE-7 | CREATEDAYS | Volume creation date and time |---------------| SIZE-6 | CREATEMINS | |---------------| SIZE-5 | CREATETICKS | |---------------| SIZE-4 | 0 | Next entry on this hash chain |---------------| (always 0) SIZE-3 | 0 | Parent directory (always 0) |---------------| SIZE-2 | 0 | Extension (always 0) |---------------| SIZE-1 | ST.ROOT | Secondary type indicates root block +---------------+</pre><p>1.1.2 User Directory Blocks<pre> +---------------+ 0 | T.SHORT | Type |---------------| 1 | OWN KEY | Header Key (pointer to self) |---------------| 2 | 0 | Highest Seq Number (always 0) |---------------| 3 | 0 | |---------------| 4 | 0 | |---------------| 5 | CHECKSUM | |---------------| 6 | | | hash table | / / \ \ SIZE-51 | | |---------------| SIZE-50 | Spare | |---------------| SIZE-48 | PROTECT | Protection bits |---------------| SIZE-47 | 0 | Unused (always 0) |---------------| SIZE-46 | | | COMMENT | Stored as BCPL string SIZE-24 | | |---------------| SIZE-23 | DAYS | Creation date and time
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -