SlideShare ist ein Scribd-Unternehmen logo
1 von 47
File System
Management
Prepared by: Janki Kansagra
File-System Interface
 File Concept
 Access Methods
 Directory Structure
 File-System Mounting
 File Sharing
 Protection
Objectives
 To explain the function of file systems
 To describe the interfaces to file systems
 To discuss file-system design tradeoffs, including access
methods, file sharing, file locking, and directory structures
 To explore file-system protection
File Attributes
 Name – only information kept in human-readable form
 Identifier – unique tag (number) identifies file within file system
 Type – needed for systems that support different types
 Location – pointer to file location on device
 Size – current file size
 Protection – controls who can do reading, writing, executing
 Time, date, and user identification – data for protection,
security, and usage monitoring
 Information about files are kept in the directory structure, which
is maintained on the disk
File Operations
 Create
 Write
 Read
 Reposition within file
 Delete
 Truncate
 Open(Fi) – search the directory structure on disk for
entry Fi, and move the content of entry to memory
 Close (Fi) – move the content of entry Fi in memory
to directory structure on disk
Open Files
 Several pieces of data are needed to manage open files:
File pointer: pointer to last read/write location, per
process that has the file open
File-open count: counter of number of times a file is
open – to allow removal of data from open-file table
when last processes closes it
Disk location of the file: cache of data access
information
Access rights: per-process access mode information
File Types – Name, Extension
Access Methods
 Sequential Access
read next
write next
reset
no read after last write
(rewrite)
 Direct Access
read n
write n
position to n
read next
write next
rewrite n
n = relative block number
Sequential-access File
Directory Structure
 A collection of nodes containing information about all files.
F 1 F 2
F 3
F 4
F n
Directory
Files
Both the directory structure and the files reside on disk
Operations Performed on
Directory
 List directory contents
 Search for a file
 Create a file
 Delete a file
 Rename a file
 Traverse the file system
Single-Level Directory
 A single directory for all user called the root
directory
 Pros: Simple, easy to quickly locate files
 Cons: inconvenient naming (uniqueness), no
grouping
Two-Level Directory
 Separate directory for each user
 Introduces the notion of a path name
 Can have the same file name for different user
 Efficient searching
 No grouping capability
Tree-Structured
Directories
 Directories can now contain files and
subdirectories
 Efficient searching, allows grouping
Path Names
 To access a file, the user should either:
 Go to the directory where file resides, or Specify the
path where the file is
 Path names are either absolute or relative
 Absolute: path of file from the root directory
 Relative: path from the current working directory
 Most OSes have two special entries in each directory:
 “.” for current directory and “..” for parent
Acyclic-Graph Directories
 Allow sharing of subdirectories and files
Protection
 File owner/creator should be able to control:
 what can be done
 by whom
Types of access
 Read
 Write
 Execute
 Append
 Delete
 List
Categories of Users
Individual user
 Log in establishes a user-id
 Might be just local on the computer or could be
through interaction with a network service
Groups to which the user belongs
 For example, “nahum” is in “w4118”
 Again could just be automatic or could involve
talking to a service that might assign, say, a
temporary cryptographic key
UNIX Access Rights
 Mode of access: read, write, execute
 Three classes of users
RWX
a) owner access 7  1 1 1
RWX
b) group access 6  1 1 0
RWX
c) public access 1  0 0 1
 Ask manager to create a group (unique name), say
G, and add some users to the group.
 For a particular file (say game) or subdirectory,
define an appropriate access.
owner group public
chmod 761 game
Issues with Access Rights
 Just a single owner, a single group and the public
 Pro: Compact enough to fit in just a few bytes
 Con: Not very expressive
 Access Control List: This is a per-file list that tells
who can access that file
 Pro: Highly expressive
 Con: Harder to represent in a compact way
Disk Scheduling
 The operating system is responsible for using
hardware efficiently — for the disk drives, this means
having a fast access time and disk bandwidth.
 Access time has two major components
 Seek time is the time for the disk are to move the
