SlideShare una empresa de Scribd logo
1 de 6
1
FILE SYSTEM IMPLEMENTATION
FILE SYSTEM STRUCTURE:
When talking about “the file system”, you are making a statement about both the rules used
for file access, and about the algorithms used to implement those rules. Here’s a breakdown
of those algorithmic pieces.
Application Programs The code that's making a file request.
Logical File System This is the highest level in the OS; it does protection, and
security. Uses the directory structure to do name resolution.
File-organization Module Here we read the file control block maintained in the directory so
we know about files and the logical blocks where information
about that file is located.
Basic File System Knowing specific blocks to access, we can now make generic
requests to the appropriate device driver.
IO Control These are device drivers and interrupt handlers. They cause
the device to transfer information between that device and CPU
memory.
Devices The disks / tapes / etc.
2
a) Accessing the file requires a minimum of
head movement.
b) Easy to calculate block location: block i of
a file, starting at disk address b, is b + i.
c) Difficulty is in finding the contiguous
space, especially for a large file. Problem
is one of dynamic allocation (first fit, best
fit, etc.) which has external fragmentation.
If many files are created/deleted,
compaction will be necessary.
• It's hard to estimate at create time what the
size of the file will ultimately be. What
happens when we want to extend the file ---
we must either terminate the owner of the file,
or try to find a bigger hole.
CONTIGUOUS ALLOCATION
• Method: Lay down the entire file on contiguous sectors of the disk. Define by a
dyad <first block location, length >.
Allocation Methods
3
LINKED ALLOCATION
Each file is a linked list of disk blocks,
scattered anywhere on the disk.
At file creation time, simply tell the directory
about the file. When writing, get a free block
and write to it, enqueueing it to the file header.
There's no external fragmentation since each
request is for one block.
Method can only be effectively used for
sequential files.
Allocation Methods
4
LINKED ALLOCATION
Pointers use up space in each block.
Reliability is not high because any loss of a
pointer loses the rest of the file.
A File Allocation Table is a variation of this.
It uses a separate disk area to hold the
links.
This method doesn't use space in data
blocks. Many pointers may remain in
memory.
A FAT file system is used by MS-DOS.
Allocation Methods
5
INDEXED ALLOCATION
• Each file uses an index block on disk to contain
addresses of other disk blocks used by the file.
• When the i th block is written, the address of a
free block is placed at the i th position in the
index block.
• Method suffers from wasted space since, for
small files, most of the index block is wasted.
What is the optimum size of an index block?
• If the index block is too small, we can:
a) Link several together
b) Use a multilevel index
• UNIX keeps 12 pointers to blocks in its header. If
a file is longer than this, then it uses pointers to
single, double, and triple level index blocks.
Allocation Methods
6
PERFORMANCE ISSUES FOR THESE METHODS
It's difficult to compare mechanisms because usage is different. Let's calculate, for each
method, the number of disk accesses to read block i from a file:
contiguous: 1 access from location start + i.
linked: i + 1 accesses, reading each block in turn. (is this a fair example?)
index: 2 accesses, 1 for index, 1 for data.
Allocation Methods

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Free space managment46
Free space managment46Free space managment46
Free space managment46
 
Run time storage
Run time storageRun time storage
Run time storage
 
Deadlocks in operating system
Deadlocks in operating systemDeadlocks in operating system
Deadlocks in operating system
 
Deadlock
DeadlockDeadlock
Deadlock
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Paging and segmentation
Paging and segmentationPaging and segmentation
Paging and segmentation
 
Disk structure
Disk structureDisk structure
Disk structure
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
File organization
File organizationFile organization
File organization
 
Thrashing allocation frames.43
Thrashing allocation frames.43Thrashing allocation frames.43
Thrashing allocation frames.43
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Recovery Techniques and Need of Recovery
Recovery Techniques and   Need of RecoveryRecovery Techniques and   Need of Recovery
Recovery Techniques and Need of Recovery
 
17. Recovery System in DBMS
17. Recovery System in DBMS17. Recovery System in DBMS
17. Recovery System in DBMS
 
