SlideShare una empresa de Scribd logo
1 de 58
POS - File System & Deadlocks
Presenter Rohit Jain
File System
• It is the way in which files are named and where they are placed logically for
storage and retrieval.
• A file system is used to control how information is stored and retrieved.
• Without file system, information placed in a storage area would be one large body
of information with no way to tell where one piece of information stops and the
next begins.
• A file system defines the structures and the rules used to read, write and maintain
information stored on a disk.
Aspects of File system
• Space management
• Filename
• Directories
• Metadata
• Restricting and permitting access
Space Management
• The File system is responsible for organizing files and directories and keeping
track of which areas of the media belongs to which file and which are not being
used.
• Slack Space
• File system fragmentation occurs when unused space or single files are not
contiguous. As file are deleted the space they were allocated eventually is
considered available for use by other files.This created alternating used and
unused areas of various sizes.
File Names
• A filename is used to identify a storage location In the file system. Most file
system have restrictions on the length of filenames. In some file system filenames
are case sensitive.
Directories
• File system typically have directories (folders) which allow user to group files into
separate collection.
• Directory structure may be linear or allow hierarchies where directory may contain
sub directory.
Metadata
• Meta Data is data about data and in filesystem it is associated as bookkeeping
information is typically associated with each file within a file system.The length of
the data contained in a file may be stored as the number of blocks allocated for
the file or as the byte count.
Restricting and Permitting access
• There are several mechanisms used by file system to control access to data.
Usually the intent is to prevent reading or modifying files by user or group of users.
Another reason is to ensure data is modified in a controlled way so access may be
restricted to a specific program.
• For Example Includes Password stored in the metadata of the file.
Types of File System
• Disk File system
• Flash File system
• Database file system
• Network file system
• Special file system
Disk file system
• A disk file system takes advantages of the ability of disk storage media to
randomly address data in a short amount of time.
• Additionally Consideration include the speed of accessing data following that
initially requested and the anticipation that the following data may be requested.
• For example ext3, NTFS, UDF etc.
Flash file system
• A flash file system considers the special abilities, performance restrictions of flash
memory devices.
• Frequently a disk file system can use a flash memory device as the underlying
storage media but it is much better to use a file system that is Specifically
designed for a flash device.
Database File system
• In this file are identified be their characteristics, like type, author or any other Rich
metadata instead of hierarchical structured management..
• IBM DB2 is a database file system.
Network File system
• A network file system is a file system that acts as a client for a remote file access
protocol, providing access to files on a server.
• For example AFS, FTP,WebDAV.
Shared Disk File system
• A shared disk file system is one in which a number of machine all have access to
the same external disk subsystem.
• The file system arbitrates access to that subsystem, Preventing write collisions.
• For example GFS 2 , GPFS etc.
Special File system
• A special File system presents non-file elements of an OS as files so they can be
acted on using system APIs.This is most commonly done in Unix Like Operating
System but devices are given file names in some non-unix-like Operating systems
as well.
File Attributes
• Name
• Type
• Protection
• Location
• Size
File Operations
• Creata :- Find spaces on disk and make entyr in directory
• Write : wirte to file requires positioning with ithe file
• Read : read from file involves positioning within the file
• Delete :- Delete Directory enry, redaim disk space
• Reposition Move read / write position.
Files access Methods
• Sequential :- readNext, writenext, Reset
• Direct :- readRecord N,WirteRecord N PostoionAt N, reset
• Indexed :- readRecord Key,Write Record Key , PositionAt Key, reset
File AllocationTable
• Where the OS record s how the disk spece is used,
• Location of FAT near the beginning og the volume
• Locatoin of FAT is specified in the boot sector
FATTypes
• FAT12 :-The earliest version the file system, FAT12 allow a partition to containg up
to 4096MB/ (212) clusters
• FAT16 :- oldest, created for DOS, supported by most OS’s cannot be installed on
partitions laeger than 2 GB, or on hard dreives larger than 4 GB
• FAT32 :- Supports disk from 512MB to 2TB, compatible with windows98 upto
latest.
NTFS
• NewTechnology File System
• Better File Security ( Encryption File system)
• Disk Compressoin – can compress a file/ folder
• NTFS volmes can not be accessed by DOS
Operating System FAT16 FAT32 NTFS
Windows XP
Windows 2000
Windows NT
Windows 95, 98, ME
Windows 95
MS-DOS
Formatting Process
• Full Format
• Quick Format
Disk Scheduling
• The OS is responsible for using hardware efficiently for the disk drives
• Access time
Total access time = seek time + rotational delay + data transfer time
Seek time – time required to move the disk arm to the required track
Rotational delay – time required to rotate the disk to the required sector
Data transfer time – time to read/write data from/to the disk
• Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for
service and the completion of last transfer.
• OS maintains queue of request, per disk or device.
Disk SchedulingAlgorithms
SeveralAlgorithms exist to schedule the servicing of disk I/O requests.
• FCFS
• SSTF
• SCAN
• C-Scan
• Look
• C-Look
Queue = 98, 183, 37, 122, 14, 124, 65, 67
Head starts at 53
First Come First Serve
• Handle I/o request Sequentially
• Fair at all Processes
• Approaches reandom scheduling in performance scheduling in performance if
there are many processes/ request.
Shortest SeekTime First
• Selects the request with the minimum seek time from the current head position.
• SSSTF scheduling is a form of SJF scheduling may cause starvation of some
requests.
SCAN
• The disk arm starts at one end of the disk , and moves toward the other end,
servicing requests until it get to the other end of the disk, where the head
movement is reversed and servicing continues.
• It moves in both directions until both ends
• Tends to stay more at the ends so more fair to the extreme cylinder requests
C-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.
• Provides a more uniform wait time than SCAN; it treats all cylinders in
the same manner.
C- Look
• Look version of C-Scan.
• Arm only goes as far as the last request in each direction, then reverses
direction immediately, without first going all the way to the end of the
disk.
• In general, Circular versions are more fair but pay with a larger total seek
time.
• Scan versions have a larger total seek time than the corresponding Look
versions.
Selecting a Disk SchedulingAlgorithm
• Performance depends on the number and types of requests.
• Requests for disk service can be influenced by the file-allocation method.
• The disk-scheduling algorithm should be written as a separate module
of the operating system, allowing it to be replaced with a different
algorithm if necessary.
• With low load on the disk, It’s FCFS anyway. SSTF is common and has a
natural appeal – good for medium disk load.
• SCAN and C-SCAN perform better for systems that place a heavy load
on the disk; Less starvation.
• Either SSTF or LOOK is a reasonable choice for the default algorithm.
Dead Lock
• Deadlock: processes waiting indefinitely
with no chance of making progress.
• Starvation: a process waits for a long time
to make progress.
Deadlocks
• Deadlock applications not just OS
– Network
• Two processes may be blocking a send message
to the other process if they are both waiting for a
message from the other process
» Receive/waiting blocks writing
– Databases.
– Spooling/streaming data.
Deadlock Characterization
• Mutual exclusion: Only one process at a time can use a resource.
• Hold and wait: A process holding at least one resource is waiting to
acquire additional resources held by other processes.
• No preemption: A resource can be released only voluntarily by the
process holding it, after that process has completed its task.
• Circular wait: there exists a set {P0, P1, …, P0} of waiting
processes such that P0 is waiting for a resource that is held by P1,
P1 is waiting for a resource that is held by
P2, …, Pn–1 is waiting for a resource that is held by
Pn, and P0 is waiting for a resource that is held by P0.
Resource-Allocation Graph
• V is partitioned into two types:
– P = {P1, P2, …, Pn}, the set consisting of all
the processes in the system.
– R = {R1, R2, …, Rm}, the set consisting of
all resource types in the system.
request edge – directed edge P1  Rj
assignment edge – directed edge Rj 
Pi
•
•
A set of vertices V and a set of edges E.
Resource-Allocation Graph
• Process
• Resource Type with 4 instances
• Pi requests instance of
Rj
• Pi is holding an instance of
Rj
Pi
Rj
Pi
Rj
Example of a Resource Allocation
Graph
Resource Allocation Graph With A
Deadlock
Basic Facts
• If graph contains no cycles  no deadlock.
• If graph contains a cycle 
– if only one instance per resource type,
then deadlock.
– if several instances per resource type, possibility
of
deadlock.
Methods for Handling Deadlocks
• Ensure that the system will never enter
a deadlock state.
• Allow the system to enter a deadlock state
and
then recover.
• Ignore the problem and pretend that
deadlocks never occur in the system; used by
most operating systems, including UNIX.
Deadlock Prevention
• Mutual Exclusion – not required for sharable
resources; must hold for nonsharable
resources.
• Hold and Wait – must guarantee that whenever
a process requests a resource, it does not hold
any other resources.
– Require process to request and be allocated all its
resources before it begins execution, or allow process
to request resources only when the process has none.
– Low resource utilization; starvation possible.
Deadlock Prevention
• No Preemption –
– If a process that is holding some resources requests
another resource that cannot be immediately allocated to
it, then all resources currently being held are released.
– Preempted resources are added to the list of resources
for which the process is waiting.
– Process will be restarted only when it can regain its old
resources, as well as the new ones that it is requesting.
• Circular Wait – impose a total ordering of all
resource types, and require that each
process requests resources in an increasing
order of enumeration.
Deadlock Avoidance
• Simplest and most useful model requires that each process
declare the maximum number of resources of each type
that it may need.
• The deadlock-avoidance algorithm dynamically examines
the resource-allocation state to ensure that there can
never be a circular-wait condition.
• Resource-allocation state is defined by the number of
available and allocated resources, and the maximum
demands of the processes.
Requires that the system has some additional a priori
information available.
Banker’s Algorithm
Multiple instances
Each process must a priori claim of the maximum use.
When a process requests a resource it may have to wait.
When a process gets all its resources, it must return them in a
finite amount of time.
Data Structures for Banker’s Algorithm
n = number of processes, and m = number of resources types
Available: vector of length m.
• If Available[j ] = k, there are k instances of resource type Rj
available.
Max: n × m matrix.
• If Max[i , j ] = k, then process Pi may request at most k instances of
resource type Rj .
Allocation: n × m matrix.
• If Allocation[i , j ] = k then Pi is currently allocated k instances of
Rj .
Need: n × m matrix.
• If Need[i , j ] = k, then Pi may need k more instances of Rj to
complete its task Need[i , j ] = Max[i , j ] − Allocation[i , j ]
Resource-Request Algorithm for Process Pi
Requesti= request vector for process Pi . If Requesti [j ] = k, then
process Pi wants k instances of resource type Rj .
1. If Requesti ≤ Needi , go to step 2. Otherwise, raise error
condition, since process has exceeded its maximum claim.
2. If Requesti ≤ Available, go to step 3. Otherwise Pimust wait, since
resources are not available.
Resource-Request Algorithm for Process Pi
• If safe: the resources are allocated to Pi
• If unsafe: Pi must wait, and the old resource-allocation state is restored
3. Pretend to allocate requested resources to Pi
state as follows:
Available = Available − Requesti
Allocationi = Allocationi + Requesti Needi = Needi
− Requesti
Banker’s Algorithm Example
5 processes: P0 through P4
3 resource types:
• A (10 instances), B (5 instances), and C (7
instances)
Snapshot at time
T0
Banker’s Algorithm Example
(2/2)
The content of the matrix Need is defined to be Max −
Allocation
Is the system safe? (P1, P3, P4, P2, P0) satisfies safety
criteria.
Deadlock Detection
Allow system to enter deadlock state
Detection algorithm
Recovery scheme
Single Instance of Each Resource Type
Maintain wait-for graph.
• Nodes are processes.
• Pi → Pj if Pi is waiting for Pj
.
Periodically invoke an algorithm that searches for a cycle in
the graph.
If there is a cycle, there exists a
deadlock.
An algorithm to detect a cycle in a graph requires an
O(n2)
operations, where n is the number of vertices in the
graph.
Resource-Allocation Graph and Wait-for
Graph
Resource-al ocation
graph
Corresponding Wait-for
graph
Recovery from Deadlock
Process termination
Resource preemption
Process Termination
Abort all deadlocked processes.
Abort one process at a time until the deadlock cycle is eliminated
In which order should we choose to abort?
Priority of the process.
How long process has computed, and how much longer to completion.
Resources the process has used. Resources process
needs to complete.
How many processes will need to be terminated. Is process
interactive or batch.
Resource Preemption
Selecting a victim: minimize cost
Rollback: return to some safe state, restart process for that state.
Starvation: same process may always be picked as victim, include
number of rollback in cost factor.
Summary
Four simultaneous conditions: mutual exclusion, hold and wait, no preemption,
circular wait
Deadlock prevention:
Deadlock avoidance: resource-allocation algorithm, banker’s algo- rithm
Deadlock detection: Wait-for graph
Deadlock recovery: process termination, resource preemption
POS - File Systems & Deadlocks Prevention

