SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Directory Implementation
and Allocation Methods
Prepared By: Mr. Sangram A. Patil
Assistant Professor
PVPIT, Budhgaon
Directory Implementation
 Number of algorithms by using which, the directories can be implemented.
 selection of an appropriate directory implementation algorithm may significantly
affect the performance of the system.
 classified according to the data structure they are using.
 There are mainly two algorithms which are used in these days.
1. Linear list
2. Hash table
1. Linear List
 All the files in a directory are maintained as singly linked list.
 Each file contains the pointers to the data blocks which are assigned to it and the
next file in the directory.
 Characteristics of linear list
 searching for a unique name is a big concern because traversing the whole list
takes time.
 When a new file is created, then the entire list is checked whether the new file
name is matching to a existing file name or not. In case, it doesn't exist, the file can
be created at the beginning or at the end.
 The list needs to be traversed in case of every operation (creation, deletion,
updating, etc) on the files therefore the systems become inefficient.
2. Hash Table
 It overcome the drawbacks of singly linked list implementation.
 This approach suggests to use hash table along with the linked lists.
 A key-value pair for each file in the directory gets generated and stored in the hash
table.
 The key can be determined by applying the hash function on the file name while
the key points to the corresponding file stored in the directory.
 searching becomes efficient
 Only hash table entries are checked using the key and if an entry found then the
corresponding file will be fetched using the value.
Allocation Methods
 There are various methods which can be used to allocate disk space to the files.
 Selection of an appropriate allocation method will significantly affect the
performance and efficiency of the system.
 Allocation method provides a way in which the disk will be utilized and the files will
be accessed.
 following methods which can be used for allocation.
1. Contiguous Allocation
2. Linked Allocation
3. Indexed Allocation
1. Contiguous Allocation
 If the blocks are allocated to the file in such a way that all the logical blocks of the
file get the contiguous physical block in the hard disk then such allocation scheme
is known as contiguous allocation.
1. Contiguous Allocation
 Advantages
1. It is simple to implement.
2. We will get Excellent read performance.
3. Supports Random Access into files.
 Disadvantages
1. The disk will become fragmented (External Fragmentation).
2. It may be difficult to have a file grow (Dynamic Storage allocation problem).
3. Difficult to find space for new file.
2. Linked Allocation
 Solves problems of contiguous allocation.
 Each file is considered as the linked list of disk blocks.
 However, the disks blocks allocated to a particular file need not to be contiguous
on the disk.
 Each disk block allocated to a file contains a pointer which points to the next disk
block allocated to the same file.
 To create a new file we simply create a new entry in directory.
 With linked allocation each directory entry has a pointer to first block of the file.
 Advantages
1. There is no external fragmentation with linked allocation.
2. Any free block can be utilized in order to satisfy the file block requests.
3. File can continue to grow as long as the free blocks are available.
4. Directory entry will only contain the starting block address.
 Disadvantages
1. Random Access is not provided.
2. Pointers require some space in the disk blocks.
3. Any of the pointers in the linked list must not be broken otherwise the file will get
corrupted.
4. Need to traverse each block.
File Allocation Table
 File Allocation Table overcomes this drawback of linked list allocation in linked
allocation.
 a file allocation table is maintained at the beginning of disk volume.
 Table has one entry for each disk block and indexed by block number.
 Directory entry contains block number of the first block of the file.
 The table entry indexed by that block number contains the block number of next
block in the file.
 This chain continues until it reaches the last block.
3.Indexed allocation
 The more the number of blocks, the more will be the size of FAT.
 need to allocate more space to a file allocation table.
 file allocation table needs to be cached therefore it is impossible to have as many
space in cache.
 Indexed allocation scheme stores all the disk pointers in one of the blocks called as
indexed block.
 Indexed block doesn't hold the file data, but it holds the pointers to all the disk
blocks allocated to that particular file.
 Directory entry will only contain the index block address.
 Advantages
1. Supports direct access
2. A bad data block causes the lost of only that block.
3. No external fragmentation
 Disadvantages
1. A bad index block could cause the lost of entire file.
2. Size of a file depends upon the number of pointers, a index block can hold.
3. Having an index block for a small file is totally wastage.
4. More pointer overhead

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Run time storage
Run time storageRun time storage
Run time storage
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 
Register allocation and assignment
Register allocation and assignmentRegister allocation and assignment
Register allocation and assignment
 
Operator precedence
Operator precedenceOperator precedence
Operator precedence
 
