Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Disk allocation methods

Disk allocation

  • Be the first to comment

Disk allocation methods

  1. 1. DISK ALLOCATION METHODS Presented BY : Rollno:- 13-mc-2015 Teacher In-charge : Dr. Sanjay Jamwal
  2. 2. Disk Allocation : • Refers to how disk blocks are allocated for files. •Allocation methods are used for: oEffective disk space utilization. oAllows fast file access.
  3. 3. Allocation Methods: •Contiguous •Linked •indexed
  4. 4. Contiguous Allocation: In contiguous allocation, files are assigned to contiguous areas of secondary storage. A user specifies in advance the size of the area needed to hold a file to be created. If the desired amount of contiguous space is not available, the file cannot be created. • Starting block and length of the file • Two most common strategies are: First - fit  Best - fit
  5. 5. • First-fit:- In this case as soon as the first hole (that is big enough) is encountered, searching is stopped and memory is allocated for creating a file. Searching can start either at the beginning of the set of holes or where the previous first-fit search ended. • Best - fit - In this case the entire list is searched for and the smallest hole, that is big enough, is allocated for creating a file. • Neither first-fit nor best-fit is clearly best in terms of storage utilization, but first-fit is generally faster. • External fragmentation will occur
  6. 6. Fig :- Contiguous Allocation
  7. 7. Linked Allocation (Chained Allocation): •In linked list allocation each file is linked list of disk blocks. • These disk blocks may be scattered through the disk. • A few bytes of each disk block contains the address of the next block.  •A single entry in the file allocation table • Starting block and length of file •No external fragmentation •Best for sequential files
  8. 8. Linked Allocation
  9. 9. Indexed Allocation: •In this scheme each file is provided with its own index block, which is an array of disk block pointers (addresses). •The Kth entry in the index block points to the Kth disk block of the file. •The file allocation table contains block number for the index •Indexed allocation solves this problem by bringing all the pointers together into one location known as the index block. •Each file has its own index block, which is an array of disk-block addresses. The “i” entry in the index block points to the “i‘” block of the file
  10. 10. Indexed Allocation
  11. 11. • The advantage of indexed file allocation include the absence of external fragmentation and the efficiency of random accessing. • indexed allocation requires lots of space for keeping pointers.
  12. 12. THANKS

×