Más contenido relacionado

La actualidad más candente

Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCPselvakumar_b1985
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler DesignShine Raj
 
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Soumen Santra
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock GalvinSonali Chauhan
 
EULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMEULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMankita pandey
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)nikeAthena
 
I. Alpha-Beta Pruning in ai
I. Alpha-Beta Pruning in aiI. Alpha-Beta Pruning in ai
I. Alpha-Beta Pruning in aivikas dhakane
 
Answers computer networks 159334 assignment_2_2010
Answers computer networks 159334 assignment_2_2010Answers computer networks 159334 assignment_2_2010
Answers computer networks 159334 assignment_2_2010Lakshmi Gupta
 
Computer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerComputer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerDeepak John
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbiansaad symbian
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer ProtocolUjjayanta Bhaumik
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithmBasit Hussain
 
Real Time Systems & RTOS
Real Time Systems & RTOSReal Time Systems & RTOS
Real Time Systems & RTOSVishwa Mohan
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy methodhodcsencet
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query OptimizationAli Usman
 

La actualidad más candente (20)

Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
 
Three address code In Compiler Design
Three address code In Compiler DesignThree address code In Compiler Design
Three address code In Compiler Design
 
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
Traveling salesman problem: Game Scheduling Problem Solution: Ant Colony Opti...
 
