SlideShare a Scribd company logo
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)

Allocation methods (1).pptx
Allocation methods (1).pptxAllocation methods (1).pptx
Allocation methods (1).pptx
ssuser55cbdb
 
Allocation method - Operating System.pptx
Allocation method - Operating System.pptxAllocation method - Operating System.pptx
Allocation method - Operating System.pptx
Indhu Periys
 
File Allocation Methods.ppt
File Allocation Methods.pptFile Allocation Methods.ppt
File Allocation Methods.ppt
BharathiLakshmiAAssi
 
File Concept.pptx fa s fasfasfasfsfsfasfasfas
File Concept.pptx fa s fasfasfasfsfsfasfasfasFile Concept.pptx fa s fasfasfasfsfsfasfasfas
File Concept.pptx fa s fasfasfasfsfsfasfasfas
YuvarajY5
 
Allocation and free space management
Allocation and free space managementAllocation and free space management
Allocation and free space management
rajshreemuthiah
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1
rohassanie
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
Abhishek Pachisia
 
Ch12_OS_Lecture 5.pdf
Ch12_OS_Lecture 5.pdfCh12_OS_Lecture 5.pdf
Ch12_OS_Lecture 5.pdf
AllinOne746595
 
Secondary Storage Management
Secondary Storage ManagementSecondary Storage Management
Secondary Storage Management
PriyanshuGandhi3
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
myrajendra
 
File sharing
File sharingFile sharing
File sharing
janani thirupathi
 
Filesharing 180214044607
Filesharing 180214044607Filesharing 180214044607
Filesharing 180214044607
kirupasuchi1996
 
Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...
NoorMustafaSoomro
 
File implementation
File implementationFile implementation
File implementation
Mohd Arif
 
Files
FilesFiles
Files
kirtidhamija16
 
Files Allocation.ppt
Files Allocation.pptFiles Allocation.ppt
Files Allocation.ppt
Chinmaya M. N
 
SSM
SSMSSM
SSM
Ramasubbu .P
 
oslectureset7.pdf
oslectureset7.pdfoslectureset7.pdf
oslectureset7.pdf
WaltonJrSmithTZ
 
Dude.pptx
Dude.pptxDude.pptx
Dude.pptx
DushyantChauhan40
 
8 File Management system project .pptx
8 File Management system project   .pptx8 File Management system project   .pptx
8 File Management system project .pptx
anitabricks49
 
Allocation methods (1).pptx
Allocation methods (1).pptxAllocation methods (1).pptx
Allocation methods (1).pptx
ssuser55cbdb
 
Allocation method - Operating System.pptx
Allocation method - Operating System.pptxAllocation method - Operating System.pptx
Allocation method - Operating System.pptx
Indhu Periys
 
File Concept.pptx fa s fasfasfasfsfsfasfasfas
File Concept.pptx fa s fasfasfasfsfsfasfasfasFile Concept.pptx fa s fasfasfasfsfsfasfasfas
File Concept.pptx fa s fasfasfasfsfsfasfasfas
YuvarajY5
 
Allocation and free space management
Allocation and free space managementAllocation and free space management
Allocation and free space management
rajshreemuthiah
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1
rohassanie
 
Secondary Storage Management
Secondary Storage ManagementSecondary Storage Management
Secondary Storage Management
PriyanshuGandhi3
 
Allocation methods continuous method.47
Allocation methods continuous method.47 Allocation methods continuous method.47
Allocation methods continuous method.47
myrajendra
 
Filesharing 180214044607
Filesharing 180214044607Filesharing 180214044607
Filesharing 180214044607
kirupasuchi1996
 
Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...Report blocking ,management of files in secondry memory , static vs dynamic a...
Report blocking ,management of files in secondry memory , static vs dynamic a...
NoorMustafaSoomro
 
File implementation
File implementationFile implementation
File implementation
Mohd Arif
 
Files Allocation.ppt
Files Allocation.pptFiles Allocation.ppt
Files Allocation.ppt
Chinmaya M. N
 
8 File Management system project .pptx
8 File Management system project   .pptx8 File Management system project   .pptx
8 File Management system project .pptx
anitabricks49
 

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 5-25-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-25-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-25-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-25-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdfUnit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
ChatanBawankar
 
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
ChatanBawankar
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
How to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo SlidesHow to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo Slides
Celine George
 
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
ChatanBawankar
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Sandeep Swamy
 