heads to the cylinder containing the desired sector.
 Rotational latency is the additional time waiting
for the disk to rotate the desired sector to the disk
head.
Disk Scheduling
 Minimize seek time
 Seek time  seek distance
 Disk bandwidth is the total number of bytes
transferred, divided by the total time between the
first request for service and the completion of the last
transfer.
Disk Scheduling
 Several algorithms exist to schedule the servicing of
disk I/O requests.
 We illustrate them with a request queue (0-199).

98, 183, 37, 122, 14, 124, 65, 67
 Head pointer 53
FCFS Disk Scheduling
SSTF Disk Scheduling
 Selects the request with the minimum seek time from
the current head position.
 SSTF scheduling is a form of SJF scheduling; may
cause starvation of some requests.
 Illustration shows total head movement of 236
cylinders.
SSTF Disk Scheduling
SCAN Disk Scheduling
 The disk arm starts at one end of the disk, and moves
toward the other end, servicing requests until it gets
to the other end of the disk, where the head
movement is reversed and servicing continues.
 Sometimes called the elevator algorithm.
 Illustration shows total head movement of 208
cylinders.
SCAN Disk Scheduling
C-SCAN Disk Scheduling
 Provides a more uniform wait time than SCAN.
 The head moves from one end of the disk to the
other. servicing requests as it goes. When it reaches
the other end, however, it immediately returns to the
beginning of the disk, without servicing any requests
on the return trip.
 Treats the cylinders as a circular list that wraps
around from the last cylinder to the first one.
C-SCAN Disk Scheduling
LOOK and C-LOOK Disk
Scheduling
 In LOOK and C-LOOK the arm goes as far as the final
request in each direction then reverses direction
immediately without first going all the way to the end
of the disk.
 Versions of SCAN and C-SCAN that follow this
pattern are called LOOK and C-LOOK.
LOOK Disk Scheduling
C-LOOK Disk Scheduling
Disk Allocation Methods
Three allocation methods:
 Contiguous allocation
 Linked allocation
 Indexed allocation
Contiguous Allocation
 Each file occupies a set of contiguous blocks on the
disk
 Pros:
Simple – only starting location (block #) and
length (number of blocks) are required
Random access
 Cons:
Wasteful of space (dynamic storage-allocation
problem)
External fragmentation: may need to compact
space
Files cannot grow
Contiguous Allocation
Contiguous Allocation
 Some newer file systems (i.e. high-performance
Veritas File System) use a modified contiguous
allocation scheme
 Extent-based file systems allocate disk blocks in
extents
 An extent is a contiguous chunk of blocks (similar to
clusters)
 Extents are allocated when the file grows
 Extents are linked
 A file consists of one or more extents
 Extent size can be set by owner of file
Linked Allocation
 Each file is a linked list of disk blocks
 Blocks may be scattered anywhere on the disk
 Pros:
Simple – need only starting address
Free-space management system – no waste of
space
 Cons:
No efficient random access
Linked Allocation
File Allocation Table
 Variation on linked list allocation.
 FAT is located in contiguous space on disk
 Each entry corresponds to disk block number
 Each entry contains a pointer to the next block or 0
 Used by MS-DOS and OS/2
Linked Allocation
Indexed Allocation
 Brings all pointers together into the index block
 Pros:
 Efficient random access
 Dynamic access without external fragmentation
 Cons:
 Index table storage overhead
Indexed Allocation
Indexed Allocation
 Linked Scheme: If the size of index block is too
large link several index blocks together.
 Last pointer in the block points next index block.
 Nil indicates the end of index file.
Indexed Allocation
 Multi level Index: First level index block points to
second level index blocks which point to file blocks.

outer-index
index table file
Indexed Allocation
 Combined Scheme: first n-3 pointers point to data
blocks, last three are multilevel indexes.
 First block points to single level index, second block
points to second level. Third block points to third
level.
Indexed Allocation

Weitere ähnliche Inhalte

Was ist angesagt?

30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt
raj732723
 

Was ist angesagt? (20)

Bios
BiosBios
Bios
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Chapter04 processor and memory
Chapter04   processor and memoryChapter04   processor and memory
Chapter04 processor and memory
 
Bios
Bios Bios
Bios
 
File management
File managementFile management
File management
 
RAID
RAIDRAID
RAID
 
Bios ( Basic Input Output System )
Bios ( Basic Input Output System )Bios ( Basic Input Output System )
Bios ( Basic Input Output System )
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Disk Management
Disk ManagementDisk Management
Disk Management
 
Expo 4 s.o. dispositivos y manejadores de dispositivos
Expo 4 s.o. dispositivos y manejadores de dispositivosExpo 4 s.o. dispositivos y manejadores de dispositivos
Expo 4 s.o. dispositivos y manejadores de dispositivos
 
File Management in Operating Systems
File Management in Operating SystemsFile Management in Operating Systems
File Management in Operating Systems
 
30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt30326851 -operating-system-unit-1-ppt
30326851 -operating-system-unit-1-ppt
 
Motherboard ppt
Motherboard pptMotherboard ppt
Motherboard ppt
 
Database
DatabaseDatabase
Database
 
MEMORY MANAGEMENT
MEMORY MANAGEMENTMEMORY MANAGEMENT
MEMORY MANAGEMENT
 
Installing driver
Installing driverInstalling driver
Installing driver
 
Bios
BiosBios
Bios
 
Concept of computer files for Grade 12 learners
Concept of computer files for Grade 12 learnersConcept of computer files for Grade 12 learners
Concept of computer files for Grade 12 learners
 
Chapter 16 - Distributed System Structures
Chapter 16 - Distributed System StructuresChapter 16 - Distributed System Structures
Chapter 16 - Distributed System Structures
 

Ähnlich wie File Management.ppt

Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
C.U
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OS
C.U
 

Ähnlich wie File Management.ppt (20)

file management_part2_os_notes.ppt
file management_part2_os_notes.pptfile management_part2_os_notes.ppt
file management_part2_os_notes.ppt
 
Chapter 11 - File System Implementation
Chapter 11 - File System ImplementationChapter 11 - File System Implementation
Chapter 11 - File System Implementation
 
Unit 3 file management
Unit 3 file managementUnit 3 file management
Unit 3 file management
 
Unit 3 chapter 1-file management
Unit 3 chapter 1-file managementUnit 3 chapter 1-file management
Unit 3 chapter 1-file management
 
file management_osnotes.ppt
file management_osnotes.pptfile management_osnotes.ppt
file management_osnotes.ppt
 
OSCh12
OSCh12OSCh12
OSCh12
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
 
OS_Ch12
OS_Ch12OS_Ch12
OS_Ch12
 
File system interfacefinal
File system interfacefinalFile system interfacefinal
File system interfacefinal
 
Chapter 10 - File System Interface
Chapter 10 - File System InterfaceChapter 10 - File System Interface
Chapter 10 - File System Interface
 
Chapter13
Chapter13Chapter13
Chapter13
 
Ch11 OS
Ch11 OSCh11 OS
Ch11 OS
 
OSCh11
OSCh11OSCh11
OSCh11
 
OS_Ch11
OS_Ch11OS_Ch11
OS_Ch11
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
File System operating system operating system
File System  operating system operating systemFile System  operating system operating system
File System operating system operating system
 
Ch10
Ch10Ch10
Ch10
 
Files
FilesFiles
Files
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Ch11
Ch11Ch11
Ch11
 

Mehr von JeelBhanderi4 (10)

Process Management.ppt
Process Management.pptProcess Management.ppt
Process Management.ppt
 
Deadlock.ppt
Deadlock.pptDeadlock.ppt
Deadlock.ppt
 
2. Efficient Market Hypothesis.pptx
2. Efficient Market Hypothesis.pptx2. Efficient Market Hypothesis.pptx
2. Efficient Market Hypothesis.pptx
 
akshardham-160916093034 (2).pdf
akshardham-160916093034 (2).pdfakshardham-160916093034 (2).pdf
akshardham-160916093034 (2).pdf
 
Ch_6 Regulated Power Supply (1).ppt
Ch_6 Regulated Power Supply (1).pptCh_6 Regulated Power Supply (1).ppt
Ch_6 Regulated Power Supply (1).ppt
 
Chapter-4 FET (1).ppt
Chapter-4 FET (1).pptChapter-4 FET (1).ppt
Chapter-4 FET (1).ppt
 
Chapter-6 DC biasing-1.ppt
Chapter-6 DC biasing-1.pptChapter-6 DC biasing-1.ppt
Chapter-6 DC biasing-1.ppt
 
Chapter-5- Transistor Characteristics-1.ppt
Chapter-5- Transistor Characteristics-1.pptChapter-5- Transistor Characteristics-1.ppt
Chapter-5- Transistor Characteristics-1.ppt
 
Chapter 3 (2).ppt
Chapter 3 (2).pptChapter 3 (2).ppt
Chapter 3 (2).ppt
 
All C ppt.ppt
All C ppt.pptAll C ppt.ppt
All C ppt.ppt
 

Kürzlich hochgeladen

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 

File Management.ppt

  • 2. File-System Interface  File Concept  Access Methods  Directory Structure  File-System Mounting  File Sharing  Protection
  • 3. Objectives  To explain the function of file systems  To describe the interfaces to file systems  To discuss file-system design tradeoffs, including access methods, file sharing, file locking, and directory structures  To explore file-system protection
  • 4. File Attributes  Name – only information kept in human-readable form  Identifier – unique tag (number) identifies file within file system  Type – needed for systems that support different types  Location – pointer to file location on device  Size – current file size  Protection – controls who can do reading, writing, executing  Time, date, and user identification – data for protection, security, and usage monitoring  Information about files are kept in the directory structure, which is maintained on the disk
  • 5. File Operations  Create  Write  Read  Reposition within file  Delete  Truncate  Open(Fi) – search the directory structure on disk for entry Fi, and move the content of entry to memory  Close (Fi) – move the content of entry Fi in memory to directory structure on disk
  • 6. Open Files  Several pieces of data are needed to manage open files: File pointer: pointer to last read/write location, per process that has the file open File-open count: counter of number of times a file is open – to allow removal of data from open-file table when last processes closes it Disk location of the file: cache of data access information Access rights: per-process access mode information
  • 7. File Types – Name, Extension
  • 8. Access Methods  Sequential Access read next write next reset no read after last write (rewrite)  Direct Access read n write n position to n read next write next rewrite n n = relative block number
  • 10. Directory Structure  A collection of nodes containing information about all files. F 1 F 2 F 3 F 4 F n Directory Files Both the directory structure and the files reside on disk
  • 11. Operations Performed on Directory  List directory contents  Search for a file  Create a file  Delete a file  Rename a file  Traverse the file system
  • 12. Single-Level Directory  A single directory for all user called the root directory  Pros: Simple, easy to quickly locate files  Cons: inconvenient naming (uniqueness), no grouping
  • 13. Two-Level Directory  Separate directory for each user  Introduces the notion of a path name  Can have the same file name for different user  Efficient searching  No grouping capability
  • 14. Tree-Structured Directories  Directories can now contain files and subdirectories  Efficient searching, allows grouping
  • 15. Path Names  To access a file, the user should either:  Go to the directory where file resides, or Specify the path where the file is  Path names are either absolute or relative  Absolute: path of file from the root directory  Relative: path from the current working directory  Most OSes have two special entries in each directory:  “.” for current directory and “..” for parent
  • 16. Acyclic-Graph Directories  Allow sharing of subdirectories and files
  • 17. Protection  File owner/creator should be able to control:  what can be done  by whom Types of access  Read  Write  Execute  Append  Delete  List
  • 18. Categories of Users Individual user  Log in establishes a user-id  Might be just local on the computer or could be through interaction with a network service Groups to which the user belongs  For example, “nahum” is in “w4118”  Again could just be automatic or could involve talking to a service that might assign, say, a temporary cryptographic key
  • 19. UNIX Access Rights  Mode of access: read, write, execute  Three classes of users RWX a) owner access 7  1 1 1 RWX b) group access 6  1 1 0 RWX c) public access 1  0 0 1  Ask manager to create a group (unique name), say G, and add some users to the group.  For a particular file (say game) or subdirectory, define an appropriate access. owner group public chmod 761 game
  • 20. Issues with Access Rights  Just a single owner, a single group and the public  Pro: Compact enough to fit in just a few bytes  Con: Not very expressive  Access Control List: This is a per-file list that tells who can access that file  Pro: Highly expressive  Con: Harder to represent in a compact way
  • 21. Disk Scheduling  The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk bandwidth.  Access time has two major components  Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector.  Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head.
  • 22. Disk Scheduling  Minimize seek time  Seek time  seek distance  Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of the last transfer.
  • 23. Disk Scheduling  Several algorithms exist to schedule the servicing of disk I/O requests.  We illustrate them with a request queue (0-199).  98, 183, 37, 122, 14, 124, 65, 67  Head pointer 53
  • 25. SSTF Disk Scheduling  Selects the request with the minimum seek time from the current head position.  SSTF scheduling is a form of SJF scheduling; may cause starvation of some requests.  Illustration shows total head movement of 236 cylinders.
  • 27. SCAN Disk Scheduling  The disk arm starts at one end of the disk, and moves toward the other end, servicing requests until it gets to the other end of the disk, where the head movement is reversed and servicing continues.  Sometimes called the elevator algorithm.  Illustration shows total head movement of 208 cylinders.
  • 29. C-SCAN Disk Scheduling  Provides a more uniform wait time than SCAN.  The head moves from one end of the disk to the other. servicing requests as it goes. When it reaches the other end, however, it immediately returns to the beginning of the disk, without servicing any requests on the return trip.  Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.
  • 31. LOOK and C-LOOK Disk Scheduling  In LOOK and C-LOOK the arm goes as far as the final request in each direction then reverses direction immediately without first going all the way to the end of the disk.  Versions of SCAN and C-SCAN that follow this pattern are called LOOK and C-LOOK.
  • 34. Disk Allocation Methods Three allocation methods:  Contiguous allocation  Linked allocation  Indexed allocation
  • 35. Contiguous Allocation  Each file occupies a set of contiguous blocks on the disk  Pros: Simple – only starting location (block #) and length (number of blocks) are required Random access  Cons: Wasteful of space (dynamic storage-allocation problem) External fragmentation: may need to compact space Files cannot grow
  • 37. Contiguous Allocation  Some newer file systems (i.e. high-performance Veritas File System) use a modified contiguous allocation scheme  Extent-based file systems allocate disk blocks in extents  An extent is a contiguous chunk of blocks (similar to clusters)  Extents are allocated when the file grows  Extents are linked  A file consists of one or more extents  Extent size can be set by owner of file
  • 38. Linked Allocation  Each file is a linked list of disk blocks  Blocks may be scattered anywhere on the disk  Pros: Simple – need only starting address Free-space management system – no waste of space  Cons: No efficient random access
  • 40. File Allocation Table  Variation on linked list allocation.  FAT is located in contiguous space on disk  Each entry corresponds to disk block number  Each entry contains a pointer to the next block or 0  Used by MS-DOS and OS/2
  • 42. Indexed Allocation  Brings all pointers together into the index block  Pros:  Efficient random access  Dynamic access without external fragmentation  Cons:  Index table storage overhead
  • 44. Indexed Allocation  Linked Scheme: If the size of index block is too large link several index blocks together.  Last pointer in the block points next index block.  Nil indicates the end of index file.
  • 45. Indexed Allocation  Multi level Index: First level index block points to second level index blocks which point to file blocks.  outer-index index table file
  • 46. Indexed Allocation  Combined Scheme: first n-3 pointers point to data blocks, last three are multilevel indexes.  First block points to single level index, second block points to second level. Third block points to third level.