TCP/IP MODEL
TCP/IP MODEL TCP/IP MODEL
TCP/IP MODEL
 
Operating System Deadlock Galvin
Operating System  Deadlock GalvinOperating System  Deadlock Galvin
Operating System Deadlock Galvin
 
Error Control In Network Layer
Error Control In Network LayerError Control In Network Layer
Error Control In Network Layer
 
EULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMEULER AND FERMAT THEOREM
EULER AND FERMAT THEOREM
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
Application layer protocols
Application layer protocolsApplication layer protocols
Application layer protocols
 
I. Alpha-Beta Pruning in ai
I. Alpha-Beta Pruning in aiI. Alpha-Beta Pruning in ai
I. Alpha-Beta Pruning in ai
 
Answers computer networks 159334 assignment_2_2010
Answers computer networks 159334 assignment_2_2010Answers computer networks 159334 assignment_2_2010
Answers computer networks 159334 assignment_2_2010
 
Computer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerComputer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link Layer
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Deadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbianDeadlock detection and recovery by saad symbian
Deadlock detection and recovery by saad symbian
 
Alpha beta
Alpha betaAlpha beta
Alpha beta
 
Simple Mail Transfer Protocol
Simple Mail Transfer ProtocolSimple Mail Transfer Protocol
Simple Mail Transfer Protocol
 
