How can you manage free disk space? Explain the linked list approach of managing free disk space with example.

This answer is restricted. Please login to view the answer of this question.

Login Now

As the disk space is limited, we need to reuse the space from deleted files for new files, if possible. To keep track of free space, the system maintains a free space list. The free space list records all free disk blocks those not allocated to some file or directory. There are mainly two approaches by which the free blocks in the disk are managed.

  • Bitmap free space management
  • Linked List free space management

Linked List Free Space management:

It is another approach to free space management. This approach suggests linking together all the free blocks and keeping a pointer in the cache which points to the first free block.

Therefore, all the free blocks on the disks will be linked together with a pointer. Whenever a block gets allocated, its previous free block will be linked to its next free block.

Linked List Free Space Management

In this figure, the free space list head points to Block 5 which points to Block 6, the next free block, and so on. The last free block would contain a null pointer indicating the end of the free list.
A drawback of this method is the I/O required for free space list traversal.

If you found any type of error on the answer then please mention on the comment or report an answer or submit your new answer.
Leave your Answer:

Click here to submit your answer.

  Loading . . .