csit 301 (blum)1 disk drives. csit 301 (blum)2 hard disk accessing seek time is the time required to...

48
CSIT 301 (Blum) 1 Disk Drives

Upload: bertha-little

Post on 22-Dec-2015

224 views

Category:

Documents


3 download

TRANSCRIPT

CSIT 301 (Blum) 1

Disk Drives

CSIT 301 (Blum) 2

Hard disk accessing

• Seek time is the time required to position the head to the selected cylinder. – Typical seek times are in milliseconds (ms)

• Latency is the wait time until the correct sector rotates past the head. – Also milliseconds.

CSIT 301 (Blum) 3

Ordering the to-do list

• Because the hard drive is slower than the processor and memory, there may be a back up of tasks for it to perform. The order in which it performs these tasks can greatly affect its efficiency.

• One ordering is a simple FIFO (first-in, first-out) ordering. The tasks (reads and writes) are queued up and the first task requested is the first task performed.

CSIT 301 (Blum) 4

More Sophisticated Orderings

• Seek-Time Optimization (a.k.a. Elevator seeking):– Seek time involves the radial positioning of the

head. The tasks are ordered based on their radial positioning to minimize seek time.

• Access-Time Optimization (a.k.a. multiple command reordering):– Takes into account both radial and angular

positioning to minimize access time which includes seek time and latency.

CSIT 301 (Blum) 5

Ordering Comparison

CSIT 301 (Blum) 6

Locating data• The platters are dense with data, if the head is

even the slightest bit off target, one will be reading the wrong data.

• The actuator uses a voice coil. The voice coil uses a feedback mechanism to locate the data. – Feedback means taking some output and putting it back

in as input. In this case the head is reading information from the platter. Some of that information is telling the head where it is on the platter.

CSIT 301 (Blum) 7

Servo Information

• The information on the disk about location on the disk is called servo information. – It is not user’s data but data about the disk’s

operation.

• The servo information can be placed – In dedicated sectors (wedge servo)– On dedicated platter side (dedicated servo)– Spread throughout (embedded servo)

CSIT 301 (Blum) 8

CSIT 301 (Blum) 9

Low-level format

• Low-level formatting (LLF), a.k.a. physical formatting, establishes the tracks, sectors, etc. and writes the servo information.

• For a hard drive, this is done once by the manufacturer.

• For a floppy disk, this can be done by the user. • Any previous data is lost when a low-level format

is performed on a disk.

CSIT 301 (Blum) 10

Our old enemy heat

• When objects heat up, they tend to expand (thermal expansion).

• If the heat in a hard drive is not distributed uniformly, then different platters are at different temperatures and thus have expanded different amounts.

• This is why dedicated servo is not as good as embedded servo.

CSIT 301 (Blum) 11

Thermal recalibration• Every once in awhile the hard disk reads

itself just to check on track positioning and so forth. – You may hear the hard drive spinning even

though the PC is neither reading it nor writing to it.

– This is called thermal recalibration. – The amount of thermal calibration necessary

was reduced by manufacturers moving to embedded servo techniques.

CSIT 301 (Blum) 12

A gentle breeze• While reading or writing the platters spin, which

causes a breeze. The actuator arm is designed like a wing that floats in this breeze.

• When the drive spins down (stops spinning), the breeze stops blowing and the actuator arm must come in for a landing. It comes in contact with the platter.

• We do not want there to be any data written in the region where the arm lands.

CSIT 301 (Blum) 13

The landing zone is for …• There are special regions on the disk called landing

zones where no data is written and where the head comes to rest when the drive spins down.

• Positioning the head into the landing zone is called head parking.

• There is a BIOS parameter that informs the system where the landing zones are. But in modern drives the drive is designed to return automatically to the landing zone (even if the power is lost).

• Some drives are designed so that the head never lands.

CSIT 301 (Blum) 14

Landing Zone Setting in BIOS

CSIT 301 (Blum) 15

Spindle Speed Revisited• In addition to accurately positioning the head, the

platter must spin at a very accurate speed. • The standard spindle speed for a long time was 3600

RPM (revolutions per minutes), which corresponds to 60 cycles per second or 60 Hz, which is same frequency as the AC power that comes out of a standard US wall socket.

• But since latency is connected to spindle speed, the spindle speeds have been raised.

• The higher speeds tend to debut with SCSI drives and then filter down to ATA/IDE drives.