Presentation Routing algorithm
Presentation Routing algorithmPresentation Routing algorithm
Presentation Routing algorithm
 
Real Time Systems & RTOS
Real Time Systems & RTOSReal Time Systems & RTOS
Real Time Systems & RTOS
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 

Similar a POS - File Systems & Deadlocks Prevention

File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control YuvrajWadavale
 
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptxUNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptxLeahRachael
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Ahmed El-Arabawy
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Ahmed El-Arabawy
 
19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdfJESUNPK
 
Introduction to distributed file systems
Introduction to distributed file systemsIntroduction to distributed file systems
Introduction to distributed file systemsViet-Trung TRAN
 
UNIT7-FileMgmt.pptx
UNIT7-FileMgmt.pptxUNIT7-FileMgmt.pptx
UNIT7-FileMgmt.pptxNavyaKumar22
 
ITFT_File system interface in Operating System
ITFT_File system interface in Operating SystemITFT_File system interface in Operating System
ITFT_File system interface in Operating SystemSneh Prabha
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & ApplicationsMaulen Bale
 

Similar a POS - File Systems & Deadlocks Prevention (20)

File Management & Access Control
File Management & Access Control File Management & Access Control
File Management & Access Control
 
Ch10 file system interface
Ch10   file system interfaceCh10   file system interface
Ch10 file system interface
 
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptxUNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
UNIT 4-UNDERSTANDING VIRTUAL MEMORY.pptx
 
Os
OsOs
Os
 
Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1) Course 102: Lecture 26: FileSystems in Linux (Part 1)
Course 102: Lecture 26: FileSystems in Linux (Part 1)
 
Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)Course 102: Lecture 27: FileSystems in Linux (Part 2)
Course 102: Lecture 27: FileSystems in Linux (Part 2)
 
19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf19IS305_U4_LP10_LM10-22-23.pdf
19IS305_U4_LP10_LM10-22-23.pdf
 
Introduction to distributed file systems
Introduction to distributed file systemsIntroduction to distributed file systems
Introduction to distributed file systems
 
UNIT7-FileMgmt.pptx
UNIT7-FileMgmt.pptxUNIT7-FileMgmt.pptx
UNIT7-FileMgmt.pptx
 
Os7
Os7Os7
Os7
 
9781111306366 ppt ch11
9781111306366 ppt ch119781111306366 ppt ch11
9781111306366 ppt ch11
 