Drug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptxDrug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptx
pharmaworld
 
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted RegressionKNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
Global Academy of Technology
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Optical and non optical devices used in low vision
Optical and non optical devices used in low visionOptical and non optical devices used in low vision
Optical and non optical devices used in low vision
Aligarh Muslim University, Aligarh, Uttar Pradesh, India
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
Regression Analysis-Machine Learning -Different Types
Regression Analysis-Machine Learning -Different TypesRegression Analysis-Machine Learning -Different Types
Regression Analysis-Machine Learning -Different Types
Global Academy of Technology
 
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
 
Unit 4 Reverse Engineering Tools Functionalities & Use-Cases.pdf
Unit 4  Reverse Engineering Tools  Functionalities & Use-Cases.pdfUnit 4  Reverse Engineering Tools  Functionalities & Use-Cases.pdf
Unit 4 Reverse Engineering Tools Functionalities & Use-Cases.pdf
ChatanBawankar
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTUREEVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
BipulBorthakur
 
[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details
[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details
[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details
Jenny408767
 
The Ellipsis Manual Analysis And Engineering Of Human Behavior Chase Hughes
The Ellipsis Manual Analysis And Engineering Of Human Behavior Chase HughesThe Ellipsis Manual Analysis And Engineering Of Human Behavior Chase Hughes
The Ellipsis Manual Analysis And Engineering Of Human Behavior Chase Hughes
pekokmupei
 
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdfUnit 2 DNS Spoofing in a BadUSB Attack.pdf
Unit 2 DNS Spoofing in a BadUSB Attack.pdf
ChatanBawankar
 
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
Unit Kali NetHunter is the official Kali Linux penetration testing platform f...
ChatanBawankar
 
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
 
How to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo SlidesHow to Use Owl Slots in Odoo 17 - Odoo Slides
How to Use Owl Slots in Odoo 17 - Odoo Slides
Celine George
 
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
Unit 1 Kali NetHunter is the official Kali Linux penetration testing platform...
ChatanBawankar
 
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANASTUDENT LOAN TRUST FUND DEFAULTERS GHANA
STUDENT LOAN TRUST FUND DEFAULTERS GHANA
Kweku Zurek
 
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Understanding-the-Weather.pdf/7th class/social/ 2nd chapter/Samyans Academy n...
Sandeep Swamy
 
Drug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptxDrug Metabolism advanced medicinal chemistry.pptx
Drug Metabolism advanced medicinal chemistry.pptx
pharmaworld
 
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted RegressionKNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
KNN,Weighted KNN,Nearest Centroid Classifier,Locally Weighted Regression
Global Academy of Technology
 
Odoo 18 Point of Sale PWA - Odoo Slides
Odoo 18 Point of Sale PWA  - Odoo  SlidesOdoo 18 Point of Sale PWA  - Odoo  Slides
Odoo 18 Point of Sale PWA - Odoo Slides
Celine George
 
Multicultural approach in education - B.Ed
Multicultural approach in education - B.EdMulticultural approach in education - B.Ed
Multicultural approach in education - B.Ed
prathimagowda443
 
Regression Analysis-Machine Learning -Different Types
Regression Analysis-Machine Learning -Different TypesRegression Analysis-Machine Learning -Different Types
Regression Analysis-Machine Learning -Different Types
Global Academy of Technology
 
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
 
Unit 4 Reverse Engineering Tools Functionalities & Use-Cases.pdf
Unit 4  Reverse Engineering Tools  Functionalities & Use-Cases.pdfUnit 4  Reverse Engineering Tools  Functionalities & Use-Cases.pdf
Unit 4 Reverse Engineering Tools Functionalities & Use-Cases.pdf
ChatanBawankar
 
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
 
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTUREEVALUATION AND MANAGEMENT OF OPEN FRACTURE
EVALUATION AND MANAGEMENT OF OPEN FRACTURE
BipulBorthakur
 
[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details
[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details
[2025] Qualtric XM-EX-EXPERT Study Plan | Practice Questions + Exam Details
Jenny408767
 
The Ellipsis Manual Analysis And Engineering Of Human Behavior Chase Hughes
The Ellipsis Manual Analysis And Engineering Of Human Behavior Chase HughesThe Ellipsis Manual Analysis And Engineering Of Human Behavior Chase Hughes
The Ellipsis Manual Analysis And Engineering Of Human Behavior Chase Hughes
pekokmupei
 

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.