29-05-2013, 04:57 PM
FILE SYSTEMS: CASE STUDY
FILE SYSTEMS.pdf (Size: 309.93 KB / Downloads: 29)
What is file system?
A file system (file system) is a means to organize data expected to be
retained after a program terminates by providing procedures to store, retrieve
and update data, as well as manage the available space on the device(s)
which contain it. A file system organizes data in an efficient manner and is
tuned to the specific characteristics of the device.
Any computer file is stored on some kind of storage: hard disk, CD, DVD,
flash memory and so on. These storages have specific, model-dependent
capacity to store data. From the software point of view (including operating
system) each storage is linear space to read or both read and write the digital
information. Each byte of the information on a storage has its own specific
offset from storage start (the address) and could be referenced by this
address. You may imagine storage as grid with set of numbered cells (each
cell - the single byte). Any file saved to storage takes a number of these cells.
File system - is just a kind of structured data representation on a storage and
set of metadata to describe the stored data. Unlike plain storage, file system
could be located on disk partition - the isolated segment of storage. Usually it
operates blocks, not sectors. The file system blocks are groups of sectors
aimed at storage addressing optimization. Modern file systems generally use
block sizes from 1 up to 128 sectors (512-65536 bytes). The files are usually
stored from start of block and take entire blocks.
Many write/delete operations to file system could cause file system
fragmentation: the files could not be stored as whole fragments anymore and
are divided to fragments. Here is an example of “fragmentation”: imagine a
storage entirely taken by files with size about 4 blocks (e.g. pictures
collection). User wants to store a file that would take 8 blocks and therefore
deletes the first and the last file. By doing this he releases 8 blocks, however
the first segment is near to storage start, and the second near to storage end.
In this case 8 block file will be split into two parts (4 blocks for each part) and
will take free space 'holes'. The information about both fragments which are
parts of of a single file will be stored to file system.
Apart from user files, file system also stores its own parameters (as block size
etc.), file descriptors (that include file size, file location, its fragments etc.), file
names and directory hierarchy. It may store also security information,
extended attributes and other parameters as well.
There are many requirements to storage performance, stability and other
qualities of the file system. To best suit a specific purpose there have been
developed many different types of file systems. So at present we can see
plenty of file systems that are used on different types of computer systems
and serve specific purposes.
I. EXT
Introduction:
The extended file system, or ext, was implemented in April 1992 as the first
file system created specifically for the Linux kernel. It has metadata structure
inspired by the traditional Unix File System (UFS) and was designed by Rémy
Card to overcome certain limitations of the MINIX file system. It was the first
implementation that used the virtual file system (VFS), for which support was
added in the Linux kernel in version 0.96c, and it could handle file systems up
to 2 gigabytes (GB) in size.
It is the first in the series of the extended file systems, superseded by both
ext2 and xiafs, between which there was a competition, which ext2 won
because of its long-term viability. ext2 remedied issues with ext, such as the
immutability of inodes and fragmentation.
II. Ext2
Introduction:
The Second Extended File system was devised as an extensible and powerful
file system for Linux. It is also the most successful file system so far in the
Linux community and is the basis for all of the currently shipping Linux
distributions.
It was initially designed by Rémy Card as a replacement for the extended file
system (ext).
The canonical implementation of ext2 is the ext2fs filesystem driver in the
Linux kernel. Other implementations (of varying quality and completeness)
exist in GNU Hurd, MINIX 3, Mac OS X (third-party), Darwin (same third-party
as Mac OS X but untested), some BSD kernels, in Atari MiNT, and as thirdparty
Microsoft Windows drivers.
ext2 was the default filesystem in several Linux distributions, including Debian
and Red Hat Linux, until supplanted more recently by ext3, which is almost
completely compatible with ext2 and is a journaling file system. ext2 is still the
filesystem of choice for flash-based storage media (such as SD cards, and
USB flash drives), since its lack of a journal minimizes the number of writes,
and flash devices have a limited number of write cycles. Recent kernels,
however, support a journal-less mode of ext4, which would offer the same
benefit, along with a number of ext4-specific benefits.
III. Ext3
Introduction:
The ext3 or third extended file system is a journaled file system that is
commonly used by the Linux kernel. It is the default file system for many
popular Linux distributions, including Debian. Stephen Tweedie first revealed
that he was working on extending ext2 in Journaling the Linux ext2fs File
system in a 1998 paper and later in a February 1999 kernel mailing list
posting, and the file system was merged with the mainline Linux kernel in
November 2001 from 2.4.15 onward. Its main advantage over ext2 is
journaling, which improves reliability and eliminates the need to check the file
system after an unclean shutdown. Its successor is ext4.