ITFT_File system interface in Operating System
ITFT_File system interface in Operating SystemITFT_File system interface in Operating System
ITFT_File system interface in Operating System
 
OS Unit5.pptx
OS Unit5.pptxOS Unit5.pptx
OS Unit5.pptx
 
FAT.pptx
FAT.pptxFAT.pptx
FAT.pptx
 
Thiru
ThiruThiru
Thiru
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
Unit 4 DBMS.ppt
Unit 4 DBMS.pptUnit 4 DBMS.ppt
Unit 4 DBMS.ppt
 
Unix File System
Unix File SystemUnix File System
Unix File System
 
Operating Systems & Applications
Operating Systems & ApplicationsOperating Systems & Applications
Operating Systems & Applications
 
OS UNIT4.pptx
OS UNIT4.pptxOS UNIT4.pptx
OS UNIT4.pptx
 

Más de Rohit Jain

VR - Virtual reality
VR - Virtual realityVR - Virtual reality
VR - Virtual realityRohit Jain
 
Lifi - Light Fidelity
Lifi - Light FidelityLifi - Light Fidelity
Lifi - Light FidelityRohit Jain
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligenceRohit Jain
 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsRohit Jain
 
Introduction about Processors
Introduction about Processors Introduction about Processors
Introduction about Processors Rohit Jain
 
Overview On water
Overview On waterOverview On water
Overview On waterRohit Jain
 
Advance peripheral devices
Advance peripheral devicesAdvance peripheral devices
Advance peripheral devicesRohit Jain
 

Más de Rohit Jain (9)

VR - Virtual reality
VR - Virtual realityVR - Virtual reality
VR - Virtual reality
 
Social media
Social mediaSocial media
Social media
 
Lifi - Light Fidelity
Lifi - Light FidelityLifi - Light Fidelity
Lifi - Light Fidelity
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Sutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithmsSutherlands Cohen and Hodgeman algorithms
Sutherlands Cohen and Hodgeman algorithms
 
Introduction about Processors
Introduction about Processors Introduction about Processors
Introduction about Processors
 
Overview On water
Overview On waterOverview On water
Overview On water
 
Advance peripheral devices
Advance peripheral devicesAdvance peripheral devices
Advance peripheral devices
 
Big Data
Big DataBig Data
Big Data
 

Último

Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESNarmatha D
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptNarmatha D
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfRajuKanojiya4
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptJasonTagapanGulla
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONjhunlian
 

Último (20)

Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIES
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Industrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.pptIndustrial Safety Unit-IV workplace health and safety.ppt
Industrial Safety Unit-IV workplace health and safety.ppt
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
National Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdfNational Level Hackathon Participation Certificate.pdf
National Level Hackathon Participation Certificate.pdf
 
Solving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.pptSolving The Right Triangles PowerPoint 2.ppt
Solving The Right Triangles PowerPoint 2.ppt
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTIONTHE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
THE SENDAI FRAMEWORK FOR DISASTER RISK REDUCTION
 

