file system & optimization
file system & optimization
to file-system designers.
Two general strategies are possible for storing an n byte file:
a)n consecutive bytes of disk space are allocated.
b)file is split up into a number of contiguous blocks.
The same trade-off is present in memory-management systems between pure
segmentation and paging.
In this method, one word in each block is used as a pointer to the next block.
The entry for this file in the user level directory is a pointer to the first block of
the file.
Though the implementation of this method seems to be simple , it has a specific
disadvantages, which is a large number of disc accesses needed to find the end
of the file.
Since each block points to only the next block all the blocks needs to be passed
through to arrive at the end of the file.
The linking methods we have seen previously suffer from the main demerit in
that they require more number of disk accesses to arrive at a specific block
since the file access method must be sequential.
More number of disk accesses means more number of head movements and
corresponding rotational delays.
This demerit can be overcome if the file access can be random.
This can be achieved with the help of index blocks which are used to store the
linkage pointers for each file.
The size of each index block is limited and hence a large file might require
many blocks , which are linked together.
Choosing a proper block size is an important function of disk management .
The most commonly used block sizes are 512 , 1k and 2k bytes.
The block size and the sector size need not be the same.
If the sector size is 2k bytes then always 2 consecutive sectors are read from the
disk and are treated as a single unit.
If a computer’s file system is irrevocably lost, whether due to hardware or
software, restoring all the information will be difficult, time consuming, and in
many cases, impossible.
Backups allow files that were removed days, even weeks, ago to be restored
from old backup tapes.
Backups to tape are generally made to handle one of two potential problems:
(1) Recover from disaster.
(2) Recover from stupidity
Full backup - Preserves the whole system.
System backup - Preserves system directories and files. Must include backup/
restore tools.