Graph traversals in Data Structures
Graph traversals in Data StructuresGraph traversals in Data Structures
Graph traversals in Data Structures
 
Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Back patching
Back patchingBack patching
Back patching
 
Hashing
HashingHashing
Hashing
 
Lexical analyzer generator lex
Lexical analyzer generator lexLexical analyzer generator lex
Lexical analyzer generator lex
 
Segmentation in operating systems
Segmentation in operating systemsSegmentation in operating systems
Segmentation in operating systems
 
contiguous memory allocation.pptx
contiguous memory allocation.pptxcontiguous memory allocation.pptx
contiguous memory allocation.pptx
 
Abstract Data Types
Abstract Data TypesAbstract Data Types
Abstract Data Types
 
Extensible hashing
Extensible hashingExtensible hashing
Extensible hashing
 
Disk structure
Disk structureDisk structure
Disk structure
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
Code generation
Code generationCode generation
Code generation
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 

Ähnlich wie Directory implementation and allocation methods

Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1rohassanie
 
Allocation methods (1).pptx
Allocation methods (1).pptxAllocation methods (1).pptx
Allocation methods (1).pptxssuser55cbdb
 
File System Implementation.pptx
File System Implementation.pptxFile System Implementation.pptx
File System Implementation.pptxRajapriya82
 
Secondary Storage Management
Secondary Storage ManagementSecondary Storage Management
Secondary Storage ManagementPriyanshuGandhi3
 
Storage Mediums and Fragmentation
Storage Mediums and FragmentationStorage Mediums and Fragmentation
Storage Mediums and FragmentationJonathan Reid
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsMukesh Chinta
 
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
 
File organization continued
File organization continuedFile organization continued
File organization continuedchesterking12
 
Filesharing 180214044607
Filesharing 180214044607Filesharing 180214044607
Filesharing 180214044607kirupasuchi1996
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.pptHelalMirzad
 

Ähnlich wie Directory implementation and allocation methods (20)

Chapter 3 part 1
Chapter 3 part 1Chapter 3 part 1
Chapter 3 part 1
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
File Allocation Methods.ppt
File Allocation Methods.pptFile Allocation Methods.ppt
File Allocation Methods.ppt
 
Allocation methods (1).pptx
Allocation methods (1).pptxAllocation methods (1).pptx
Allocation methods (1).pptx
 
File System Implementation.pptx
File System Implementation.pptxFile System Implementation.pptx
File System Implementation.pptx
 
Secondary Storage Management
Secondary Storage ManagementSecondary Storage Management
Secondary Storage Management
 
Storage Mediums and Fragmentation
Storage Mediums and FragmentationStorage Mediums and Fragmentation
Storage Mediums and Fragmentation
 
Files
FilesFiles
Files
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File Systems
 
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
 
File organization continued
File organization continuedFile organization continued
File organization continued
 
File organisation
File organisationFile organisation
File organisation
 
File Systems
File SystemsFile Systems
File Systems
 
File system implementation
File system implementationFile system implementation
File system implementation
 
File sharing
File sharingFile sharing
File sharing
 
Filesharing 180214044607
Filesharing 180214044607Filesharing 180214044607
Filesharing 180214044607
 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
 
file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.ppt
 

Mehr von sangrampatil81

Mehr von sangrampatil81 (20)

Deadlock
DeadlockDeadlock
Deadlock
 
Memory Management
Memory ManagementMemory Management
Memory Management
 
virtual memory
virtual memoryvirtual memory
virtual memory
 
IO hardware
IO hardwareIO hardware
IO hardware
 
File management
File managementFile management
File management
 
Disk structure
Disk structureDisk structure
Disk structure
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Methods for handling deadlock
Methods for handling deadlockMethods for handling deadlock
Methods for handling deadlock
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Monitors
MonitorsMonitors
Monitors
 
Classical problems of process synchronization
Classical problems of process synchronizationClassical problems of process synchronization
Classical problems of process synchronization
 
System programs
System programsSystem programs
System programs
 
System programs
System programsSystem programs
System programs
 
Services and system calls
Services and system callsServices and system calls
Services and system calls
 
Operating system structure
Operating system structureOperating system structure
Operating system structure
 
Operating system deign and implementation
Operating system deign and implementationOperating system deign and implementation
Operating system deign and implementation
 
Pointer to array and structure
Pointer to array and structurePointer to array and structure
Pointer to array and structure
 
Pointer arithmetic in c
Pointer arithmetic in c Pointer arithmetic in c
Pointer arithmetic in c
 
