0% found this document useful (0 votes)
37 views

Computer Disk

About Computer Hard disk

Uploaded by

Dipak Show
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Computer Disk

About Computer Hard disk

Uploaded by

Dipak Show
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Disk Drives

Hard Disk Geometry


• Platters
• Two-sided magnetic material
• 1-16 per drive, 3,000 – 15,000 RPM
• Tracks
• Concentric rings bits laid out serially
• Divided into sectors (addressable)
• Cylinders
• Same track on each platter
• Arms move together
• Operation
• Seek: move arm to track
• Read/Write:
– wait till sector arrives under head
– Transfer data
Moving-head Disk Mechanism
Hard Disk Drives
• Manufactured in clean room
• Permanent, air-tight enclosure
• “Winchester” technology
• Spindle motor integral with shaft
• “Flying heads”
• Aerodynamically “float” over moving surface
• Velocities > 100 meters/sec
• Parking position for heads during power-off
• Excess capacity
• Sector re-mapping for bad blocks
• Managed by OS or by drive controller
• 20,000-100,000 hours mean time between failures
Logical vs. Physical Sector Addresses
• Some disk controllers convert
[cylinder, track, sector]
addresses into logical sector numbers
– Linear array
– No gaps in addressing
– Bad blocks concealed by controller
• Reason:
– Backward compatibility with older PC’s
– Limited number of bits in C, T, and S fields
Disk Drive – Performance
• Seek time
– Position heads over a cylinder – 1 to 25 ms
• Rotational latency
– Wait for sector to rotate under head
– Full rotation - 4 to 12 ms (15000 to 5400 RPM)
– Latency averages ½ of rotation time
• Transfer Rate
– approx 40-380 MB/sec (aka bandwidth)
• Transfer of 1 Kbyte
– Seek (4 ms) + rotational latency (2ms) + transfer = 6.04 ms
– Effective BW here is about 170 KB/sec
Disk Reading Strategies
• Read and cache a whole track
• Automatic in some controllers
• Subsequent reads to same track have zero
rotational latency – good for locality of reference!
• Disk arm available to seek to another cylinder
• Start from current head position
• Start filling cache with first sector under head
• Signal completion when desired sector is read
• Start with requested sector
• When no cache, or limited cache sizes
Disk Writing Strategies
• There are none
• The best one can do is
– collect together a sequence of contiguous (or nearby) sectors
for writing
– Write them in a single sequence of disk actions
• Caching for later writing is (usually) a bad idea
– Application has no confidence that data is actually written
before a failure
– Some network disk systems provide this feature, with battery
backup power for protection
• Some disks have microcontrollers which do bad block re-
mapping, track caching
• Some disk controllers are capable of doing more then one
seek at a time, i.e. they can read on one disk while writing
on another
• Real disk geometry is different from geometry used by
driver, since controller has to re-map request for
(cylinder, head, sector) onto actual disk
• Disks are divided into zones, with fewer sector at the
inner side, gradually progressing to more on the outer
side
Disk Zones

Disks are divided into zones, with fewer sector at the inner side, gradually progressing to
more on the outer side. It creates more space on disk.

(a) Physical geometry of a disk with two zones.


