Disclaimer: This is a user generated content submitted by a member of TheOmniBuzz. The views and writings here reflect that of the author and not of TheOmniBuzz. If you have any complaints regarding this post kindly report it to us.
Education

File Allocation in OS

Allocation Method

Each file allocation method has its advantages and disadvantages. Mainly a system uses one method for all files within the system.

  • Contiguous allocation
  • Linked allocation
  • Indexed allocation

The main idea behind contiguous allocation methods is to provide

  • Efficient disk space utilization
  • Fast access to the file blocks

Contiguous allocation

  • Each file in the disk occupies a contiguous address space on the disk.
  • In this scheme, the address is assigned in the linear fashion.
  • The is very easy to implement the contiguous allocation method.
  • In the contiguous allocation technique, external fragmentation is a major issue.

Advantages:

  1. In the contiguous allocation, sequential and direct access both are supported.
  2. For the direct access, the starting address of the kth block is given and further blocks are obtained by b+K,
  3. This is very fast and the number of seeks is minimal in the contiguous allocation method.

Disadvantages:

  1. Contiguous allocation method suffers internal as well as external fragmentation.
  2. In terms of memory utilization, this method is inefficient.
  3. It is difficult to increase the file size because it depends on the availability of contiguous memory.

Linked allocation

Advantages:

  1. In terms of the file size, this scheme is very flexible.
  2. We can easily increase or decrease the file size and system does not worry about the contiguous chunks of memory.
  3. This method free from external fragmentation this makes it better in terms of memory utilization.

Disadvantages:

  1. In this scheme, there is large no of seeks because the file blocks are randomly distributed on disk.
  2. Linked allocation is comparatively slower than contiguous allocation.
  3. Random or direct access is not supported by this scheme we cannot access the blocks directly.
  4. The pointer is extra overhead on the system due to the linked list.

Indexed Allocation

Advantages:

  1. This scheme supports random access of the file.
  2. This scheme provides fast access to the file blocks.
  3. This scheme is free from the problem of external fragmentation.

Disadvantages:

  1. The pointer head is relatively greater than the linked allocation of the file.
  2. Indexed allocation suffers from the wasted space.
  3. For the large size file, it is very difficult for single index block to hold all the pointers.
  4. For very small files say files that expend only 2-3 blocks the indexed allocation would keep on the entire block for the pointers which is insufficient in terms of memory utilization.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Log In

Or with username:

Forgot password?

Don't have an account? Register

Forgot password?

Enter your account data and we will send you a link to reset your password.

Your password reset link appears to be invalid or expired.

Log in

Privacy Policy

Add to Collection

No Collections

Here you'll find all collections you've created before.