Ram and-rom-chips
Ram and-rom-chipsRam and-rom-chips
Ram and-rom-chips
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Instruction format
Instruction formatInstruction format
Instruction format
 
System calls
System callsSystem calls
System calls
 
File management
File managementFile management
File management
 

Similar a File Allocation Methods.ppt

Storage Mediums and Fragmentation
Storage Mediums and FragmentationStorage Mediums and Fragmentation
Storage Mediums and FragmentationJonathan Reid
 
Allocation method - Operating System.pptx
Allocation method - Operating System.pptxAllocation method - Operating System.pptx
Allocation method - Operating System.pptxIndhu Periys
 
File system in operating system e learning
File system in operating system e learningFile system in operating system e learning
File system in operating system e learningLavanya Sharma
 
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
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1rohassanie
 
Filesharing 180214044607
Filesharing 180214044607Filesharing 180214044607
Filesharing 180214044607kirupasuchi1996
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMSVrushaliSolanke
 
fileorganizationandintroductionofdbms-210313163900.pdf
fileorganizationandintroductionofdbms-210313163900.pdffileorganizationandintroductionofdbms-210313163900.pdf
fileorganizationandintroductionofdbms-210313163900.pdfFraolUmeta
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profitssusera432ea1
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.pptHelalMirzad
 
Directory implementation and allocation methods
Directory implementation and allocation methodsDirectory implementation and allocation methods
Directory implementation and allocation methodssangrampatil81
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementationWelly Dian Astika
 

Similar a File Allocation Methods.ppt (20)

Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Files
FilesFiles
Files
 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
 
Ch12_OS_Lecture 5.pdf
Ch12_OS_Lecture 5.pdfCh12_OS_Lecture 5.pdf
Ch12_OS_Lecture 5.pdf
 
Storage Mediums and Fragmentation
Storage Mediums and FragmentationStorage Mediums and Fragmentation
Storage Mediums and Fragmentation
 
Allocation method - Operating System.pptx
Allocation method - Operating System.pptxAllocation method - Operating System.pptx
Allocation method - Operating System.pptx
 
File system in operating system e learning
File system in operating system e learningFile system in operating system e learning
File system in operating system e learning
 
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...
 
Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1
 
File sharing
File sharingFile sharing
File sharing
 
Filesharing 180214044607
Filesharing 180214044607Filesharing 180214044607
Filesharing 180214044607
 
File organization and introduction of DBMS
File organization and introduction of DBMSFile organization and introduction of DBMS
File organization and introduction of DBMS
 
fileorganizationandintroductionofdbms-210313163900.pdf
fileorganizationandintroductionofdbms-210313163900.pdffileorganizationandintroductionofdbms-210313163900.pdf
fileorganizationandintroductionofdbms-210313163900.pdf
 
Poking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And ProfitPoking The Filesystem For Fun And Profit
Poking The Filesystem For Fun And Profit
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.ppt
 
Directory implementation and allocation methods
Directory implementation and allocation methodsDirectory implementation and allocation methods
Directory implementation and allocation methods
 
Ext filesystem4
Ext filesystem4Ext filesystem4
Ext filesystem4
 
Operating system
Operating systemOperating system
Operating system
 
File organisation
File organisationFile organisation
File organisation
 
Ch11 file system implementation
Ch11   file system implementationCh11   file system implementation
Ch11 file system implementation
 

Más de BharathiLakshmiAAssi (17)

VB.net&OOP.pptx
VB.net&OOP.pptxVB.net&OOP.pptx
VB.net&OOP.pptx
 
VB.netIDE.pptx
VB.netIDE.pptxVB.netIDE.pptx
VB.netIDE.pptx
 
VB.Net-Introduction.ppt
VB.Net-Introduction.pptVB.Net-Introduction.ppt
VB.Net-Introduction.ppt
 
Demand Paging.pptx
Demand Paging.pptxDemand Paging.pptx
Demand Paging.pptx
 
