Skip to main content

Linked list file system; block size impact

Short answer

Linked list stores next-block pointer in each block, no external fragmentation but slow random access. Larger blocks improve data rate (less seek/rotation overhead) but reduce space utilization due to internal fragmentation; e.g.,1 KB block yields 100% utilization and109 KB/s, 64 KB block3.1% and6.5 MB/s; compromise around4 KB.

How can file system be implemented using linked list? Explain impact of block size selection on data rate and disk space utilization with necessary diagram and illustration.

File system using a linked list

In linked-list allocation each file is a chain of disk blocks. One word of each block holds a pointer (the number of the next block); the rest is data. The directory entry stores the file name and the address of the first block.

 dir: A -> 4
 block 4 : [data..|-> 7]
 block 7 : [data..|-> 2]
 block 2 : [data..|-> end]
  • Any free block can be used, so there is no external fragmentation.
  • Sequential reading is easy; the file can grow by taking any free block.
  • Random access is slow (to reach block n read n blocks) and a block's data size becomes (block size - pointer size).
  • Variation: a FAT keeps all next-pointers in a table in memory, which fixes random access speed.

Impact of block size

Block (cluster) size is a trade-off between data rate and space utilization.

  • Data rate: time to read a block = seek + rotational delay + transfer time. Seek and rotation are fixed per access, so large blocks give a higher data rate.
  • Disk space utilization: most files are small. If the block is larger than the file, space is wasted in the last block (internal fragmentation).

Illustration (Tanenbaum): average seek 5 ms, rotational delay 4.17 ms, transfer rate 100 MB/s, median file size 2 KB:

Block sizeAccess timeData rateSpace utilization
1 KB9.18 ms109 KB/s100%
2 KB9.19 ms218 KB/s100%
4 KB9.21 ms434 KB/s50%
16 KB9.33 ms1.7 MB/s12.5%
64 KB9.83 ms6.5 MB/s3.1%
 data rate   ^            .---- rises with block size
             |        .-'
             |    .-'
             | .-'
 utilization |'-._
             |    '-._.__ falls with block size
             +----------------> block size

So a small block wastes less space but gives poor speed, and a large block is fast but wastes space. A compromise of 4 KB (or 2 to 8 KB) is common.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Operating System chapter 5 questions →