SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
ALLOCATION METHODS
BY:M.SUMANASREE
MSCCOMPUTERSCIENCE1st
YEAR
File Allocation Methods
•The allocation methods define how the files are stored in the disk blocks. There
are three main disk space or file allocation methods
•.Contiguous Allocation
•Linked Allocation
•Indexed Allocation
•The main idea behind these methods is to provide:
•Efficient disk space utilization.
•Fast access to the file blocks.
1. Contiguous Allocation
•In this scheme, each file occupies a contiguous set of blocks on the disk. For
example, if a file requires n blocks and is given a block b as the starting
location, then the blocks assigned to the file will be:b, b+1, b+2,……b+n-1.This
means that given the starting block address and the length of the file (in terms
of blocks required), we can determine the blocks occupied by the file. The
directory entry for a file with contiguous allocation contains
•Address of starting block
•Length of the allocated portion.
Thefile ‘mail’in the following figure starts from the block 19 with length = 6
blocks. Therefore, it occupies19, 20, 21, 22, 23, 24blocks.
Advantages:
•Both the Sequential and Direct Accesses are supported by this. For direct
access, the address of the kth block of the file which starts at block b can
easily be obtained as (b+k).
•This is extremely fast since the number of seeks are minimal because of
contiguous allocation of file blocks.
•Disadvantages:
•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.
2. Linked List Allocation
In this scheme, each file is a linked list of disk blocks
whichneed not becontiguous. The disk blocks can be
scattered anywhere on the disk. The directory entry
contains a pointer to the starting and the ending file
block. Each block contains a pointer to the next block
occupied by the file.The file ‘jeep’ in following image
shows how the blocks are randomly distributed. The last
block (25) contains -1 indicating a null pointer and does
not point to any other block.
Advantages:
• This is very flexible in terms of file size. File size can be increased easily since the
system does not have to look for a contiguous chunk of memory.
• This method does not suffer from external fragmentation. This makes it relatively
better in terms of memory utilization.
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.
• It does not support random or direct access. We can not directly access the blocks of
a file. A block k of a file can be accessed by traversing k blocks sequentially (sequential
access ) from the starting block of the file via block pointers.
• Pointers required in the linked allocation incur some extra overhead.
3. Indexed Allocation
In this scheme, a special block known as
theIndex blockcontains the pointers to
all the blocks occupied by a file. Each file
has its own index block. The ith entry in
the index block contains the disk address
of the ith file block. The directory entry
contains the address of the index block
as shown in the image:
Advantages :
•This supports direct access to the blocks occupied by the file and therefore provides
fast access to the file blocks.
•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.
File Allocation methods in Operating Systems

More Related Content

Similar to File Allocation methods in Operating Systems (20)

PPTX
Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
likhithmuthyalu2
 
PPTX
8 File Management system project .pptx
anitabricks49
 
PPTX
Allocation and free space management
rajshreemuthiah
 
PPTX
Chapter 3
Cahaya Penyayang
 
PDF
fileallocationmethods1-220104151603.pdf
AbhishekBhassia
 
PPTX
File allocation methods (1)
Dr. Jasmine Beulah Gnanadurai
 
PPTX
Directory implementation and allocation methods
sangrampatil81
 
PDF
File system in operating system e learning
Lavanya Sharma
 
PPTX
Allocation methods (1).pptx
ssuser55cbdb
 
PPTX
File Concept.pptx fa s fasfasfasfsfsfasfasfas
YuvarajY5
 
PPTX
File System Implementation
Abhishek Pachisia
 
PDF
File implementation
Mohd Arif
 
PPTX
OS Unit5.pptx
DHANABALSUBRAMANIAN
 
PPTX
Ext filesystem4
Neha Kulkarni
 
PPTX
Kernel Memory Allocation, Review of Relocation & Program Forms
Meghaj Mallick
 
PPT
Allocation methods continuous method.47
myrajendra
 
PPT
Linked allocation 48
myrajendra
 
PPTX
Report blocking ,management of files in secondry memory , static vs dynamic a...
NoorMustafaSoomro
 
PPT
chapter5-file system implementation.ppt
BUSHRASHAIKH804312
 
PPTX
File sharing
janani thirupathi
 
Unit 5.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
likhithmuthyalu2
 
8 File Management system project .pptx
anitabricks49
 