Virtual Memory.pptx
Virtual Memory.pptxVirtual Memory.pptx
Virtual Memory.pptx
 
Knowing about Computer SS.pptx
Knowing about Computer SS.pptxKnowing about Computer SS.pptx
Knowing about Computer SS.pptx
 
Parallel Computing--Webminar.ppsx
Parallel Computing--Webminar.ppsxParallel Computing--Webminar.ppsx
Parallel Computing--Webminar.ppsx
 
MAPEM.ppsx
MAPEM.ppsxMAPEM.ppsx
MAPEM.ppsx
 
Iterative Algorithms.ppsx
Iterative Algorithms.ppsxIterative Algorithms.ppsx
Iterative Algorithms.ppsx
 
Intensity Transformation.ppsx
Intensity Transformation.ppsxIntensity Transformation.ppsx
Intensity Transformation.ppsx
 
MAtrix Multiplication Parallel.ppsx
MAtrix Multiplication Parallel.ppsxMAtrix Multiplication Parallel.ppsx
MAtrix Multiplication Parallel.ppsx
 
Web Designing.ppsx
Web Designing.ppsxWeb Designing.ppsx
Web Designing.ppsx
 
Graphics Designing-Intro.ppsx
Graphics Designing-Intro.ppsxGraphics Designing-Intro.ppsx
Graphics Designing-Intro.ppsx
 
Intensity Transformation & Spatial Filtering.ppsx
Intensity Transformation & Spatial Filtering.ppsxIntensity Transformation & Spatial Filtering.ppsx
Intensity Transformation & Spatial Filtering.ppsx
 
DIP Slide Share.ppsx
DIP Slide Share.ppsxDIP Slide Share.ppsx
DIP Slide Share.ppsx
 
Class Timetable.ppsx
Class Timetable.ppsxClass Timetable.ppsx
Class Timetable.ppsx
 
MAPEM.ppsx
MAPEM.ppsxMAPEM.ppsx
MAPEM.ppsx
 

Último

miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxCarrieButtitta
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...marjmae69
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptxogubuikealex
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRRsarwankumar4524
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxJohnree4
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...Henrik Hanke
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringSebastiano Panichella
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸mathanramanathan2005
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationNathan Young
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.KathleenAnnCordero2
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Escort Service
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxaryanv1753
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...漢銘 謝
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxnoorehahmad
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this periodSaraIsabelJimenez
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRachelAnnTenibroAmaz
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxmavinoikein
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comsaastr
 

Último (20)

miladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptxmiladyskindiseases-200705210221 2.!!pptx
miladyskindiseases-200705210221 2.!!pptx
 
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
Gaps, Issues and Challenges in the Implementation of Mother Tongue Based-Mult...
 
Chizaram's Women Tech Makers Deck. .pptx
Chizaram's Women Tech Makers Deck.  .pptxChizaram's Women Tech Makers Deck.  .pptx
Chizaram's Women Tech Makers Deck. .pptx
 
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRRINDIAN GCP GUIDELINE. for Regulatory  affair 1st sem CRR
INDIAN GCP GUIDELINE. for Regulatory affair 1st sem CRR
 
Genshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptxGenshin Impact PPT Template by EaTemp.pptx
Genshin Impact PPT Template by EaTemp.pptx
 
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
DGT @ CTAC 2024 Valencia: Most crucial invest to digitalisation_Sven Zoelle_v...
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
The 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software EngineeringThe 3rd Intl. Workshop on NL-based Software Engineering
The 3rd Intl. Workshop on NL-based Software Engineering
 
Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸Mathan flower ppt.pptx slide orchids ✨🌸
Mathan flower ppt.pptx slide orchids ✨🌸
 
The Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism PresentationThe Ten Facts About People With Autism Presentation
The Ten Facts About People With Autism Presentation
 
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
PAG-UNLAD NG EKONOMIYA na dapat isaalang alang sa pag-aaral.
 
Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170Call Girls In Aerocity 🤳 Call Us +919599264170
Call Girls In Aerocity 🤳 Call Us +919599264170
 
