SlideShare a Scribd company logo
File Allocation Methods
Dr.G.Jasmine Beulah
Kristu Jayanti College, Bengaluru
File Allocation Method
• 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
Contiguous Allocation
• The directory entry for a file with contiguous allocation contains
Address of starting block
Length of the allocated portion.
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.
Linked List Allocation
• Each file is a linked list of disk blocks which need not
be contiguous. 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.
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
Indexed Allocation
• A special block known as the Index block contains 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.
Disk Scheduling Algorithms
• Disk scheduling is done by operating systems to schedule I/O
requests arriving for the disk. Disk scheduling is also known as
I/O scheduling.
• Multiple I/O requests may arrive by different processes and only
one I/O request can be served at a time by the disk controller.
Thus other I/O requests need to wait in the waiting queue and
need to be scheduled.
• Two or more request may be far from each other so can result
in greater disk arm movement.
• Hard drives are one of the slowest parts of the computer system
and thus need to be accessed in an efficient manner.
• Seek Time:Seek time is the time taken to locate the disk arm to
a specified track where the data is to be read or write. So the
disk scheduling algorithm that gives minimum average seek
time is better.
• Rotational Latency: Rotational Latency is the time taken by
the desired sector of disk to rotate into a position so that it can
access the read/write heads. So the disk scheduling algorithm
that gives minimum rotational latency is better.
• Transfer Time: Transfer time is the time to transfer the data. It
depends on the rotating speed of the disk and number of bytes
to be transferred.
• Disk Response Time
•Disk Access Time
Disk Scheduling Algorithms - FCFS
In FCFS, the requests are addressed in the order they arrive in
the disk queue.
• Suppose the order of request is- (82,170,43,140,24,16,190)
And current position of Read/Write head is : 50
SSTF: Shortest Seek Time First
• In SSTF (Shortest Seek Time First), requests having shortest
seek time are executed first.
• So, the seek time of every request is calculated in advance in
the queue and then they are scheduled according to their
calculated seek time.
• As a result, the request near the disk arm will get executed first.
SSTF is certainly an improvement over FCFS as it decreases
the average response time and increases the throughput of
system.
Suppose the order of request is-
(82,170,43,140,24,16,190)
And current position of Read/Write head is :
50
So, total seek time:
=(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170-
40)+(190-170)
=208
SCAN:
• In SCAN algorithm the disk arm moves into a particular
direction and services the requests coming in its path and after
reaching the end of disk, it reverses its direction and again
services the request arriving in its path. So, this algorithm works
as an elevator and hence also known as elevator algorithm.
• As a result, the requests at the midrange are serviced more and
those arriving behind the disk arm will have to wait.
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And
the Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.
Therefore, the seek time is calculated as:
=(199-50)+(199-16)
=332
Advantages:
•High throughput
•Low variance of response time
•Average response time
Disadvantages:
•Long waiting time for requests for
locations just visited by disk arm
CSCAN
• The disk arm instead of reversing its direction goes to the other
end of the disk and starts servicing the requests from there.
• So, the disk arm moves in a circular fashion and this algorithm
is also similar to SCAN algorithm and hence it is known as C-
SCAN (Circular SCAN).
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And
the Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.
Seek time is calculated as:
=(199-50)+(199-0)+(43-0)
=391
Advantages:
•Provides more uniform wait time
compared to SCAN
LOOK:
• It is similar to the SCAN disk scheduling algorithm except for
the difference that the disk arm in spite of going to the end of
the disk goes only to the last request to be serviced in front of
the head and then reverses its direction from there only.
• Thus it prevents the extra delay which occurred due to
unnecessary traversal to the end of the disk.
Suppose the requests to be addressed are-82,170,43,140,24,16,190. And
the Read/Write arm is at 50, and it is also given that the disk arm should
move “towards the larger value”.
So, the seek time is calculated as:
=(190-50)+(190-16)
=314

More Related Content

What's hot

Demand paging
Demand pagingDemand paging
Demand paging
SwaroopSorte
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
Venkata Sreeram
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
Piyush Rochwani
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage Structure
Vimalanathan D
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
Wayne Jones Jnr
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
Ritu Ranjan Shrivastwa
 
Fragmentaton
Fragmentaton Fragmentaton
Fragmentaton
sanjana mun
 
File system structure
File system structureFile system structure
File system structure
sangrampatil81
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
rprajat007
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
Sweetestangel Kochar
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
PreethiSureshkumar1
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
Anuj Modi
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
hamza haseeb
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
Dhaval Sakhiya
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
usmankiyani1
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
Mazin Alwaaly
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
vampugani
 