POS - File Systems & Deadlocks Prevention

  • 1. POS - File System & Deadlocks Presenter Rohit Jain
  • 2. File System • It is the way in which files are named and where they are placed logically for storage and retrieval. • A file system is used to control how information is stored and retrieved. • Without file system, information placed in a storage area would be one large body of information with no way to tell where one piece of information stops and the next begins. • A file system defines the structures and the rules used to read, write and maintain information stored on a disk.
  • 3. Aspects of File system • Space management • Filename • Directories • Metadata • Restricting and permitting access
  • 4. Space Management • The File system is responsible for organizing files and directories and keeping track of which areas of the media belongs to which file and which are not being used. • Slack Space • File system fragmentation occurs when unused space or single files are not contiguous. As file are deleted the space they were allocated eventually is considered available for use by other files.This created alternating used and unused areas of various sizes.
  • 5. File Names • A filename is used to identify a storage location In the file system. Most file system have restrictions on the length of filenames. In some file system filenames are case sensitive.
  • 6. Directories • File system typically have directories (folders) which allow user to group files into separate collection. • Directory structure may be linear or allow hierarchies where directory may contain sub directory.
  • 7. Metadata • Meta Data is data about data and in filesystem it is associated as bookkeeping information is typically associated with each file within a file system.The length of the data contained in a file may be stored as the number of blocks allocated for the file or as the byte count.
  • 8. Restricting and Permitting access • There are several mechanisms used by file system to control access to data. Usually the intent is to prevent reading or modifying files by user or group of users. Another reason is to ensure data is modified in a controlled way so access may be restricted to a specific program. • For Example Includes Password stored in the metadata of the file.
  • 9. Types of File System • Disk File system • Flash File system • Database file system • Network file system • Special file system
  • 10. Disk file system • A disk file system takes advantages of the ability of disk storage media to randomly address data in a short amount of time. • Additionally Consideration include the speed of accessing data following that initially requested and the anticipation that the following data may be requested. • For example ext3, NTFS, UDF etc.
  • 11. Flash file system • A flash file system considers the special abilities, performance restrictions of flash memory devices. • Frequently a disk file system can use a flash memory device as the underlying storage media but it is much better to use a file system that is Specifically designed for a flash device.
  • 12. Database File system • In this file are identified be their characteristics, like type, author or any other Rich metadata instead of hierarchical structured management.. • IBM DB2 is a database file system.
  • 13. Network File system • A network file system is a file system that acts as a client for a remote file access protocol, providing access to files on a server. • For example AFS, FTP,WebDAV.
  • 14. Shared Disk File system • A shared disk file system is one in which a number of machine all have access to the same external disk subsystem. • The file system arbitrates access to that subsystem, Preventing write collisions. • For example GFS 2 , GPFS etc.
  • 15. Special File system • A special File system presents non-file elements of an OS as files so they can be acted on using system APIs.This is most commonly done in Unix Like Operating System but devices are given file names in some non-unix-like Operating systems as well.
  • 16. File Attributes • Name • Type • Protection • Location • Size
  • 17. File Operations • Creata :- Find spaces on disk and make entyr in directory • Write : wirte to file requires positioning with ithe file • Read : read from file involves positioning within the file • Delete :- Delete Directory enry, redaim disk space • Reposition Move read / write position.
  • 18. Files access Methods • Sequential :- readNext, writenext, Reset • Direct :- readRecord N,WirteRecord N PostoionAt N, reset • Indexed :- readRecord Key,Write Record Key , PositionAt Key, reset
  • 19. File AllocationTable • Where the OS record s how the disk spece is used, • Location of FAT near the beginning og the volume • Locatoin of FAT is specified in the boot sector
  • 20. FATTypes • FAT12 :-The earliest version the file system, FAT12 allow a partition to containg up to 4096MB/ (212) clusters • FAT16 :- oldest, created for DOS, supported by most OS’s cannot be installed on partitions laeger than 2 GB, or on hard dreives larger than 4 GB • FAT32 :- Supports disk from 512MB to 2TB, compatible with windows98 upto latest.
  • 21. NTFS • NewTechnology File System • Better File Security ( Encryption File system) • Disk Compressoin – can compress a file/ folder • NTFS volmes can not be accessed by DOS
  • 22. Operating System FAT16 FAT32 NTFS Windows XP Windows 2000 Windows NT Windows 95, 98, ME Windows 95 MS-DOS
  • 23. Formatting Process • Full Format • Quick Format
  • 24. Disk Scheduling • The OS is responsible for using hardware efficiently for the disk drives • Access time Total access time = seek time + rotational delay + data transfer time Seek time – time required to move the disk arm to the required track Rotational delay – time required to rotate the disk to the required sector Data transfer time – time to read/write data from/to the disk • Disk bandwidth is the total number of bytes transferred, divided by the total time between the first request for service and the completion of last transfer. • OS maintains queue of request, per disk or device.
  • 25. Disk SchedulingAlgorithms SeveralAlgorithms exist to schedule the servicing of disk I/O requests. • FCFS • SSTF • SCAN • C-Scan • Look • C-Look Queue = 98, 183, 37, 122, 14, 124, 65, 67 Head starts at 53
  • 26. First Come First Serve • Handle I/o request Sequentially • Fair at all Processes • Approaches reandom scheduling in performance scheduling in performance if there are many processes/ request.
  • 27. Shortest SeekTime First • Selects the request with the minimum seek time from the current head position. • SSSTF scheduling is a form of SJF scheduling may cause starvation of some requests.
  • 28. SCAN • The disk arm starts at one end of the disk , and moves toward the other end, servicing requests until it get to the other end of the disk, where the head movement is reversed and servicing continues. • It moves in both directions until both ends • Tends to stay more at the ends so more fair to the extreme cylinder requests
  • 29. C-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. • Provides a more uniform wait time than SCAN; it treats all cylinders in the same manner.
  • 30. C- Look • Look version of C-Scan. • Arm only goes as far as the last request in each direction, then reverses direction immediately, without first going all the way to the end of the disk. • In general, Circular versions are more fair but pay with a larger total seek time. • Scan versions have a larger total seek time than the corresponding Look versions.
  • 31. Selecting a Disk SchedulingAlgorithm • Performance depends on the number and types of requests. • Requests for disk service can be influenced by the file-allocation method. • The disk-scheduling algorithm should be written as a separate module of the operating system, allowing it to be replaced with a different algorithm if necessary. • With low load on the disk, It’s FCFS anyway. SSTF is common and has a natural appeal – good for medium disk load.
  • 32. • SCAN and C-SCAN perform better for systems that place a heavy load on the disk; Less starvation. • Either SSTF or LOOK is a reasonable choice for the default algorithm.
  • 33. Dead Lock • Deadlock: processes waiting indefinitely with no chance of making progress. • Starvation: a process waits for a long time to make progress.
  • 34. Deadlocks • Deadlock applications not just OS – Network • Two processes may be blocking a send message to the other process if they are both waiting for a message from the other process » Receive/waiting blocks writing – Databases. – Spooling/streaming data.
  • 35. Deadlock Characterization • Mutual exclusion: Only one process at a time can use a resource. • Hold and wait: A process holding at least one resource is waiting to acquire additional resources held by other processes. • No preemption: A resource can be released only voluntarily by the process holding it, after that process has completed its task. • Circular wait: there exists a set {P0, P1, …, P0} of waiting processes such that P0 is waiting for a resource that is held by P1, P1 is waiting for a resource that is held by P2, …, Pn–1 is waiting for a resource that is held by Pn, and P0 is waiting for a resource that is held by P0.
  • 36. Resource-Allocation Graph • V is partitioned into two types: – P = {P1, P2, …, Pn}, the set consisting of all the processes in the system. – R = {R1, R2, …, Rm}, the set consisting of all resource types in the system. request edge – directed edge P1  Rj assignment edge – directed edge Rj  Pi • • A set of vertices V and a set of edges E.
  • 37. Resource-Allocation Graph • Process • Resource Type with 4 instances • Pi requests instance of Rj • Pi is holding an instance of Rj Pi Rj Pi Rj
  • 38. Example of a Resource Allocation Graph
  • 39. Resource Allocation Graph With A Deadlock
  • 40. Basic Facts • If graph contains no cycles  no deadlock. • If graph contains a cycle  – if only one instance per resource type, then deadlock. – if several instances per resource type, possibility of deadlock.
  • 41. Methods for Handling Deadlocks • Ensure that the system will never enter a deadlock state. • Allow the system to enter a deadlock state and then recover. • Ignore the problem and pretend that deadlocks never occur in the system; used by most operating systems, including UNIX.
  • 42. Deadlock Prevention • Mutual Exclusion – not required for sharable resources; must hold for nonsharable resources. • Hold and Wait – must guarantee that whenever a process requests a resource, it does not hold any other resources. – Require process to request and be allocated all its resources before it begins execution, or allow process to request resources only when the process has none. – Low resource utilization; starvation possible.
  • 43. Deadlock Prevention • No Preemption – – If a process that is holding some resources requests another resource that cannot be immediately allocated to it, then all resources currently being held are released. – Preempted resources are added to the list of resources for which the process is waiting. – Process will be restarted only when it can regain its old resources, as well as the new ones that it is requesting. • Circular Wait – impose a total ordering of all resource types, and require that each process requests resources in an increasing order of enumeration.
  • 44. Deadlock Avoidance • Simplest and most useful model requires that each process declare the maximum number of resources of each type that it may need. • The deadlock-avoidance algorithm dynamically examines the resource-allocation state to ensure that there can never be a circular-wait condition. • Resource-allocation state is defined by the number of available and allocated resources, and the maximum demands of the processes. Requires that the system has some additional a priori information available.
  • 45. Banker’s Algorithm Multiple instances Each process must a priori claim of the maximum use. When a process requests a resource it may have to wait. When a process gets all its resources, it must return them in a finite amount of time.
  • 46. Data Structures for Banker’s Algorithm n = number of processes, and m = number of resources types Available: vector of length m. • If Available[j ] = k, there are k instances of resource type Rj available. Max: n × m matrix. • If Max[i , j ] = k, then process Pi may request at most k instances of resource type Rj . Allocation: n × m matrix. • If Allocation[i , j ] = k then Pi is currently allocated k instances of Rj . Need: n × m matrix. • If Need[i , j ] = k, then Pi may need k more instances of Rj to complete its task Need[i , j ] = Max[i , j ] − Allocation[i , j ]
  • 47. Resource-Request Algorithm for Process Pi Requesti= request vector for process Pi . If Requesti [j ] = k, then process Pi wants k instances of resource type Rj . 1. If Requesti ≤ Needi , go to step 2. Otherwise, raise error condition, since process has exceeded its maximum claim. 2. If Requesti ≤ Available, go to step 3. Otherwise Pimust wait, since resources are not available.
  • 48. Resource-Request Algorithm for Process Pi • If safe: the resources are allocated to Pi • If unsafe: Pi must wait, and the old resource-allocation state is restored 3. Pretend to allocate requested resources to Pi state as follows: Available = Available − Requesti Allocationi = Allocationi + Requesti Needi = Needi − Requesti
  • 49. Banker’s Algorithm Example 5 processes: P0 through P4 3 resource types: • A (10 instances), B (5 instances), and C (7 instances) Snapshot at time T0
  • 50. Banker’s Algorithm Example (2/2) The content of the matrix Need is defined to be Max − Allocation Is the system safe? (P1, P3, P4, P2, P0) satisfies safety criteria.
  • 51. Deadlock Detection Allow system to enter deadlock state Detection algorithm Recovery scheme
  • 52. Single Instance of Each Resource Type Maintain wait-for graph. • Nodes are processes. • Pi → Pj if Pi is waiting for Pj . Periodically invoke an algorithm that searches for a cycle in the graph. If there is a cycle, there exists a deadlock. An algorithm to detect a cycle in a graph requires an O(n2) operations, where n is the number of vertices in the graph.
  • 53. Resource-Allocation Graph and Wait-for Graph Resource-al ocation graph Corresponding Wait-for graph
  • 54. Recovery from Deadlock Process termination Resource preemption
  • 55. Process Termination Abort all deadlocked processes. Abort one process at a time until the deadlock cycle is eliminated In which order should we choose to abort? Priority of the process. How long process has computed, and how much longer to completion. Resources the process has used. Resources process needs to complete. How many processes will need to be terminated. Is process interactive or batch.
  • 56. Resource Preemption Selecting a victim: minimize cost Rollback: return to some safe state, restart process for that state. Starvation: same process may always be picked as victim, include number of rollback in cost factor.
  • 57. Summary Four simultaneous conditions: mutual exclusion, hold and wait, no preemption, circular wait Deadlock prevention: Deadlock avoidance: resource-allocation algorithm, banker’s algo- rithm Deadlock detection: Wait-for graph Deadlock recovery: process termination, resource preemption