Pointer in c
Pointer in c Pointer in c
Pointer in c
 
Structure in c language
Structure in c languageStructure in c language
Structure in c language
 

Kürzlich hochgeladen

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Kürzlich hochgeladen (20)

W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Directory implementation and allocation methods

  • 1. Directory Implementation and Allocation Methods Prepared By: Mr. Sangram A. Patil Assistant Professor PVPIT, Budhgaon
  • 2. Directory Implementation  Number of algorithms by using which, the directories can be implemented.  selection of an appropriate directory implementation algorithm may significantly affect the performance of the system.  classified according to the data structure they are using.  There are mainly two algorithms which are used in these days. 1. Linear list 2. Hash table
  • 3. 1. Linear List  All the files in a directory are maintained as singly linked list.  Each file contains the pointers to the data blocks which are assigned to it and the next file in the directory.
  • 4.  Characteristics of linear list  searching for a unique name is a big concern because traversing the whole list takes time.  When a new file is created, then the entire list is checked whether the new file name is matching to a existing file name or not. In case, it doesn't exist, the file can be created at the beginning or at the end.  The list needs to be traversed in case of every operation (creation, deletion, updating, etc) on the files therefore the systems become inefficient.
  • 5. 2. Hash Table  It overcome the drawbacks of singly linked list implementation.  This approach suggests to use hash table along with the linked lists.  A key-value pair for each file in the directory gets generated and stored in the hash table.  The key can be determined by applying the hash function on the file name while the key points to the corresponding file stored in the directory.  searching becomes efficient  Only hash table entries are checked using the key and if an entry found then the corresponding file will be fetched using the value.
  • 6.
  • 7. Allocation Methods  There are various methods which can be used to allocate disk space to the files.  Selection of an appropriate allocation method will significantly affect the performance and efficiency of the system.  Allocation method provides a way in which the disk will be utilized and the files will be accessed.  following methods which can be used for allocation. 1. Contiguous Allocation 2. Linked Allocation 3. Indexed Allocation
  • 8. 1. Contiguous Allocation  If the blocks are allocated to the file in such a way that all the logical blocks of the file get the contiguous physical block in the hard disk then such allocation scheme is known as contiguous allocation.
  • 9. 1. Contiguous Allocation  Advantages 1. It is simple to implement. 2. We will get Excellent read performance. 3. Supports Random Access into files.  Disadvantages 1. The disk will become fragmented (External Fragmentation). 2. It may be difficult to have a file grow (Dynamic Storage allocation problem). 3. Difficult to find space for new file.
  • 10. 2. Linked Allocation  Solves problems of contiguous allocation.  Each file is considered as the linked list of disk blocks.  However, the disks blocks allocated to a particular file need not to be contiguous on the disk.  Each disk block allocated to a file contains a pointer which points to the next disk block allocated to the same file.  To create a new file we simply create a new entry in directory.  With linked allocation each directory entry has a pointer to first block of the file.
  • 11.
  • 12.  Advantages 1. There is no external fragmentation with linked allocation. 2. Any free block can be utilized in order to satisfy the file block requests. 3. File can continue to grow as long as the free blocks are available. 4. Directory entry will only contain the starting block address.  Disadvantages 1. Random Access is not provided. 2. Pointers require some space in the disk blocks. 3. Any of the pointers in the linked list must not be broken otherwise the file will get corrupted. 4. Need to traverse each block.
  • 13. File Allocation Table  File Allocation Table overcomes this drawback of linked list allocation in linked allocation.  a file allocation table is maintained at the beginning of disk volume.  Table has one entry for each disk block and indexed by block number.  Directory entry contains block number of the first block of the file.  The table entry indexed by that block number contains the block number of next block in the file.  This chain continues until it reaches the last block.
  • 14.
  • 15. 3.Indexed allocation  The more the number of blocks, the more will be the size of FAT.  need to allocate more space to a file allocation table.  file allocation table needs to be cached therefore it is impossible to have as many space in cache.  Indexed allocation scheme stores all the disk pointers in one of the blocks called as indexed block.  Indexed block doesn't hold the file data, but it holds the pointers to all the disk blocks allocated to that particular file.  Directory entry will only contain the index block address.
  • 16.
  • 17.  Advantages 1. Supports direct access 2. A bad data block causes the lost of only that block. 3. No external fragmentation  Disadvantages 1. A bad index block could cause the lost of entire file. 2. Size of a file depends upon the number of pointers, a index block can hold. 3. Having an index block for a small file is totally wastage. 4. More pointer overhead