Deadlock
DeadlockDeadlock
Deadlock
Rajandeep Gill
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
prachi mewara
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
InteX Research Lab
 

What's hot (20)

Demand paging
Demand pagingDemand paging
Demand paging
 
DeadLock in Operating-Systems
DeadLock in Operating-SystemsDeadLock in Operating-Systems
DeadLock in Operating-Systems
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage Structure
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Fragmentaton
Fragmentaton Fragmentaton
Fragmentaton
 
File system structure
File system structureFile system structure
File system structure
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
Deadlock ppt
Deadlock ppt Deadlock ppt
Deadlock ppt
 
Microprogrammed Control Unit
Microprogrammed Control UnitMicroprogrammed Control Unit
Microprogrammed Control Unit
 
Virtual memory
Virtual memoryVirtual memory
Virtual memory
 
Operating system paging and segmentation
Operating system paging and segmentationOperating system paging and segmentation
Operating system paging and segmentation
 
SCHEDULING ALGORITHMS
SCHEDULING ALGORITHMSSCHEDULING ALGORITHMS
SCHEDULING ALGORITHMS
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Computer architecture virtual memory
Computer architecture virtual memoryComputer architecture virtual memory
Computer architecture virtual memory
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Deadlock
DeadlockDeadlock
Deadlock
 
Deadlock Prevention
Deadlock PreventionDeadlock Prevention
Deadlock Prevention
 
Instruction pipeline: Computer Architecture
Instruction pipeline: Computer ArchitectureInstruction pipeline: Computer Architecture
Instruction pipeline: Computer Architecture
 

Similar to File allocation methods (1)

OS Unit5.pptx
OS Unit5.pptxOS Unit5.pptx
OS Unit5.pptx
DHANABALSUBRAMANIAN
 
Ch9 mass storage systems
Ch9   mass storage systemsCh9   mass storage systems
Ch9 mass storage systems
Welly Dian Astika
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
ChethanaThammaiah
 
Secondary storage devices
Secondary storage devices Secondary storage devices
Secondary storage devices
Slideshare
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systems
night1ng4ale
 
disk sechduling
disk sechdulingdisk sechduling
disk sechduling
gopi7
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
Agnas Jasmine
 
Unit6pdf__2024_03_ 27_08_31_05.pdf
Unit6pdf__2024_03_          27_08_31_05.pdfUnit6pdf__2024_03_          27_08_31_05.pdf
Unit6pdf__2024_03_ 27_08_31_05.pdf
tejpatel0010
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
Geetha Kannan
 
Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer Management
AnshGoyal32
 
OS@PPT.pdf
OS@PPT.pdfOS@PPT.pdf
OS@PPT.pdf
Niru82
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
A29ShirleyDhawadkar
 
Allocation and free space management
Allocation and free space managementAllocation and free space management
Allocation and free space management
rajshreemuthiah
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
Rohit Jain
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
Dr. Loganathan R
 
Ch10
Ch10Ch10
Ch10
ushaindhu
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
NEERAJ BAGHEL
 
Kavi
KaviKavi
Kavi
KaviKavi

Similar to File allocation methods (1) (20)

OS Unit5.pptx
OS Unit5.pptxOS Unit5.pptx
OS Unit5.pptx
 
Ch9 mass storage systems
Ch9   mass storage systemsCh9   mass storage systems
Ch9 mass storage systems
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Module5 secondary storage
Module5 secondary storageModule5 secondary storage
Module5 secondary storage
 
Secondary storage devices
Secondary storage devices Secondary storage devices
Secondary storage devices
 
Mass storage systems presentation operating systems
Mass storage systems presentation operating systemsMass storage systems presentation operating systems
Mass storage systems presentation operating systems
 
disk sechduling
disk sechdulingdisk sechduling
disk sechduling
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Unit6pdf__2024_03_ 27_08_31_05.pdf
Unit6pdf__2024_03_          27_08_31_05.pdfUnit6pdf__2024_03_          27_08_31_05.pdf
Unit6pdf__2024_03_ 27_08_31_05.pdf
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Disk Management through the Computer Management
Disk Management through the Computer ManagementDisk Management through the Computer Management
Disk Management through the Computer Management
 
OS@PPT.pdf
OS@PPT.pdfOS@PPT.pdf
OS@PPT.pdf
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
Allocation and free space management
Allocation and free space managementAllocation and free space management
Allocation and free space management
 
File system and Deadlocks
File system and DeadlocksFile system and Deadlocks
File system and Deadlocks
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Ch10
Ch10Ch10
Ch10
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Kavi
KaviKavi
Kavi
 
