OS - Chapter 6 Secondary Storage Structure - Disk ManagementUpdated
OS - Chapter 6 Secondary Storage Structure - Disk ManagementUpdated
•Disk Management
Overview of Mass-Storage Structure
•FCFS
•SSTF
•SCAN
•C-SCAN
•LOOK
•C-LOOK
Criteria of Disk Scheduling Algorithms
1.Transfer time: It is the time taken to transfer the data from the
disk to the application.
2. Seek time is the time taken by the arm to move to the required
track.
3. Rotational latency is defined as the time taken by the arm to
reach the required sector in the track.
4. Disk access time: It is the total time required to access the
data. It means total time required to read/write the data from the
disk.
Disk access time= Seek time+ Rotational latency+ Transfer time
•Disk Response Time:
•Response Time is the average of time spent by a
request waiting to perform its I/O operation.
•Average Response time is the response time of the
all requests.
•Variance Response Time is measure of how
individual request are serviced with respect to
average response time.
•So the disk scheduling algorithm that gives
minimum variance response time is better.
First Come First Serve [FCFS] Disk
Scheduling Algorithms
•This algorithm performs requests in the same order
asked by the system.
•Let's take an example where the disk queue has the
following I/O requests with cylinder numbers as
follows:
•Ex: 98, 183, 37, 122, 14, 124, 65, 67
•Assume the head is initially at cylinder 56. The head
moves in the given order in the queue
i.e., 56→98→183→...→67.
First Come First Serve Disk Scheduling
Algorithms
56-65 9
65-67 2
67-37 30
37-14 23
14-98 84
98-122 24
122-124 2
124-183 59
Total Head Movement 233
= (60-50)+(79-60)+(92-79) +(114-92)+(176-114)+(199-
176)+(199-0) +(11-0)+(34-11)+(41-34) = 389
C-LOOK Disk Scheduling Algorithm
Therefore, the total seek count = (60 – 50) + (79 – 60) + (92 – 79) +
(114 – 92) + (176 – 114) + (176 – 11) + (34 – 11) + (41 – 34) = 321
Practice Problem Ex 3
Consider a disk queue with I/O request on the following
cylinders in their arriving order:
54,97,73,128,15,44,110,34,45
6,10,12,54,97,73,128,15,44,110,34,45
OR
Consider a disk queue with requests for I/O to blocks on cylinders 98, 183, 41, 122, 14, 124, 65, 67. The LOOK
scheduling algorithm is used. The head is initially at cylinder number 53 moving towards larger cylinder numbers on its
servicing pass. The cylinders are numbered from 0 to 199. Count total head movement (in number of cylinders)
incurred while servicing these requests.
RAID
(Redundant Arrays of Independent Disks)
1. RAID-0 (Stripping)
2. RAID-1 (Mirroring)
3. RAID-4 (Block-Level Stripping with Dedicated
Parity)
4. RAID-5 (Block-Level Stripping with Distributed
Parity)
5. Nested RAID levels(1+0)
Youtub video for RAID
https://www.youtube.com/watch?v=U-
OCdTeZLac
Why data redundancy?
•In this level, an entire block of data is written onto data disks
and then the parity is generated and stored on a different disk.
•Note that level 3 uses byte-level striping, whereas level 4 uses
block-level striping.
•Both level 3 and level 4 require at least three disks to
implement RAID.
How to calculate parity?
•Parity can be calculated using an XOR function.
•If the data bits are 0,0,0,1 then the parity bits is XOR(0,0,0,1) = 1.
•If the parity bits are 0,0,1,1 then the parity bit is XOR(0,0,1,1)= 0.
•That means, even number of one results in parity 0 and an odd number
of one results in parity 1.
C1 C2 C3 C4 Parity
0 1 0 0 1
0 0 1 1 0
In the above table, if C2 is lost due to some disk failure, then using the
values of all the other columns and the parity bit, we can recompute the
data bit stored in C2.
RAID Level 5
•RAID 5 writes whole data blocks onto different
disks and the parity bits generated for data block
stripe are distributed among all the data disks
rather than storing them on a different dedicated
disk.
Nested RAID levels(1+0)
•Some RAID levels are referred to as nested RAID
because they are based on a combination of RAID
levels, such as RAID 10 (1+0)
•This level Combines RAID 1 and RAID 0 in a single
system, which offers higher performance than RAID 1,
but at a much higher cost.
•This is a nested or hybrid RAID configuration. It
provides security by mirroring all data on secondary
drives while using striping across each set of drives to
speed up data transfers.
•This is also called as “stripe of mirrors”
•Excellent redundancy ( as blocks are mirrored )
•Excellent performance ( as blocks are striped
•Minimum 4 disks.
Disk Attachment
• Disk storage- accessed by computers via
I/O ports called host attached storage
• Network attached storage- access is done
via remote host.
Host-attached Storage