1. File System is a method for storing and organizing computer files and the data they contain, to
make it easy to find and access the.
2. It may use a data storage device such as hard disk or CD-ROM and involve maintaining the
physical location of the files.
3. Mostly File System make use of an underlying data storage device that offers access to an
array of fixed-size blocks called Sectors, generally of 512 bytes each.
4. They typically have directories which associates filename with files.
5. Examples are FAT (File Allocation Table), NTFS, etc.
Types of File Systems:
1. Disk File Systems:
It is a file system designed for the storage of files on a data storage device,
most commonly a disk drive, which might be directly or indirectly connected to the computer.
Example: FAT, FAT32, NTFS, HFS,etc.
2. Flash File Systems:
It is a file system designed for storing files on flash memory devices.
Example: JFFS2, YAFFS.
3. Database File Systems:
It is a new concept of file management in which Instead of hierarchical
structured management, files are identified by their characteristics, like type of file, topic, author or
4. Transactional File Systems:
This a special kind of file system in that it logs events or transactions
to files. Each operation that you do may involve changes to a number of different files and disk
structures. It is important that they all be executed at the same time. For example, file system used
in bank’s that sends money to other bank electronically. This type of file system are synchronized
and are fault tolerant nad having a high degree of overhead.
5. Network File System:
This type of file system acts as a client for a remote file access protocol,
providing access to files on a server. Example: NFS, FTP, etc.
6. Special Purpose File System:
This type of file system includes systems where the files are
arranged dynamically by software. These are most commonly used by file-centric OS’s such as
1. File name
2. File Type
5. Current position: This is a pointer to current ‘raed or write’ position in the file.
6. Protection: Access-control information controls that can do reading, writing, executing, and so on.
7. Usage Count: This value indicates the number of processes that are currently using (have opened)
8. Time, date and process identification: This information may be kept for creation, last
modification and last use.
1. Creating a file
2. Writing a file
3. Reading a file
4. Deleting a file
File Access Methods:
1) Sequential Access:
Sequential access is based on the tape model of a file. Information in the file
is processed in order, one record after the other. A read operation reads the next portion of the file
and automatically advances the file pointer. A write operation appends to the end of the file and
the file pointer.
2) Direct Access:
Direct access is based on a disk model of a file. For direct access, the file is
viewed as a numbered sequence of block or records. There is no restriction on the order of reading
and writing for a direct access file.
3) Other Access Methods:
This method is built on the top of direct access method. It involves the
construction of an index for a file. The index contains pointers to the various blocks. To find an
entry in the file, the index is searched first and the pointer is then used to access the file directly to
find the desired entry.
File Allocation Methods
1. Contiguous Allocation:-
This method requires each file to occupy a setoff contiguous address on
the disk. Disk address defines a linear ordering on the disk. The difficulty with contiguous allocation is
finding space for a new file. It also suffers form external fragmentation.
2. Linked Allocation:-
In linked allocation, each file is a linked list of disk blocks. The directory
contains a pointer to the first (optionally the last) block of the file. There is no external fragmentation
with linked allocation. Any free block is used to satisfy a request. The problem with it is that it is
inefficient to support direct-access, it is effective only for sequential-access files.
3. Indexed Allocation:-
This allocation method is the solution to the problem of both contiguous
and linked allocation. This is done by bringing all the pointers together into one location called the
index block. Each file has its own index block, which is an array of disk sector of addresses. The
directory contains the address of the index block of a file.
Disk/Free Space Management:
Since there is only a limited amount of disk space, it is necessary to reuse the space from deleted files for
new files. To keep track of free disk space, the system maintains a free-space list which records all disk
blocks that are free.
Free-space list can be implemented as:
Each block is represented by a 1 bit. If the block is free, the bit is 0; if the
block is allocated, the bit is 1.
2) Linked List:
This approach link all the free disk blocks together, keeping a pointer to the
first free block. This block contains a pointer to the next free disk block, and so on.
This approach stores the addresses of n free blocks in the first free block. The
first n-1 of these are actually free. The last one is the disk address of another block containing
addresses of other ‘n’ free blocks. The importance of this implementation is that addresses of a
large number of free blocks can be found quickly.
This approach takes advantage of the fact that several contiguous blocks may be
allocated or freed simultaneously. Thus, rather than keeping a list of free disk addresses, the
address of the first free block is kept and the number n of free contiguous blocks that follow the
The most common directory structures used by multi-user systems are:
1. Single-Level Directory:-
In a single-level directory system, all the files are placed in one directory. This is
very common on single-user OS. It has significant limitations when the no. of files or when there is more
than one user. Since all the files are in same folder, they must have unique name.
2. Two-Level Directory:-
In the two-level directory system, the system maintains a master block that has one
entry for each user. This master block contains the addresses of the directories of the users. The problem
with this structure is that it effectively isolates one user from another.
3. Tree-Structured Directories:-
In this structure, the directory are files. This leads to the possibility of
having sub-directories that can contain files and sub-subdirectories.
4. Acyclic-Graph Directories:-
It is an extension of the tree-structured directory structure. In the treestructured
directory, files and directories starting from some fixed directory are owned by one particular
user. In the acyclic structure, this prohibition is taken out and thus a directory or file under directory can be owned by several users.