Kavi
KaviKavi
Kavi
 

More from Dr. Jasmine Beulah Gnanadurai

Data Warehouse_Architecture.pptx
Data Warehouse_Architecture.pptxData Warehouse_Architecture.pptx
Data Warehouse_Architecture.pptx
Dr. Jasmine Beulah Gnanadurai
 
DMQL(Data Mining Query Language).pptx
DMQL(Data Mining Query Language).pptxDMQL(Data Mining Query Language).pptx
DMQL(Data Mining Query Language).pptx
Dr. Jasmine Beulah Gnanadurai
 
Stacks.pptx
Stacks.pptxStacks.pptx
Quick Sort.pptx
Quick Sort.pptxQuick Sort.pptx
KBS Architecture.pptx
KBS Architecture.pptxKBS Architecture.pptx
KBS Architecture.pptx
Dr. Jasmine Beulah Gnanadurai
 
Knowledge Representation in AI.pptx
Knowledge Representation in AI.pptxKnowledge Representation in AI.pptx
Knowledge Representation in AI.pptx
Dr. Jasmine Beulah Gnanadurai
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
Dr. Jasmine Beulah Gnanadurai
 
Mem mgt
Mem mgtMem mgt
Decision tree
Decision treeDecision tree
Association rules apriori algorithm
Association rules   apriori algorithmAssociation rules   apriori algorithm
Association rules apriori algorithm
Dr. Jasmine Beulah Gnanadurai
 
Big data architecture
Big data architectureBig data architecture
Big data architecture
Dr. Jasmine Beulah Gnanadurai
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
Dr. Jasmine Beulah Gnanadurai
 
Aritificial intelligence
Aritificial intelligenceAritificial intelligence
Aritificial intelligence
Dr. Jasmine Beulah Gnanadurai
 
Java threads
Java threadsJava threads
Java Applets
Java AppletsJava Applets
Stacks and Queue - Data Structures
Stacks and Queue - Data StructuresStacks and Queue - Data Structures
Stacks and Queue - Data Structures
Dr. Jasmine Beulah Gnanadurai
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript Functions
Dr. Jasmine Beulah Gnanadurai
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
Dr. Jasmine Beulah Gnanadurai
 
Css Text Formatting
Css Text FormattingCss Text Formatting
Css Text Formatting
Dr. Jasmine Beulah Gnanadurai
 
CSS - Cascading Style Sheet
CSS - Cascading Style SheetCSS - Cascading Style Sheet
CSS - Cascading Style Sheet
Dr. Jasmine Beulah Gnanadurai
 

More from Dr. Jasmine Beulah Gnanadurai (20)

Data Warehouse_Architecture.pptx
Data Warehouse_Architecture.pptxData Warehouse_Architecture.pptx
Data Warehouse_Architecture.pptx
 
DMQL(Data Mining Query Language).pptx
DMQL(Data Mining Query Language).pptxDMQL(Data Mining Query Language).pptx
DMQL(Data Mining Query Language).pptx
 
Stacks.pptx
Stacks.pptxStacks.pptx
Stacks.pptx
 
Quick Sort.pptx
Quick Sort.pptxQuick Sort.pptx
Quick Sort.pptx
 
KBS Architecture.pptx
KBS Architecture.pptxKBS Architecture.pptx
KBS Architecture.pptx
 
Knowledge Representation in AI.pptx
Knowledge Representation in AI.pptxKnowledge Representation in AI.pptx
Knowledge Representation in AI.pptx
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
 
Mem mgt
Mem mgtMem mgt
Mem mgt
 
Decision tree
Decision treeDecision tree
Decision tree
 
Association rules apriori algorithm
Association rules   apriori algorithmAssociation rules   apriori algorithm
Association rules apriori algorithm
 
Big data architecture
Big data architectureBig data architecture
Big data architecture
 
Knowledge representation
Knowledge representationKnowledge representation
Knowledge representation
 
Aritificial intelligence
Aritificial intelligenceAritificial intelligence
Aritificial intelligence
 
Java threads
Java threadsJava threads
Java threads
 
Java Applets
Java AppletsJava Applets
Java Applets
 
Stacks and Queue - Data Structures
Stacks and Queue - Data StructuresStacks and Queue - Data Structures
Stacks and Queue - Data Structures
 
JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript Functions
 
JavaScript Operators
JavaScript OperatorsJavaScript Operators
JavaScript Operators
 
Css Text Formatting
Css Text FormattingCss Text Formatting
Css Text Formatting
 