Allocation and free space management
rajshreemuthiah
 
Chapter 3
Cahaya Penyayang
 
fileallocationmethods1-220104151603.pdf
AbhishekBhassia
 
File allocation methods (1)
Dr. Jasmine Beulah Gnanadurai
 
Directory implementation and allocation methods
sangrampatil81
 
File system in operating system e learning
Lavanya Sharma
 
Allocation methods (1).pptx
ssuser55cbdb
 
File Concept.pptx fa s fasfasfasfsfsfasfasfas
YuvarajY5
 
File System Implementation
Abhishek Pachisia
 
File implementation
Mohd Arif
 
OS Unit5.pptx
DHANABALSUBRAMANIAN
 
Ext filesystem4
Neha Kulkarni
 
Kernel Memory Allocation, Review of Relocation & Program Forms
Meghaj Mallick
 
Allocation methods continuous method.47
myrajendra
 
Linked allocation 48
myrajendra
 
Report blocking ,management of files in secondry memory , static vs dynamic a...
NoorMustafaSoomro
 
chapter5-file system implementation.ppt
BUSHRASHAIKH804312
 
File sharing
janani thirupathi
 

Recently uploaded (20)

PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PPTX
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PPTX
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PPTX
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PPTX
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
SPINA BIFIDA: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
Soil and agriculture microbiology .pptx
Keerthana Ramesh
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
ASRB NET 2023 PREVIOUS YEAR QUESTION PAPER GENETICS AND PLANT BREEDING BY SAT...
Krashi Coaching
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
community health nursing question paper 2.pdf
Prince kumar
 
Dimensions of Societal Planning in Commonism
StefanMz
 
grade 5 lesson ENGLISH 5_Q1_PPT_WEEK3.pptx
SireQuinn
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Ad

File Allocation methods in Operating Systems

  • 2. File Allocation Methods •The allocation methods define how the files are stored in the disk blocks. There are three main disk space or file allocation methods •.Contiguous Allocation •Linked Allocation •Indexed Allocation •The main idea behind these methods is to provide: •Efficient disk space utilization. •Fast access to the file blocks.
  • 3. 1. Contiguous Allocation •In this scheme, each file occupies a contiguous set of blocks on the disk. For example, if a file requires n blocks and is given a block b as the starting location, then the blocks assigned to the file will be:b, b+1, b+2,……b+n-1.This means that given the starting block address and the length of the file (in terms of blocks required), we can determine the blocks occupied by the file. The directory entry for a file with contiguous allocation contains •Address of starting block •Length of the allocated portion.
  • 4. Thefile ‘mail’in the following figure starts from the block 19 with length = 6 blocks. Therefore, it occupies19, 20, 21, 22, 23, 24blocks.
  • 5. Advantages: •Both the Sequential and Direct Accesses are supported by this. For direct access, the address of the kth block of the file which starts at block b can easily be obtained as (b+k). •This is extremely fast since the number of seeks are minimal because of contiguous allocation of file blocks. •Disadvantages: •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.
  • 6. 2. Linked List Allocation In this scheme, each file is a linked list of disk blocks whichneed not becontiguous. The disk blocks can be scattered anywhere on the disk. The directory entry contains a pointer to the starting and the ending file block. Each block contains a pointer to the next block occupied by the file.The file ‘jeep’ in following image shows how the blocks are randomly distributed. The last block (25) contains -1 indicating a null pointer and does not point to any other block.
  • 7. Advantages: • This is very flexible in terms of file size. File size can be increased easily since the system does not have to look for a contiguous chunk of memory. • This method does not suffer from external fragmentation. This makes it relatively better in terms of memory utilization. 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. • It does not support random or direct access. We can not directly access the blocks of a file. A block k of a file can be accessed by traversing k blocks sequentially (sequential access ) from the starting block of the file via block pointers. • Pointers required in the linked allocation incur some extra overhead.
  • 8. 3. Indexed Allocation In this scheme, a special block known as theIndex blockcontains the pointers to all the blocks occupied by a file. Each file has its own index block. The ith entry in the index block contains the disk address of the ith file block. The directory entry contains the address of the index block as shown in the image:
  • 9. Advantages : •This supports direct access to the blocks occupied by the file and therefore provides fast access to the file blocks. •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.