Event 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptxEvent 4 Introduction to Open Source.pptx
Event 4 Introduction to Open Source.pptx
 
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
THE COUNTRY WHO SOLVED THE WORLD_HOW CHINA LAUNCHED THE CIVILIZATION REVOLUTI...
 
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptxAnne Frank A Beacon of Hope amidst darkness ppt.pptx
Anne Frank A Beacon of Hope amidst darkness ppt.pptx
 
Early Modern Spain. All about this period
Early Modern Spain. All about this periodEarly Modern Spain. All about this period
Early Modern Spain. All about this period
 
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATIONRACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
RACHEL-ANN M. TENIBRO PRODUCT RESEARCH PRESENTATION
 
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular PlasticsDutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
 
Work Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptxWork Remotely with Confluence ACE 2.pptx
Work Remotely with Confluence ACE 2.pptx
 
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.comSaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
SaaStr Workshop Wednesday w/ Kyle Norton, Owner.com
 

File Allocation Methods.ppt

  • 1. 1 FILE SYSTEM IMPLEMENTATION FILE SYSTEM STRUCTURE: When talking about “the file system”, you are making a statement about both the rules used for file access, and about the algorithms used to implement those rules. Here’s a breakdown of those algorithmic pieces. Application Programs The code that's making a file request. Logical File System This is the highest level in the OS; it does protection, and security. Uses the directory structure to do name resolution. File-organization Module Here we read the file control block maintained in the directory so we know about files and the logical blocks where information about that file is located. Basic File System Knowing specific blocks to access, we can now make generic requests to the appropriate device driver. IO Control These are device drivers and interrupt handlers. They cause the device to transfer information between that device and CPU memory. Devices The disks / tapes / etc.
  • 2. 2 a) Accessing the file requires a minimum of head movement. b) Easy to calculate block location: block i of a file, starting at disk address b, is b + i. c) Difficulty is in finding the contiguous space, especially for a large file. Problem is one of dynamic allocation (first fit, best fit, etc.) which has external fragmentation. If many files are created/deleted, compaction will be necessary. • It's hard to estimate at create time what the size of the file will ultimately be. What happens when we want to extend the file --- we must either terminate the owner of the file, or try to find a bigger hole. CONTIGUOUS ALLOCATION • Method: Lay down the entire file on contiguous sectors of the disk. Define by a dyad <first block location, length >. Allocation Methods
  • 3. 3 LINKED ALLOCATION Each file is a linked list of disk blocks, scattered anywhere on the disk. At file creation time, simply tell the directory about the file. When writing, get a free block and write to it, enqueueing it to the file header. There's no external fragmentation since each request is for one block. Method can only be effectively used for sequential files. Allocation Methods
  • 4. 4 LINKED ALLOCATION Pointers use up space in each block. Reliability is not high because any loss of a pointer loses the rest of the file. A File Allocation Table is a variation of this. It uses a separate disk area to hold the links. This method doesn't use space in data blocks. Many pointers may remain in memory. A FAT file system is used by MS-DOS. Allocation Methods
  • 5. 5 INDEXED ALLOCATION • Each file uses an index block on disk to contain addresses of other disk blocks used by the file. • When the i th block is written, the address of a free block is placed at the i th position in the index block. • Method suffers from wasted space since, for small files, most of the index block is wasted. What is the optimum size of an index block? • If the index block is too small, we can: a) Link several together b) Use a multilevel index • UNIX keeps 12 pointers to blocks in its header. If a file is longer than this, then it uses pointers to single, double, and triple level index blocks. Allocation Methods
  • 6. 6 PERFORMANCE ISSUES FOR THESE METHODS It's difficult to compare mechanisms because usage is different. Let's calculate, for each method, the number of disk accesses to read block i from a file: contiguous: 1 access from location start + i. linked: i + 1 accesses, reading each block in turn. (is this a fair example?) index: 2 accesses, 1 for index, 1 for data. Allocation Methods