CSIT 301 (Blum) 16

Spindle speed and drive type

Source: PCGuide.com

CSIT 301 (Blum) 17

Spindle Speed Issues

• Smaller platters are easier to spin faster – Think of an ice skater spinning

• Platters must spin together, so it is easier to spin fewer platters.

• The platter must spin at a steady speed and not vibrate (we don’t want a head crash).

• Heat and power: spinning faster requires more power and generates more heat.

CSIT 301 (Blum) 18

Power Issue

• Because of momentum (objects in motion tend to remain in motion), it takes more power to start the drive spinning than to keep it spinning. – This is one place where the 12V connection is used

– “Power management” reduces the power when a device is not being used. But spinning up a hard drive requires more power than maintaining the rotation, so continually starting and stopping could cost power.

• Also the starting and stopping could be detrimental to the drive.

CSIT 301 (Blum) 19

Power Issue (Cont.)

• When a computer has multiple drives, e.g. a master/slave set up, the slave may delay its spin up until the master has completed its spin up so they are not pulling on the power simultaneously. – One may have to use a particular jumper setting

to ensure this delay.

CSIT 301 (Blum) 20

Cover and Base Casting

Don’t open the case (unless your room is clean).

The screws in the case are unusual to prevent you from opening it.

CSIT 301 (Blum) 21

Yes to Air / No to Dust

• The hard drive cannot be completely sealed off, it needs air to keep it from overheating.

• On the other hand, the slightest spec of dust can cause a head crash.

• A hard drive needs an air filtration and circulation system. – The circulation occurs naturally in that the spinning

disks cause the air to flow. – There is a filter to keep dirt out. It does not need

changing.

CSIT 301 (Blum) 22

Heat Issues Revisited

• Recall that moving air (convection) is the primary mechanism for cooling computer devices and that the spinning platters get the air moving inside hard drives.

• Thus typical hard drives (ATA/IDE and SCSI with moderate spindle speeds) can use passive cooling.

• High speed SCSI drives may need active cooling (i.e. fans).

CSIT 301 (Blum) 23

Drive cooler

CSIT 301 (Blum) 24

Bay cooler

CSIT 301 (Blum) 25

Retail vs. OEM

• Retail– Hard Disk Drive, Installation Instructions,

Drivers and/or Overlay Software, Mounting Hardware, Interface Cable, Warranty Card

• OEM (original equipment manufacturer)– Hard Disk Drives and Jumpers (maybe)

CSIT 301 (Blum) 26

Geometry Review

• A platter is divided into concentric circles called tracks.

• The tracks are further divided into arcs called sectors. – A sector holds 512 bytes of data. – There may be additional bytes for servo information. – There may be additional bytes for error detection and

correction. – In zoned bit recording (ZBR) outer tracks have more

sectors than inner tracks.

CSIT 301 (Blum) 27

Data transfer rate is track dependent

• The spindle rotates at a specified angular speed (e.g. 7200 RPM).

• The data transfer rate depends on this speed.

• But since there are more sectors and thus more data at larger radii, the data transfer rate can be track dependent.

CSIT 301 (Blum) 28

Zone Dependent Data Transfer Rate

CSIT 301 (Blum) 29

Interleaving

• When storing a file larger than a sector, it is sometimes faster to store it on non-consecutive sectors– In one-to-one interleaving, the sectors are

placed consecutively around a track. – In two-to-one interleaving, every other sector is

written to – …

CSIT 301 (Blum) 30

Interleaving (cont.)

CSIT 301 (Blum) 31

Interleaving (cont.)

• The purpose of interleaving is to make the disk drive more efficient. The disk drive can access only one sector at a time, and the disk is constantly spinning beneath the head.

• This means that by the time the drive is ready to access the next sector, the disk may have already spun beyond it.

• It depends how fast the controller is. Modern controllers are very fast and 1-to-1 interleaving is the norm.

CSIT 301 (Blum) 32

What’s the delay?

• Modern controllers are so fast there is effectively no delay between writing one sector and the next and thus interleaving is not necessary.

• But if writing requires switching to a different platter (same cylinder) there is a small delay.

• And if the writing requires placing data on more than one track/cylinder, there is a more substantial delay in repositioning the head so as to write to the next track.

CSIT 301 (Blum) 33

Cylinder and Head Skew

• The sector numbering is staggered to account for delay.