CSS - Cascading Style Sheet
CSS - Cascading Style SheetCSS - Cascading Style Sheet
CSS - Cascading Style Sheet
 

Recently uploaded

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
Celine George
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 

Recently uploaded (20)

Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 
How to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRMHow to Manage Your Lost Opportunities in Odoo 17 CRM
How to Manage Your Lost Opportunities in Odoo 17 CRM
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 

File allocation methods (1)

  • 1. File Allocation Methods Dr.G.Jasmine Beulah Kristu Jayanti College, Bengaluru
  • 2. File Allocation Method • 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
  • 3. Contiguous Allocation • The directory entry for a file with contiguous allocation contains Address of starting block Length of the allocated portion.
  • 4. 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.
  • 5. Linked List Allocation • Each file is a linked list of disk blocks which need not be contiguous. 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.
  • 6. 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
  • 7. Indexed Allocation • A special block known as the Index block contains 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:
  • 8. 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.
  • 9. Disk Scheduling Algorithms • Disk scheduling is done by operating systems to schedule I/O requests arriving for the disk. Disk scheduling is also known as I/O scheduling. • Multiple I/O requests may arrive by different processes and only one I/O request can be served at a time by the disk controller. Thus other I/O requests need to wait in the waiting queue and need to be scheduled. • Two or more request may be far from each other so can result in greater disk arm movement. • Hard drives are one of the slowest parts of the computer system and thus need to be accessed in an efficient manner.
  • 10. • Seek Time:Seek time is the time taken to locate the disk arm to a specified track where the data is to be read or write. So the disk scheduling algorithm that gives minimum average seek time is better. • Rotational Latency: Rotational Latency is the time taken by the desired sector of disk to rotate into a position so that it can access the read/write heads. So the disk scheduling algorithm that gives minimum rotational latency is better. • Transfer Time: Transfer time is the time to transfer the data. It depends on the rotating speed of the disk and number of bytes to be transferred.
  • 11. • Disk Response Time •Disk Access Time
  • 12. Disk Scheduling Algorithms - FCFS In FCFS, the requests are addressed in the order they arrive in the disk queue. • Suppose the order of request is- (82,170,43,140,24,16,190) And current position of Read/Write head is : 50
  • 13. SSTF: Shortest Seek Time First • In SSTF (Shortest Seek Time First), requests having shortest seek time are executed first. • So, the seek time of every request is calculated in advance in the queue and then they are scheduled according to their calculated seek time. • As a result, the request near the disk arm will get executed first. SSTF is certainly an improvement over FCFS as it decreases the average response time and increases the throughput of system.
  • 14. Suppose the order of request is- (82,170,43,140,24,16,190) And current position of Read/Write head is : 50 So, total seek time: =(50-43)+(43-24)+(24-16)+(82-16)+(140-82)+(170- 40)+(190-170) =208
  • 15. SCAN: • In SCAN algorithm the disk arm moves into a particular direction and services the requests coming in its path and after reaching the end of disk, it reverses its direction and again services the request arriving in its path. So, this algorithm works as an elevator and hence also known as elevator algorithm. • As a result, the requests at the midrange are serviced more and those arriving behind the disk arm will have to wait.
  • 16. Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the Read/Write arm is at 50, and it is also given that the disk arm should move “towards the larger value”. Therefore, the seek time is calculated as: =(199-50)+(199-16) =332 Advantages: •High throughput •Low variance of response time •Average response time Disadvantages: •Long waiting time for requests for locations just visited by disk arm
  • 17. CSCAN • The disk arm instead of reversing its direction goes to the other end of the disk and starts servicing the requests from there. • So, the disk arm moves in a circular fashion and this algorithm is also similar to SCAN algorithm and hence it is known as C- SCAN (Circular SCAN).
  • 18. Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the Read/Write arm is at 50, and it is also given that the disk arm should move “towards the larger value”. Seek time is calculated as: =(199-50)+(199-0)+(43-0) =391 Advantages: •Provides more uniform wait time compared to SCAN
  • 19. LOOK: • It is similar to the SCAN disk scheduling algorithm except for the difference that the disk arm in spite of going to the end of the disk goes only to the last request to be serviced in front of the head and then reverses its direction from there only. • Thus it prevents the extra delay which occurred due to unnecessary traversal to the end of the disk.
  • 20. Suppose the requests to be addressed are-82,170,43,140,24,16,190. And the Read/Write arm is at 50, and it is also given that the disk arm should move “towards the larger value”. So, the seek time is calculated as: =(190-50)+(190-16) =314