in Operating System retagged by
1,054 views
1 vote
1 vote

If file size is large and if it is to be accessed randomly then which of the following allocation strategy should be best to use in a system?

  1. Linked allocation
  2. Indexed allocation
  3. Contiguous allocation
  4. None of the options
in Operating System retagged by
1.1k views

1 comment

Linked allocation

Option A is correct
0
0

4 Answers

2 votes
2 votes

Option A

Contiguous:All blocks of a file are stored contiguously.
Advantages:

  • Faster access as all blocks are nearby.
  • Suitable for small sequentially accessed file

Disadvantages:

  • Poor performance if file grows or shrinks.
  • This method suffers from both internal and external fragmentation. This makes it inefficient in terms of memory utilization.
  • Increasing file size is difficult because it depends on the availability of contiguous memory at a particular instance.

 

Linked Allocation:Each block stores pointer to next block
Advantages:

  • No fragmentation
  • Suitable for large sequentially accessed file

Disadvantages:

  • Because the file blocks are distributed randomly on the disk, a large number of seeks are needed to access every block individually. This makes linked allocation slower.
  • Random access is not possible, If one link is lost, cannot access subsequent blocks.
  • Pointers required in the linked allocation incur some extra overhead.

 

Indexed Allocation:A single bock stores indexes of all blocks of a file.
Advantage:

  • Suitable for large randomly accessed file
  • It overcomes the problem of external fragmentation.

Disadvantages:

  • The pointer overhead for indexed allocation is greater than linked allocation.
  • For very small files, say files that expand only 2-3 blocks, the indexed allocation would keep one entire block (index block) for the pointers which is inefficient in terms of memory utilization. However, in linked allocation we lose the space of only 1 pointer per block.

 

https://www.tutorialspoint.com/operating_system/os_file_system.htm

https://www.geeksforgeeks.org/file-allocation-methods/

2 Comments

Then why you chose A?
0
0
I think he forgot which option was Indexed allocation.
0
0
1 vote
1 vote

Opton (B) Indexed allocation is correct

As the file size is large, we cannot use Contiguous allocation, we also need random access and therefore Linked allocation is also not suitable. 

by
0 votes
0 votes

I think Option B is Correct

Because in Linked List we can not Accss a file Randomly We Access only Linerly In Linked List.

 

0 votes
0 votes
Ans : A : linked list
by
Answer:

Related questions