Computers store data on disks using files, which are structuredin specific ways in order to allow for faster access, higherreliability, and to make better use out of the drives availablespace.The specific way in which files are stored on a disk is called afile system, and enables files to have names and attributes.It also allows them to be stored in a hierarchy of directories orfolders arranged in a directory tree.
Linear list of file names with pointer to the data blocks. Simple to program Time consuming- linear search for file names required,whenever a new file is created or an existing file is deleted.A sorted list allows binary search, thereby reducing timeconsumption, but this complicates creation and deletion processes.
To Overcome this problem, many operating systems implement asoftware cache to store the most recently used directoryinformation from the disk.Hash table - another data structure. linear list stores the directory entries, but a hash data structure isalso used. the hash table takes a value computed from the file name andreturns a pointer to the file name in the linear list. greatly decreases directory search time. insertion and deletion are easy.Collisions – situation in which two file names hash to the samelocation.
Chained overflow hash table –• each hash entry is a linked list instead of an individual value• collisions can be avoided by adding a new entry to the linked list.
An allocation method refers to how disk blocks are allocated for files.The main problem is to allocate space to files so that disk space is utilized effectively and files can be accessed quickly.
Three types :1. Contiguous allocation2. Linked allocation3. Indexed allocation Each file occupy a set of contiguous blocks on that disk. Assuming only one job is accessing the disk, accessingblock ‘k+1’ after block ‘k’ normally requires no headmovement. Thus the number of disk seeks required foraccessing contiguously allocated files is minimal. Contiguous allocation of a file is defined by the diskaddress and length of the first block
The directory entry for each file indicates the address ofthe starting block and the length of the area allocated for thefile. Easy Accessing – only starting location (block #) and length (number for blocks) are required. Files cannot grow.