In a file allocation system, the following allocation schemes are used : A. Contiguous B. Indexed C. Linked allocation Which of the allocation scheme(s) given above will not suffer from external fragmentation? Choose the correct answer from the options given below :
B and C only
File allocation schemes determine how files are stored on disk. Different schemes have different advantages and disadvantages, particularly concerning how efficiently they use storage space and whether they lead to fragmentation.
Fragmentation is a phenomenon where storage space becomes unusable because it is divided into many small, disconnected blocks. There are two main types: internal fragmentation and external fragmentation.
Let's focus on external fragmentation as asked in the question. External fragmentation occurs when there is enough total free space on the disk to satisfy a request, but this free space is scattered in small, non-contiguous blocks, so it cannot be used to allocate a file that requires a single large contiguous block.
In contiguous allocation, each file occupies a single, contiguous block of storage space on the disk. For example, if a file needs 10 blocks, it will be allocated blocks 50 through 59 contiguously.
In indexed allocation, each file has a dedicated index block. This index block contains pointers to all the disk blocks occupied by the file. The blocks pointed to by the index block do not need to be contiguous.
In linked allocation, each file is a linked list of disk blocks. Each block contains a pointer to the next block in the file. The blocks can be scattered anywhere on the disk.
| Allocation Scheme | Suffers from External Fragmentation? |
|---|---|
| Contiguous Allocation | Yes |
| Indexed Allocation | No |
| Linked Allocation | No |
| Feature | Contiguous | Indexed | Linked |
|---|---|---|---|
| File blocks need contiguity? | Yes | No | No |
| External Fragmentation | Yes | No | No |
| Direct Access Support | Easy | Moderate (via index block) | Difficult (sequential) |
| Space Overhead | Low | Moderate (index blocks) | Moderate (pointers in blocks) |
While Indexed and Linked allocation avoid external fragmentation, they might introduce other issues. Linked allocation makes direct access (random access) to data blocks slow because you might have to traverse the links from the start of the file. Indexed allocation improves direct access by using the index block but introduces overhead for the index blocks themselves and potential limits on file size based on index block size. Contiguous allocation provides excellent read performance and direct access but is rigid and suffers from external fragmentation and difficulty with file growth.
Real-world file systems often use variations or combinations of these basic schemes to balance performance, flexibility, and space utilization.
What is called Journaling in Linux operating system?
A magnetic tape drive has transport speed of 200 inches per second and a recording density of 1600 bytes per inch. The time required to write 600000 bytes of data grouped in 100 characters record with a blocking factor 10 is
What is the file extension for batch files?
_______ stores entries about files and their attributes.