Successfully reported this slideshow.
DISK ALLOCATION METHODS
Presented BY :
Teacher In-charge :
Dr. Sanjay Jamwal
Disk Allocation :
• Refers to how disk blocks are allocated for ﬁles.
•Allocation methods are used for:
oEffective disk space utilization.
oAllows fast ﬁle access.
In contiguous allocation, ﬁles are assigned to contiguous areas of secondary storage.
A user speciﬁes in advance the size of the area needed to hold a ﬁle to be created. If
the desired amount of contiguous space is not available, the ﬁle cannot be created.
• Starting block and length of the ﬁle
• Two most common strategies are:
First - ﬁt
Best - ﬁt
• First-ﬁt:- In this case as soon as the ﬁrst hole (that is big enough) is encountered,
searching is stopped and memory is allocated for creating a ﬁle. Searching can
start either at the beginning of the set of holes or where the previous ﬁrst-ﬁt search
• Best - ﬁt - In this case the entire list is searched for and the smallest hole, that is big
enough, is allocated for creating a ﬁle.
• Neither ﬁrst-ﬁt nor best-ﬁt is clearly best in terms of storage utilization, but ﬁrst-ﬁt is
• External fragmentation will occur
Fig :- Contiguous Allocation
Linked Allocation (Chained Allocation):
•In linked list allocation each ﬁle 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 ﬁle allocation table
• Starting block and length of ﬁle
•No external fragmentation
•Best for sequential ﬁles
•In this scheme each ﬁle 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 ﬁle.
•The ﬁle 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 ﬁle 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 ﬁle
• The advantage of indexed ﬁle allocation include
the absence of external fragmentation and the
efﬁciency of random accessing.
• indexed allocation requires lots of space for