A graphical illustration of zoned bit recording. This
model hard disk has 20 tracks. They have been
divided into five zones, each of which is shown as a
different color. The blue zone has 5 tracks, each with
16 sectors; the cyan zone 5 tracks of 14 sectors
each; the green zone 4 tracks of 12 sectors; the
yellow 3 tracks of 11 sectors, and the red 3 tracks of
9 sectors. You can see that the size (length) of a
sector remains fairly constant over the entire
surface of the disk If not for ZBR, if the inner-most
zone had its data packed as densely as possible,
every track on this hard disk would be limited to
only 9 sectors, greatly reducing capacity.
One interesting side effect of this design is that the raw data transfer rate (sometimes called the
media transfer rate) of the disk when reading the outside cylinders is much higher than when
reading the inside ones. This is because the outer cylinders contain more data, but the angular
velocity of the platters is constant regardless of which track is being read . Since hard disks are
filled from the outside in, the fastest data transfer occurs when the drive is first used.
Fragmentation
• Disk storage becomes fragmented over time just like main memory.
• A fragmented file is not located in contiguous disk sectors. This
slows access time.
Logical Block Addressing
• Prior to the advent of Logical Block Addressing, all hard drives were
accessed via CHS (Cylinder, Head, Sector) or Extended CHS, which
means that the drive was accessed by specifying its cylinder, head
and sector address. More appropriately, it was referred to as
accessing the drive through its "geometry".
• By contrast, logical block addressing (LBA) involves a completely new
method of addressing sectors. LBA was first developed around SCSI
hard drives. With LBA, instead of referring to a drives cylinder, head
and sector number geometry in order to access or "address" it, each
sector is assigned a unique "sector number". In essence, LBA is a
means by which a drive is accessed by linearly addressing sector
addresses, beginning at sector 1 of head 0, cylinder 0 as LBA 0, and
proceeding on in sequence to the last physical sector on the drive,
which, for instance, on a standard 540 Meg drive would be LBA
1,065,456.
Disk Performance - Bandwidth
• “Seek Time” – (Average) Time Required to Position R/W Head Over
a Track/Sector (5-15 ms)
• “Rotational Latency” – After Seek Wait for Sector to be Under R/W
Head
Typical Disks Rotate at 3600, 5400, 7200, 10800 RPM
Average Rotational Latency = ½ Rotation (4-8ms)
• “Transfer Time” – Time for 1 Sector of Data to be Read/Written
After Seek and Rotational Latency (25-50ms)
• “Access Time” is Sum of Above – Dominated by Seek and
Rotational Latency
Disk Interfaces and Protocol
A protocol can easily be thought of as a set of commands and rules of communication.
Disk drives, solid-state media, and storage arrays speak a protocol. (Disk arrays often speak
multiple protocols.) However, in the storage world, each protocol often has its own physical
interface specifications as well, meaning that protocol can also relate to the physical interface
of a drive. For example, a SATA drive speaks the SATA protocol and also has a physical SATA
interface. The same goes for SAS and FC; each has its own interface and protocol.
The four most common protocols and interfaces in the disk drive world are as follows:
• Serial Advanced Technology Attachment (SATA)
• Serial Attached SCSI (SAS)
• Nearline SAS (NL-SAS)
• Fibre Channel (FC)

SATA has its roots in the low end of the computing market such as desktop PCs and laptops.
In enterprise tech, SATA drives are synonymous with cheap, low performance, and high capacity.
The major reason for this is that the ATA command set is not as rich as the SCSI command set,
and as a result not as well suited to high-performance workloads.
However, the enterprise tech world is not all about high performance. There is absolutely
a place for low-cost, low-performance, high-capacity disk drives. Some examples are backup
and archiving appliances, as well as occupying the lower tiers of auto-tiering solutions in
storage arrays. However, most of these requirements are now satisfied by NL-SAS drives
rather than SATA.
SAS is, as the name suggests, a serial point-to-point protocol that uses the SCSI command set
and the SCSI advanced queuing mechanism. SCSI has its roots firmly in the high-end enterprise
tech world, leading to it have a richer command set, better queuing system, and often better
physical component quality than SATA drives. All this tends to make SCSI-based drives, such as
SAS and FC, the best choice for high-performance, mission-critical workloads. SAS drives can be
formatted with arbitrary sector sizes, allowing them to easily implement EDP (sometimes called
DIF). With EDP, 520-bye sectors are used instead of 512-bye sectors. The additional 8 bytes per
sector are used to store metadata that can ensure the integrity of the data, making sure that it
hasn’t become corrupted.
FC drives implement the SCSI command set and queuing just like SAS, but have dual FC-AL or
dual FC point-to-point interfaces. They too are suited to high-performance requirements and
come at a relatively high cost per gigabyte, but are very much being superseded by SAS drives.
Near line SAS (NL-SAS) drives are a hybrid of SAS and SATA drives. They have a SAS interface
and speak the SAS protocol, but also have the platters and RPM of a SATA drive.
What’s the point? Well, they slot easily onto a SAS backplane or connector and provide
the benefits of the SCSI command set and advanced queuing, while at the same time
offering the large capacities common to SATA. All in all, it is a nice blend of SAS and
SATA qualities.
All disk drives implement a technique known as queuing. Queuing has a positive impact on
performance. Queuing allows the drive to reorder I/O operations so that the read and write
commands are executed in an order optimized for the layout of the disk. This usually results
in I/O operations being reordered so that the read and write commands can be as sequential
as possible so as to inflict the least head movement and rotational latency as possible.
The ATA command set implements Native Command Queuing (NCQ). This improves
the performance of the SATA drive, especially in concurrent IOPS, but is not as powerful
as its cousin Command Tag Queuing in the SCSI world.
IOPS is an acronym for input/output operations per second and is pronounced eye-ops.
There are several types of I/O operations. Here are the most important:
• Read
• Write
• Random
• Sequential
• Read and Write IOPS
Read and write IOPS should be simple to understand. You click Save on the document you
are working on, and your computer saves that file to disk via one or more write IOPS. Later
when you want to open that document to print it, your computer reads it back from disk via
one or more read IOPS.
Mechanical disk drives thrive on sequential workloads but hunt like a lame dog when it comes
random workloads. There isn’t much you can do about that without getting into complicated
configurations that are pointless in a world where solid state is so prevalent.
Cache-hit IOPS, sometimes referred to as cached IOPS¸ are IOPS that are satisfied from cache
rather than from disk. Because cache is usually DRAM, I/O operations serviced by cache are
like greased lightning compared to I/O operations that have to be serviced from disk.
The overall response time is the sum of the seek time, rotational delay, transfer time, and
overhead.
Assume a disk has the following specifications.
An average seek time of 9ms,A 5400 RPM rotational speed, A 10MB/s average transfer rate,2ms
of overheads.

