Module 6
Device Subsystems
External storage systems: Solid state drivers - Organization and
Structure of disk drives: Electronic- magnetic and optical technologies -
Reliability of memory systems - Error detecting and error correcting
systems - RAID Levels - I/O Performance
What is a Storage Device?
• According to Oxford Dictionary
A piece of computer equipment on which information
can be stored.
External Storage Systems
• The Semi-conductor memories (Flash, RAM, EEPROM) are limited to
small capacity storage.
• Secondary storage -> Store large amount of data.
• Secondary storage devices included:-
• Magnetic Disk (Hard Disk).
• CD, DVD (Optical Drive).
• Magnetic Tapes.
Magnetic Disk
• Several disks are placed in a spindle.
• Magnetic film is coated on both sides
of the disk.
• The rotary drive is used in which the
disk is placed.
• The read write head is in closed
proximity with the surface of the disk.
• The head consists of the magnetic
yoke and coil.
Magnetic Disk
• Several disks are placed in a spindle.
• Magnetic film is coated on both sides
of the disk.
• The rotary drive is used in which the
disk is placed.
• The read write head is in closed
proximity with the surface of the disk.
• The head consists of the magnetic
yoke and coil.
Magnetic Disk
• A pulse of electric current of suitable polarity is applied to the coil to
store digital information.
• Upon applying the current, the film is magnetized and switch its
direction parallel to the applied field.
• The change of magnetic field between the head and the movement
of the film causes a voltage in the coil, thus the coil acts as a sensing
agents.
• A control circuit monitored the polarity of this voltage.
Magnetic Disk
• The voltage is caused in the head only when the transitions of 0-1 or 1-
0 occurs.
• Clock is used for synchronization to read information of long bit
stream. Clocking information is combine with the data.
• Example: Encoding schemes such as Phase or Manchester encoding.
Clocking
information at
midpoint of
each bit
Dr. P. L. Thangkhiew, VIT Chennai
Winchester Hard Disk
• It is a sealed unit that is developed by IBM in Winchester (USA).
• It consists of more platter.
• When the disk is spinning, the head is not contact with the surface.
• A very small gap is maintained between the disk and the head.
• When power is switched off the head rest gently on the disk,
• Robust.
• Error Correction is automated.
• Remapping of bad sectors
Advantages
• It is used widely.
• Price is cheap.
• The speed is relatively fast as compared to its predecessor.
• The size is getting larger with times.
• 1TB and 2TB is relatively prevalent nowadays.
Parts of the disk system
• Disk Platter – The disk itself.
• Disk drive – This is used to spin the disk and moves the R/W heads.
• Disk Controller
• Circuit to handle the operation of the disk.
• Can be implemented as a separate module.
Organization
• Division is as follow
• Surface -> Concentric Track ->
Sectors
• Logical cylinder
• Disk stacks together -> set of
the corresponding tracks.
• Data accessed
• Which surface? Surface
Number
• Which Track? Track Number
• Which Sector? Sector Number
• Initially the R/W starts at the
boundaries of the sector.
Sector Head & Error Code Checking
• Storage of bits- Serially on each track. Sector size ~ 512 bytes.
• Sector header includes:
• Identification information.
• Sector header – Used to go to the intended sector on the track.
• Error checking code (ECC)-
• Error detection and correction.
• Initially the disk is unformatted and has no information in it.
• Upon Formatting:-
• The disk is divided into track and sectors.
• The bad sectors on tracks are identified by the disk controller to keep such records.
Organization
• Disk -> Logical partitions
• Primary partition
• Secondary partition
• Same number of sectors on each track.
• Which mean all track have same capacity of storage.
• Inner track is more densely packed.
Access Time
• The two parameters are used to calculate the time elapse to receive an
address and the starting of the data transfer.
• Seek time – The total time required for the head to move to the desired
track.
• Rotation time – Time taken for one full rotation (3600) = 60/rotational
speed
• Rotational delay / Latency time - The time taken to be in the address
sector after the R/W head is placed in the right track.
(= Half of Rotation time of the disk).
• Transfer time = Amount of data transferred/Transfer Rate
• Transfer rate = #heads x Capacity of a track x #rotations/sec
• Access Time = Seek Time + Latency + Transfer time
Problem 1 : Capacity
•A disk has the following specification
•# of Surface (S)= 8
•# of Tracks on each surface (T)= 64 T/S,
•# of Sectors on each tracks (Sec)= 128 Sec/T
•# of Bytes on each sector (B) = 512 B/Sec.
•Total Capacity = S * T * Sec * B
= 8 * 64 * 128 * 512
=23 * 26 * 27 * 29
= 225 Bytes = 32 MB
Problem 2: Data Transfer Rate
▪ Number of Heads = Number of Surface =
• Consider 8
• Disk is rotating at 3600 rpm ▪ Capacity of one track = Sec * B = 128 *
• Su= 8 surfaces 512
• T= 64 tracks per surface, ▪ Number of rotation in one sec = (3600 /
• Sec= 128 sectors per track 60) rotations per sec.
• B= 512 bytes per sector. ▪ 60 rotations/sec
• Data Transfer Rate ▪ Data Transfer Rate = 8 * (128 * 512) * 60
= # of Head * Total Capacity of a bytes/sec
track * # of rotations in 1 sec.
▪ 23 * 27 * 29 * 60 bytes/sec.
▪ 219 * 2 * 30 = 30 MBps
Magnetic Disks (Cont.)
Consider a disk pack with the following specifications- 16 surfaces,
128 tracks per surface, 256 sectors per track and 512 bytes per
sector.
Answer the following questions-
• What is the capacity of disk pack?
• What is the number of bits required to address the sector?
• If the format overhead is 32 bytes per sector, what is the
formatted disk space?
• If the disk is rotating at 3600 RPM, what is the data transfer rate?
• If the disk system has rotational speed of 3000 RPM, what is the
average rotational latency?
Magnetic Disks (Cont.)
• Solution
• Given
• Number of surfaces = 16
• Number of tracks per surface = 128
• Number of sectors per track = 256
• Number of bytes per sector = 512 bytes
• Capacity of Disk Pack-
• Capacity of disk pack
• = Total number of surfaces x Number of tracks per surface x
Number of sectors per track x Number of bytes per sector
• = 16 x 128 x 256 x 512 bytes = = 228 bytes == 256 MB
Magnetic Disks (Cont.)
Number of Bits Required To Address Sector-
Total number of sectors
= Total number of surfaces x Number of tracks per
surface x Number of sectors per track
= 16 x 128 x 256 sectors = = 219 sectors
Thus, Number of bits required to address the sector = 19 bits
•
Magnetic Disks (Cont.)
Formatted Disk Space-
Formatting overhead
= Total number of sectors x overhead per sector
= 219 x 32 bytes
= 219 x 25 bytes
= 224 bytes
= 16 MB
Now, Formatted disk space
= Total disk space – Formatting overhead
= 256 MB – 16 MB
= 240 MB
Magnetic Disks (Cont.)
Data Transfer Rate-
Number of rotations in one second
= (3600 / 60) rotations/sec
= 60 rotations/sec
Now, Data transfer rate
= Number of heads x Capacity of one track x Number of
rotations in one second
= 16 x (256 x 512 bytes) x 60
= 24 x 28 x 29 x 60 bytes/sec
= 60 x 221 bytes/sec
= 120 MBps
Magnetic Disks (Cont.)
Average Access Time-
Time taken for one full rotation
= (60 / 3000) sec
= (1 / 50) sec
= 0.02 sec
= 20 msec
Average rotational delay
= 1/2 x Time taken for one full rotation
= 1/2 x 20 msec
= 10 msec
Problem
A certain moving arm disk storage with one head has the following specifications-
Number of tracks per surface = 200
Disk rotation speed = 2400 RPM
Track storage capacity = 62500 bits
What is the average latency (or) rotational delay ,data transfer rate?
Solution
Time Taken For One Full Rotation-
Time taken for one full rotation
= (60 / 2400) sec = = (1 / 40) sec == 0.025 sec== 25 msec
Average Latency-
Average latency or Average rotational latency
= 1/2 x Time taken for one full rotation
= 1/2 x 25 msec== 12.5 msec
Problem
• Data Transfer Rate-
• Data transfer rate
• = Number of heads x Capacity of one track x Number of rotations in one
second
• = 1 x 62500 bits x (2400 / 60)
• = 2500000 bits/sec
• = 2.5 x 106 bits/sec
Problem
• A hard disk system has the following parameters :
• Number of tracks = 500
• Number of sectors/track = 100
• Number of bytes /sector = 500
• Time taken by the head to move from one track to adjacent track = 1 ms
• Rotation speed = 600 rpm.
• What is the average time taken for transferring 250 bytes from the disk ?
• Solution
• time taken by the head to move from one track to adjacent track = t units and there
are total k tracks, then-
• Average seek time
• = { Time taken to move from track 1 to track 1 + Time taken to move from track 1 to
last track } / 2
• = { 0 + (k-1)t } / 2
• = (k-1)t / 2
Solution
• Explanation: Avg. time to transfer = Avg. seek time + Avg. rotational
delay + Data transfer time
• Avg Seek Time – time taken to move from 1st track to 1sr track :
0ms, 1st to 2nd : 1ms, 2ms, 3ms,….499ms
Avg Seek time =( ∑0+1+2+3+…+499)/500 = 249.5 ms
• Avg Rotational Delay – RMP : 600 , 600 rotations in 60 sec (one Rotation
= 60/600 sec = 0.1 sec) So, Avg Rotational Delay = 0.1/2= 50 ms
• Data Transfer Time: In One 1 Rotation we can read data on one track =
100 * 500 = 50,000 B data is read in one rotation. 250 bytes -> 0.1 * 250
/ 50,000 = 0.5 ms
• Therefore ATT = 249.5+50+0.5 = 300 ms
Problem
• A hard disk has 63 sectors per track, 10 platters each with 2 recording
surfaces and 1000 cylinders.
• The address of a sector is given as a triple (c, h, s) where c is the cylinder
number, h is the surface number and s is the sector number. Thus, the 0th
sector is addressed as (0,0,0), the 1st sector as (0,0,1) and so on.
• The address <400, 16, 29> corresponds to sector number-?
• The address of 1039 sector is-?
Given:
•Sectors per track = 63
•Platters = 10 → Surfaces (heads) = 10 × 2 = 20
•Cylinders = 1000
Sectors per cylinder:
20 × 63 = 1260
1. Find sector number for ⟨400, 16, 29⟩
Sector number = 𝑐 × sectors per cylinder + ℎ × sectors per track + 𝑠
Substitute:
= 400 × 1260 + 16 × 63 + 29
•400 × 1260 = 504000
•16 × 63 = 1008
= 504000 + 1008 + 29 = 505037
Sector number = 505037
2. Find address of sector number 1039
Step 1: Find cylinder (c)
𝑐 = 1039 ÷ 1260 = 0 𝑀𝑜𝑑 𝑜𝑝𝑒𝑟𝑎𝑡𝑖𝑜𝑛
Step 2: Remaining sectors
remainder = 1039
Step 3: Find head (h)
ℎ = 1039 ÷ 63 = 16
16 × 63 = 1008
Step 4: Find sector (s)
𝑠 = 1039 − 1008 = 31
Address = ⟨0, 16, 31⟩
Exercise 1
• Consider a hard disk with a sector size of 1024 bytes, 5000 tracks per
surface, 64 sectors per track, and 8 surfaces. Storage capacity of the
disk is:
Storage capacity = 8 x 5000 x 64 x 1024 bytes = 2500 Mbytes.
Exercise 2
• Suppose that a disk is rotating at a speed of 10,000 rpm, and 120 Kbytes
of data are recorded in every track. Once the disk head reaches the
desired track, the sustained data transfer rate will be ………………
Mbytes/sec.
In a 10,000 rpm disk, one complete revolution takes 6
milliseconds.
Time taken for one rotation = 60 /10000=6ms
So, 6 msec time is required to transfer 120 Kbytes.
Thus, 1 sec time is required to transfer 120/6 Mbytes = 20 Mbytes.
Data transfer rate = 120KB/6ms = 20 x 10^6 Bytes= 20MBytes
Floppy Disks
• Shutter – opens when inserted in
the computer.
• Write protect can be enable by
opening the notch
• Tracks – closed concentric circle
• Sectors- wedge shaped sections
on the disk.
Dr. P. L. Thangkhiew, VIT Chennai
Optical Disks
• Laser beam and photodetector are used
• Encodes binary data (bits) in the form of pits and
lands.
• Pits:- 0 or OFF, No/Lack of reflection
• Lands:- 1 or ON, reflection when read.
Dr. P. L. Thangkhiew, VIT Chennai
Magnetic Tapes
• Magnetic tape primarily used for
magnetic recording.
• A thin narrow plastic film is coated with
magnetizable element.
• The concept originated in Germany in
1928.
• Examples: Tape Recorder, video tape
recorder, and on computer a tape drive.
Dr. P. L. Thangkhiew, VIT Chennai
Solid State Drives(SSD)
• SSD’s replace hard disk drives (HDDs), both as internal and external
secondary memory.
• The term solid state refers to electronic circuitry built with
semiconductors.
• An SSD is a memory device made with solid state components that
can be used as a replacement to a hard disk drive.
SSD Organization
Advantage of SSD over HDD
• High-performance input/output operations per second (IOPS):
Significantly increases performance I/O subsystems.
• Durability: Less susceptible to physical shock and vibration.
• Longer lifespan: SSDs are not susceptible to mechanical wear.
• Lower power consumption: SSDs use considerably less power than
comparable-size HDDs.
• Quieter and cooler running capabilities: Less space required, lower
energy costs, and a greener enterprise.
• Lower access times and latency rates: Over 10 times faster than the
spinning disks in an HDD
RAID Disk Arrays
• University of California-Berkeley first proposed to use multiple disks
operating in parallel to reduce access time
• It is called as Redundant Array of Inexpensive Disks (RAID).
• Basic configuration -> RAID 0 -> Data stripping -> large files into
number of pieces spread across different disks
• RAID 1- storing identical copies -> improve reliability.
RAID
Collection of physical drives-RAID
RAID-Common Characteristics
• The RAID scheme consists of seven levels,0 to 6. These levels
do not imply a hierarchical relationship but designate
different design architectures that share three common
characteristics:
1. RAID is a set of physical disk drives viewed by the operating
system as a single logical drive.
2. Data are distributed across the physical drives of an array in
a scheme known as striping, described subsequently.
3. Redundant disk capacity is used to store parity information,
which guarantees data recoverability in case of a disk failure.
Data Striping
RAID 0- Non redundant(Data Striping)
Fault tolerance in RAID (Redundant Array of Independent Disks) refers to the ability of a RAID
array to continue functioning without interruption in the event of a disk failure. It means that
even if one or more disks in the array fail, the data stored on those disks remains accessible
and the system continues to operate.
RAID 0
• Storage is grouped into logical units called strips
• This level architecture achieves parallelism but it does not include
redundancy to improve reliability.
RAID 1
RAID 2
Error Correcting Codes(ECC) such as Hamming code is calculated for corresponding bits in each disk
if a disk fails, RAID 2 can reconstruct the lost data using error-correcting bits
RAID 3
Instead of Error Corrrecting Codes Parity bits are stored in separate disk
A parity bit is an extra bit added to a group of data bits to detect errors during data transmission or storage.
RAID 3
RAID 3
• RAID Level 3: Bit-Interleaved Parity
• a single parity bit is enough for error correction, not just detection,
since we know which disk has failed
• When writing data, corresponding parity bits must also be
computed and written to a parity bit disk
• To recover data in a damaged disk, compute XOR of bits from
other disks (including parity bit disk)
• Instead of adding one parity bit per data word, Arrange multiple data
words in rows. Compute parity for each bit position (column)
RAID 4
RAID 4
Write operation requires parity information to be calculated
RAID 5
RAID Level 5
• RAID Level 5: Block-Interleaved Distributed Parity; partitions data and parity among
all N + 1 disks, rather than storing data in N disks and parity in 1 disk.
• For example, with an array of 5 disks, the parity block, labeled Pk, for logical
blocks 4k, 4k + 1, 4k + 2, 4k + 3 is stored in disk k mod 5; the corresponding
blocks of the other four disks store the 4 data blocks 4k to 4k+3.
RAID 6
RAID 6
2 parity blocks can recover from 2 disk failures
(Nested)RAID 1+0
RAID
• RAID: Redundant Arrays of Independent Disks
• disk organization techniques that manage a large numbers of disks, providing a view of a
single disk of
• high capacity and high speed by using multiple disks in parallel,
• high reliability by storing data redundantly, so that data can be recovered even if a
disk fails
• The chance that some disk out of a set of N disks will fail is much higher than the chance that
a specific single disk will fail.
• E.g., a system with 100 disks, each with MTTF of 100,000 hours (approx. 11 years), will
have a system MTTF of 1000 hours (approx. 41 days)
• Techniques for using redundancy to avoid data loss are critical with large numbers of
disks
• Originally a cost-effective alternative to large, expensive disks
• I in RAID originally stood for ``inexpensive’’
• Today RAIDs are used for their higher reliability and bandwidth.
• The “I” is interpreted as independent
Improvement of Reliability via Redundancy
• Redundancy – store extra information that can be used to rebuild information lost in a disk failure
• E.g., Mirroring (or shadowing)
• Duplicate every disk. Logical disk consists of two physical disks.
• Every write is carried out on both disks
• Reads can take place from either disk
• If one disk in a pair fails, data still available in the other
• Data loss would occur only if a disk fails, and its mirror disk also fails before the system is
repaired
• Probability of combined event is very small
• Except for dependent failure modes such as fire or building collapse or
electrical power surges
• Mean time to data loss depends on mean time to failure, and mean time to repair
• E.g. MTTF of 100,000 hours, mean time to repair of 10 hours gives mean time to data loss of
500*106 hours (or 57,000 years) for a mirrored pair of disks (ignoring dependent failure
modes)
Improvement in Performance via Parallelism
• Two main goals of parallelism in a disk system:
1. Load balance multiple small accesses to increase throughput
2. Parallelize large accesses to reduce response time.
• Improve transfer rate by striping data across multiple disks.
• Bit-level striping – split the bits of each byte across multiple disks
– In an array of eight disks, write bit i of each byte to disk i.
– Each access can read data at eight times the rate of a single disk.
– But seek/access time worse than for a single disk
• Bit level striping is not used much any more
• Block-level striping – with n disks, block i of a file goes to disk (i mod n) +
1; it uses the (i/n)th physical block of the disk to store logical block i.
– Requests for different blocks can run in parallel if the blocks reside on different
disks
– A request for a long sequence of blocks can utilize all disks in parallel
Choice of RAID Level
• Factors in choosing RAID level
– Monetary cost
– Performance: Number of I/O operations per second, and bandwidth during
normal operation
– Performance during failure
– Performance during rebuild of failed disk
• Including time taken to rebuild failed disk
• RAID 0 is used only when data safety is not important
– E.g. data can be recovered quickly from other sources
• Level 2 and 4 never used since they are subsumed by 3 and 5
• Level 3 is not used anymore since bit-striping forces single block reads
to access all disks, wasting disk arm movement, which block striping
(level 5) avoids
• Level 6 is rarely used since levels 1 and 5 offer adequate safety for
most applications
Choice of RAID Level (Cont.)
• Level 1 provides much better write performance than level 5
– Level 5 requires at least 2 block reads and 2 block writes to write a
single block, whereas Level 1 only requires 2 block writes
– Level 1 preferred for high update environments such as log disks
• Level 1 had higher storage cost than level 5
– disk drive capacities increasing rapidly (50%/year) whereas disk
access times have decreased much less (x 3 in 10 years)
– I/O requirements have increased greatly, e.g. for Web servers
– When enough disks have been bought to satisfy required rate of I/O,
they often have spare storage capacity
• so there is often no extra monetary cost for Level 1!
• Level 5 is preferred for applications with low update rate,
and large amounts of data
• Level 1 is preferred for all other applications
Consider a 4-drive, 200 GB-per-drive RAID array. What is the available
data storage capacity for each of the RAID levels 0, 1, 3, 4, 5, and 6?
• Soln:
total storage capacity= 4*200=800 GB
RAID 0 --> 4*200=800 GB
RAID 1 --> (4/2) *200=400 GB
RAID 3 --> (4-1)*200=600 GB
RAID 4 --> (4-1)*200=600 GB
RAID 5 --> (4-1)*200=600 GB
RAID 6 --> (4-2)*200=400 GB