• There is staggering from platter to platter within the cylinder. This is known as head skew.

• There is staggering from track to track on a given platter. This is known as cylinder skew.

CSIT 301 (Blum) 34

Cylinder and Head Skewing

Staggering on a given platter (cylinder skew) and staggering from platter-to-platter (head skew).

CSIT 301 (Blum) 35

Three-Step Process to Use Hard Disk

• To prepare a hard disk for use, there are three steps: – Low-level (or physical) formatting – Partitioning– High-level (or logical) formatting

CSIT 301 (Blum) 36

Low-Level Formatting• For hard drives, low-level formatting is done by the

manufacturer. • It establishes the tracks, sectors and so on. • It writes the servo information onto the disk. • Any information on a disk is lost if it is low-level

formatted. • There are pseudo-low-level formatting utilities that

one can run which effectively write 0’s to all of the sectors and replace bad sectors with spares. – This is distinct from true low-level formatting which

establishes the sectors.

CSIT 301 (Blum) 37

Partitioning• Partitioning separates the disk into logical pieces. • The standard motivations for partitioning are:

– To have multiple operating systems on the same disk (e.g. a “dual boot system”)

– To improve disk efficiency, to minimize “slack” and so on.

– To separate system files from user files (from virtual memory).

CSIT 301 (Blum) 38

Drive Letters and Partitions

• Drive letters A and B are reserved for floppies. (It was standard for early PCs to have two floppy disk drives.)

• The computer begins assigning hard drive partitions drive letters starting with C.

• All primary drives are assigned letters first. • Next letters are assigned to logical volumes

within the extended partition.

CSIT 301 (Blum) 39

Partitions• A drive must have at least one partition. • A drive can have at most four partitions.

– These are known as the primary partitions. • One of these is designated as “active” and under

normal circumstances one boots from the active drive.

– One can achieve the effect of having more than four partitions on one hard drive by designating one as an extended partition (instead of a primary partition). The extended partition can then be divided into logical partitions or logical volumes.

CSIT 301 (Blum) 40

Primary versus Logical• “Boot-ability”: A primary partition is bootable and

can be set as the active partition. – Typical schemes reserve primary partitions to act as

potential active partitions. That is, if the space is to be used for non-operating-system files, the space will be set up as a logical volume instead of a primary partition.

• Drive Letter Assignment: All primary partitions are assigned drives before any logical partition is assigned a drive letter. – Adding (not replacing) a hard drive can result in a

reordering of one’s drives if one has logical partitions.

Control Panel/Administrative Tools/Computer Management/Disk Management

CSIT 301 (Blum) 41

CSIT 301 (Blum) 42

Parts of a Primary Partition

• A primary partition will contain some combination of the following three things:– System partition: the files need to start the

operating system– Boot partition: the operating system files – General purpose partition: any other files

(programs and data)

CSIT 301 (Blum) 43

Master Boot Record• The first thing read from the hard drive when a

computer starts is the Master Boot record (MBR). – It is located at cylinder 0, head 0, and sector 1.

• The MBR consists of: – Master Partition Table

• This table is limited in size and only has information about the primary partitions (not any logical volumes) and which primary partition is active

– Master Boot Code• A small program to start the boot process

CSIT 301 (Blum) 44

Volume Boot Sector

• Each partition has a volume boot sector (or partition boot sector) which contains information about: – The size of the partition – Volume Boot Code:

• The Master Boot Code calls the Volume Boot Code of the active partition. The Volume Boot Code starts loading the operating system.

– Location of the File Allocation Table (FAT)

CSIT 301 (Blum) 45

Boot sector virus

• The master boot code and the volume boot code are the first software code executed after the BIOS (firmware) has started the computer when it is powered up.

• This very low-lying code is susceptible to viruses known as boot sector infectors. – Why you should not have a floppy in the drive

when you boot (unless you mean to boot from the floppy).

CSIT 301 (Blum) 46

High-level formatting

• After one partitions a disk, the next level of preparing it to be used is to high-level (or logical) formatting.

• Logical formatting provides– Partition boot sector– System ID byte (identifies partition)– Information for the filesystem– Data on bad sectors – Lose data (maybe)

Formatting a drive

CSIT 301 (Blum) 47

CSIT 301 (Blum) 48

References

• PC Hardware in a Nutshell, Thompson and Thompson

• http://www.pcguide.com

• All-in-One A+ Certification, Meyers and Jernigan