Notas del editor

  1. By separating the information into individual pieces and giving each piece a name, the information is easily separated and identified. Taking its name from the way paper based information system are named, each piece of information is called a “file” The structure and logic rules used to manage the groups of information their names is called a “file system”. Different structure and logic, properties of speed, flexibility, security, size. Iso file system of disk Different storage devices with differene media. Hard drive is coated with magnetic film. File system are used to implement type of data store, retrieve and update. File system referse to either he abstract data structures used to define files, actual software or firmware.
  2. When a file is created and there is not an area of contiguous space available for its initial allocation the space must be assigned in fragments. When a file is modified such that it becomes larger it may exceed the space initially allocated to it, another allocation must be assigned elsewhere and the file becomes fragmented.
  3. Modern File system have wide range of chatacter.
  4. File system might store the file creation time, the time it was last modified or the last time it was backed up. Other information can include the file's device type (e.g. block, character, socket, subdirectory, etc.), its owner user ID and group ID, its access permissions and other file attributes (e.g. whether the file is read-only, executable, etc.).
  5. Methods for encrypting file data are sometimes included in the file system. This is very effective since there is no need for file system utilities to know the encryption seed to effectively manage the data.
  6. Name :- Provide Handle for reference Dos (8 char + 3 ext.), Windows ( unlimited Length) Unix ( spaces tricky, no extension needed) Type:- Indicates how the file should be treated DOS/Windows rely on extension, can map extensions to programs Mac associates creator attribute with each file (OS X?) UNIX uses "magic number", first few bytes of file specify file type For example MS-DOS Filsnames Name 1 to 8 char Extension 1 to 3 char Dos only uses uppercase without spaces and special character.
  7. Recovery features-each file operation broken down into atomic transactions. maintains a transaction log – updates disk after each transaction if failure occurs during a transaction, info is sufficient to complete or rollback if a bad sector is found when writing, will automatically map to a different sector
  8. Full Format lays down new tracks and sectors, Verifies the integrity of each sector. By doing a surface scan – OS will put dummy data into sectors and then try to read the sector Quick Format: - Remove files Does not check for defective sectors
  9. 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.