Homework 9 Version 0 |
|
👤 Author: by 157128166qqcom 2019-12-24 13:38:26 |
Describe advantages and disadvantages of each allocation method for disk space
Contiguous Allocation
Advantages:
Fast when accessing files, since all data are stored contiguously making head movement to the least.
Accessing files is easy for both sequential(always next block) and direct access(block i of a file starts at block b is block b+i).
Disadvantages:
Finding space for new files is difficult. When files got deleted, there will be some small free space on disk which can hardly be used for large files. One will need to compact such disk with a cost of time.
Determining how much space is needed for a file is not easy too. Since a program is very likely to expand, space cannot be just fit. But if too much space is given, it is a waste.
Linked Allocation
Advantages:
Blocks can be scattered anywhere on the disk.
No external fragmentation.
Disadvantages:
Inefficient in direct access because system must start from the beginning block of a file to find a certain block in the middle.
Disk space is reduced since every block need a pointer to store address of next block.
Reliability is not good. One damaged block can cause the rest of that file useless.
Indexed Allocation
Advantages:
Have all advantages of Linked Allocation.
Can direct access any block by using index block which stores all addresses of a file's blocks.
Disadvantages:
Wasted space is much more than Linked Allocation because pointer overhead of index blocks is greater.