![]() |
|
|
|
|
|
The Second Extended File System - An introduction
By Vans Information <content@vansinfo.com>
This file system, which draws its inspiration mainly from the Minix file system of the older days written by Andrew Tanenbaum, was the only file system that was available with a free operating system called “Minix”. It was later modified to be used with the Linux system and was called the Extended File System. The Linux file system being used now, called ext2 (Second Extended File System), is a newer version of the Extended file system that also supports the Access Control Lists (ACL). But, before embarking on a detailed study of the ext2 file system, lets get acquainted with the terminology associated with file systems and volumes. In the later articles we will investigate the design of the ext2 filesystem. Block: Files on disk are stored in an integral number of fixed size blocks. The size of the blocks is usually a power of 2. By default, the block size of the ext2 file system is 4K. Research, shows that 4K is the most optimal size for a disk block. If the size of a file does not come to a multiple of 4K, part of the last disk block (on an average, half a block) is wasted. In the worst of cases, almost an entire block, having just one byte of the file, is wasted. The situation is a bit tricky here. If we select a larger block size, then there is wastage of disk space for small-sized files. On the other hand, if we use a very small block size, the number of disk blocks increase exponentially, thereby taking up more book-keeping time for the files. Therefore, selection of blocks has to be given careful thought. When a file is loaded into memory, the disk blocks are loaded into the buffer cache in main memory. If they are modified, the blocks in the buffers are marked as `Dirty’. It means that these blocks have to be written to disk in order to maintain consistency between the blocks on disk and those in main memory. Superblock: Superblock is a region at the beginning of every file system where information like the size of the file system, the empty and the filled blocks, their respective counts, and other such data, is stored. A request to access any file from a file system requires access to the file system’s superblock. If the superblock is damaged, then it may be difficult to retrieve data from the disk. Inode: An inode is an entry in a table for the file system called the Inode Table. The inode contains all kinds of information about the file including its name, size, the number of links, date and time of creation, modification and access. It also contains pointers to the disk-blocks where the file is stored.
* e2fsck: Caution: Never run e2fsck/fsck on any filesystem that is mounted. If we wish to run ‘fsck’, we should ‘unmount’ the filesystem, and then perform an ‘fsck’. Failing to do the above may cause the filesystem to be corrupted. * tune2fs: * dumpe2fs: * mke2fs: * badblocks: The Second Extended Filesystem of Linux is a state-based file system. It maintains the state of all open files in memory. All files that are opened for any kind of access, have entries in data structures in memory. These data structures maintain the current status of the files loaded from disk to memory. Dirty blocks are identified by entries in these data structures and these can be explicitly written to disk using the ‘bdflush’ command. The latest version of the Linux file system called ‘ext3’ is said to have journaling support. A Journaling Filesystem is one that keeps logs and checkpoints for all the transactions that have been done, so that if the system crashes it can start restoring file system on disk using the logs starting from the last checkpoint. We shall look into the proposed journaling file system for Linux in the following article.
The e2fsprogs package is available for anonymous ftp from ftp://tsx-11.mit.edu/ in /pub/linux/packages/ext2fs.
Other articles by Vans Information
Current Rating: [ 6.56 / 10 ]
Number of Times Rated: [ 64 ]
|
|
|
© 1998-2004 FreeOS Technologies (I) Pvt. Ltd. All rights reserved.
[Privacy Policy]
![]() |