How long does it take to read a random 1,024 byte sector?

The average rotational delay is 5.55ms. (0.5 rotations / (5400 rotations/minute) = 5.55ms)

The transfer time will be about (1024 bytes / 10 MB/s) = 0.1ms

The response time is then 9ms + 5.55ms + 0.1ms + 2ms = 16.7ms

That’s 16,700,000 cycles for a 1GHz processor!

One possible measure of throughput would be the number of random sectors that can be read
in one second.
(1 sector / 16.7ms) x (1000ms / 1s) = 60 sectors/second
Calculating Disk Drive IOPS
A quick and easy way to estimate how many IOPS a disk drive should be able to service is
to use this formula:
1 / (x + y) × 1,000
where x = average seek time, and y = average rotational latency
A quick example of a drive with an average seek time of 3.5 ms and an average rotational
latency of 2 ms gives us an IOPS value of 181 IOPS:
1 / (3.5 + 2) × 1,000 = 181.81
This works only for spinning disks and not for solid-state media or disk arrays with large caches.
Maximum transfer rate : It is usually used to express the absolute highest possible transfer rate
of a disk drive (throughput or MBps) under optimal conditions. It often refers to burst rates that
cannot be sustained by the drive. Take these numbers with a pinch of salt. A better metric is
sustained transfer rate (STR). STR is the rate at which a disk drive can read or write sequential
data spread over multiple tracks. Because it includes data spread over multiple tracks, it
incorporates some fairly realistic overheads, such as R/W head switching and track switching.
This makes it one of the most useful metrics for measuring disk drive performance.
The following is an example of the differences between maximum transfer rate and
sustained transfer rate from a real-world disk drive spec sheet for a 15K drive:
• Maximum: 600 MBps
• Sustained: 198 MBps
Consider a 5.25 inch disk with 16 double-surfaced platters rotating at 5280 rpm. It has a usable
capacity of 16 gigabytes (2**34 bytes) stored on 1024 cylinders. Assume 12% of each track is
used as overhead.
1. What is the sustained bandwidth this disk could support reading an entire track?
#Bytes/Track = Capacity / (#cylinders * #platters * 2)
= 2**34 / (2**10 * 2**4 * 2)
= 2**19 Bytes
Time/revolution = 1/5280 minute
= 1/88 second
SB = bytes per track / time per revolution
= 2**19 bytes / (1/88) seconds
= 2**19 * 88 B/s
= (2**19 * 88) / (2**20) MB/s
= 44 MB/s
2. What is the average rotational latency, assuming it is not necessary to start about the
beginning of the track?
Avg. rotational latency = 0.5 * time per revolution
= 0.5 * (1/88) seconds
= 5.68ms
3. Assuming the average seek time is 10 ms, what is the average time to fetch a 4-Kbyte (2**12
bytes) sector?
Transfer time = (2**12)*1000/(88* 2**19) ms = 0.089 ms
Fetch time = seek time + avg. rotational time + transfer time
= 10 + 5.68 + 0.089 = 15.769 ms

You might also like