Chapter 6 External Memory Magnetic disks remain the

  • Slides: 46
Download presentation
Chapter 6 External Memory § Magnetic disks remain the most important component of external

Chapter 6 External Memory § Magnetic disks remain the most important component of external memory. Both removable and fixed, or hard, disks are used in systems ranging from personal computers to mainframes and supercomputers(超级计算机). § To achieve greater performance and higher availability, a popular scheme on servers and larger systems is the RAID disk technology. RAID refers to a family of techniques for using multiple disks as a parallel array of data storage devices, with redundancy built in to compensate for disk failure. RAID: Redundant(冗余) Array of Independent Disks

Chapter 6 External Memory § Optical storage technology has become increasingly important in all

Chapter 6 External Memory § Optical storage technology has become increasingly important in all types of computer systems. While CD-ROM has been widely used for many years, more recent technologies, such as writable CD and magneto-optical(磁光) storage, are becoming increasingly important.

6. 1 Magnetic Disk § A disk is a circular platter constructed of nonmagnetic

6. 1 Magnetic Disk § A disk is a circular platter constructed of nonmagnetic material, called the substrate(基底) coated with a magnetizable (可磁化). Data are recorded on and later retrieved from the disk via a conducting coil (感应线圈) named the head. During a read or write operation, the head is stationary(静止) while the platter rotates(旋转) beneath it.

Magnetic Read Write Mechanisms § The write mechanism is based on the fact that

Magnetic Read Write Mechanisms § The write mechanism is based on the fact that electricity flowing through a coil(线圈) produces a magnetic field. Pulses(脉冲) are sent to the head, and magnetic patterns are recorded on the surface below, with different patterns for positive and negative currents. § The read mechanism is based on the fact that a magnetic field moving relative to a coil produces an electrical current in the coil. When the surface of the disk passes under the head, it generates a current of the same polarity(极性) as the one already recorded. Iw

Disk Organization and Formatting § § § The organization of data on the platter

Disk Organization and Formatting § § § The organization of data on the platter in a concentric(同 心) set of rings, called tracks. Each track is the same width as the head. Adjacent(相邻) tracks are separated by gaps. To simplify the electronics, the same number of bits is typically stored on each track. Thus, the density(密度), in bits per linear inch, increases in moving from the outermost track to the innermost track. Data are transferred to and from the disk in blocks. Data are stored in block-size regions known as sectors. The number of sectors by track may be either fixed or variable

Disk Organization and Formatting(格式化) Some means is needed to locate sector positions within a

Disk Organization and Formatting(格式化) Some means is needed to locate sector positions within a track. Clearly, there must be some starting point on the track and a way of identifying the start and end of each sector. These requirements are handled by means of control data recorded on the disk. Thus, the disk is formatted with some extra data used only by the disk drive and not accessible to the user. CRC: Cyclic Redundancy Check循环冗余校验

Disk Organization and Formatting Some means is needed to locate sector positions within a

Disk Organization and Formatting Some means is needed to locate sector positions within a track. Clearly, there must be some starting point on the track and a way of identifying the start and end of each sector. These requirements are handled by means of control data recorded on the disk. Thus, the disk is formatted with some extra data used only by the disk drive and not accessible to the user.

Disk Organization and Formatting Low-level formatting: creates the tracks and sectors on a hard

Disk Organization and Formatting Low-level formatting: creates the tracks and sectors on a hard disk. Low-level formatting creates the physical format that dictates(控制) where data is stored on the disk. High-level formatting: creates the file system structures on the disk, such as the master boot record(主引导记录) , boot record(引导记录), and the File Allocation Tables. Floppy disks must also undergo low-level and high-level formatting, but these two are generally performed at the same time. On PCs, for example, the FORMAT command performs both a low-level and high-level format the first time a floppy is formatted.

Fig. 6. 3 Comparison of Disk Layout Methods

Fig. 6. 3 Comparison of Disk Layout Methods

Physical Characteristics Table 6. 1 lists the major characteristics that differentiate(区分) among the various

Physical Characteristics Table 6. 1 lists the major characteristics that differentiate(区分) among the various types of magnetic disks Head Motion Platters(基盘) Fixed head(one per track) Single platter Movable head(one per surface) Multiple platter Disk Portability(可更换性/携带性) Head Mechanism Nonremovable disk Contact(floppy) Removable disk Fixed gap Sides Aerodynamic gap single sided (Winchester) Double sided

Physical Characteristics § Double sided: the magnetizable coating is applied to both sides of

Physical Characteristics § Double sided: the magnetizable coating is applied to both sides of the platter. § Some disk drives accommodate(容纳) multiple platters stacked(叠放) vertically about an inch apart. The platters come as a unit known as a disk pack(盘组). Aligned tracks on each platter form cylinders(柱面)

A Magnetic Disk with Three Platters

A Magnetic Disk with Three Platters

Physical Characteristics Disk classification based on the head mechanism • A fixed distance above

Physical Characteristics Disk classification based on the head mechanism • A fixed distance above the platter , allowing an air gap. • Physical contact with the medium during a read or write operation. • The winchester disk: the heads are used in sealed(密封) drive assemblies(组合体) that are almost free of contaminants(污染物). They are designed to operate closer to the disk’s surface than conventional rigid disk heads, thus allowing greater data density. The head is actually an aerodynamic foil(衬托物) that rests lightly on the platter’s surface when the disk is motionless. The air pressure generated by a spinning disk is enough to make the foil rise above the surface. The resulting noncontact system can be engineered to use narrower heads that operate closer to the platter’s surface than conventional rigid disk heads. The relationship between data density(密度) and the size of the air gap: the narrower the head is, the closer it must be to the platter surface to function. A narrower head means narrower tracks and therefore greater data density. However, the closer the head is to the disk, the greater the risk of error from impurities(杂质) or imperfections(缺陷).

Disk performance Parameters(参数) Seek time(寻道): the time taken to position the head at the

Disk performance Parameters(参数) Seek time(寻道): the time taken to position the head at the desired track Rotational(旋转) delay(latency): the time taken for the beginning of the sector to reach the head Access time: the sum of the seek time and rotational delay Data transfer time: Once the head is in position, the read or write operation is then performed as the sector moves under the head Wait for device: When a process(进程) issues an I/O request , it must first wait in a queue for the device to be available. Wait for channel: If the device shares a single I/O channel(通道) or a set of I/O channel with other disk drives, then it must wait for the channel to be available. Fig. 6. 7 Timing of a Disk I/O Transfer

Disk performance Parameters Seek time: time required to move the disk arm to the

Disk performance Parameters Seek time: time required to move the disk arm to the required track, consisting of several key components: the initial startup time, and the time taken to traverse (跨越) the tracks that have to be crossed once the access arm is up to speed. Where Ts=m × n +s Ts = estimated seek time n= number of tracks traversed m = constant that depends on the disk drive s = startup time Rotational Delay: One revolution per 16. 7 ms when rotating at 3600 rpm Transfer time: Depending on the rotation speed of the disk b T= r. N Where T = transfer time b = number of bytes to be transferred N = number of bytes on a track r = rotation speed, in revolutions per second Total average access time 1 b Ta=Ts + + 2 r r. N

A Timing Comparison Consider a typical disk with an advertised average seek time of

A Timing Comparison Consider a typical disk with an advertised average seek time of 4 ms, and 512 -byte sectors with 500 sectors per track. Suppose that we wish to read a file consisting of 2500 sectors for a total of 1. 28 MB. Estimate the total time for the transfer.

6. 2 RAID § One component can only be pushed so far, additional gains

6. 2 RAID § One component can only be pushed so far, additional gains in performance are to be had by using multiple parallel components. In the case of disk storage, this leads to the development of arrays of disks that operate independently and in parallel. § With multiple disks, separate I/O requests can be handled in parallel, as long as the data requited reside on separate disks. Further, a single I/O request can be executed in parallel if the block of data to be accessed is distributed across multiple disks. § Redundant(冗余) Array of Independent Disks(Redundant Array of Inexpensive Disks), seven levels, 0 through 6, not a hierarchy, different design architecture, sharing 3 common characteristics: • Set of physical disks viewed as single logical drive by OS • Data distributed across physical drives of an array. • Can use redundant capacity to store parity information, which guarantees data recoverability in case of a disk failure.

RAID § The term RAID was originally coined in a paper by a group

RAID § The term RAID was originally coined in a paper by a group of researchers at the University of California at Berkeley. § The RAID strategy replaces large-capacity disk drives with multiple smaller-capacity drives and distributes data in such a way as to enable simultaneous access to data from multiple drives, thereby improving I/O performance and allowing easier incremental increases in capacity. § The unique contribution of the RAID proposal is to address(找到) effectively the need for redundancy. Although allowing multiple heads and actuators( 执行机构) to operate simultaneously to achieve higher I/O and transfer rates, the use of multiple devices increases the probability of failure. To compensate for this decreased reliability, RAID makes use of stored parity(校验) information that enables the recovery of data lost due to a disk failure.

RAID Levels I/o Request Rate (Read/Write) Data Transfer Rate (Read/Write) Category Level Description Striping

RAID Levels I/o Request Rate (Read/Write) Data Transfer Rate (Read/Write) Category Level Description Striping (条块化) 0 Nonredundant Mirroring (镜像) 1 Mirrored Good/Fair/Fair Parallel Access 2 Redundant via Hamming code Poor Excellent 3 Bitinterleaved (交错) Parity Poor Excellent Large strips(条块) Small strips: Excellent Typical Applications Requiring high performance for noncritical data System drives; critical files Large I/O request size applications, such as imaging, CAD

RAID Levels(Continued) Category Independent access Level Description 4 Blockinterleaved parity 5 6 Blockinterleaved distributed

RAID Levels(Continued) Category Independent access Level Description 4 Blockinterleaved parity 5 6 Blockinterleaved distributed parity Blockinterleaved dual distributed parity I/o Request Rate (Read/Write) Data Transfer Rate (Read/Write) Excellent/Fair/Poor Excellent/Fair Excellent/Poor Fair/Poor Typical Application High request rate, read intensive, data lookup(查询) Applications requiring extremely high availability

An example illustrating the use of the seven RAID schemes to support a data

An example illustrating the use of the seven RAID schemes to support a data capacity requiring four disks with no redundancy. The figure highlights the layout of user data and redundant data and indicates the relative storage requirements

RAID 0 § § No redundancy Data striped across all disks, two different I/O

RAID 0 § § No redundancy Data striped across all disks, two different I/O requests for two different blocks of data, a good chance for the requested data on different disks. Round Robin striping RAID 0 for High Data Transfer Capacity The performance of any of the RAID levels depends critically on the request patterns of the host system and on the layout of the data. For applications to see a high transfer rate, two requirements must be met. 1. A high transfer capacity must exist along the entire path between host memory and the individual disk drives. This includes internal controller buses, host system I/O buses, I/O adapters(适配器), and host memory buses. 2. The application must make I/O requests that drive the disk array efficiently. Requiring the typical request is for large amounts of logically contiguous (相邻的)data, compared to the size of a strip.

strips that maps exactly one strip to each array member. All of the user

strips that maps exactly one strip to each array member. All of the user and system data are viewed as being stored on a logical disk. The disk is divided into strips(条块); these strips may be physical blocks, sectors. The strips are mapped round robin(循环) to consecutive (相邻) array members. A set of logically consecutive member is referred to as a stripe(条带). Fig. 6. 9 indicates the use of array management software to map between logical and physical disk space. This software may execute either in the disk subsystem or in a host computer.

RAID 0 § RAID 0 for High I/O Request Rate In a transaction-oriented (面向事务处理)environment,

RAID 0 § RAID 0 for High I/O Request Rate In a transaction-oriented (面向事务处理)environment, the user is typically more concerned with response time than with transfer rate and there may be hundreds of I/O requests per second. A disk array can provide high I/O execution rates by balancing the I/O load across multiple disks. Effective load balancing is achieved only if there are typically multiple I/O requests outstanding (未 响应). The performance will also be influenced by the strip size. If the strip size is relatively large, so that a single I/O request only involves a single disk access, then multiple waiting I/O requests can be handled in parallel, reducing the queuing time for each request.

RAID 1 §Data striping is used, as in RAID 0. But mapped to two

RAID 1 §Data striping is used, as in RAID 0. But mapped to two separate physical disks § Mirrored Disks § Data is striped across disks § 2 copies of each stripe on separate disks § Read from either § Write to both in parallel § Recovery is simple • Swap faulty disk & re-mirror • No down time § Expensive(but providing real-time(时实) backup) § In a transaction(事务处理)-oriented environment, RAID 1 can achieve high I/O request rates if the bulk of the requests are reads

§ § § RAID 2 The spindles(轴盘) of the individual drives are synchronized so

§ § § RAID 2 The spindles(轴盘) of the individual drives are synchronized so that each disk head is in the same position on each disk at any given time. Data striping used, very small strips, often as small as a single byte or word. An error-correcting is calculated across corresponding bits on each data disk, and the bits of the code are stored in the corresponding bit positions on multiple parity disks. A Hamming code is used , being able to correct single-bit errors and detect double-bit errors. The number of redundant disks is proportional to(成比例) the log( 对数) of the number of data disks(costly) On a single read, all disks are simultaneously accessed. The requested data and the associated error-correcting code are delivered to the array controller. Read operation not slowed. On a single write, all data disks and parity disks must be accessed for the write operation.

RAID 3 § § Similar to RAID 2 Only one redundant disk, no matter

RAID 3 § § Similar to RAID 2 Only one redundant disk, no matter how large the array is Simple parity bit for each set of corresponding bits Data on failed drive can be reconstructed from surviving data and parity info • X 4(i)=X 3(i) (+) X 2(i) (+) X 1(i) (+) X 0(i) ; suppose drive X 1 failed: • X 1(i)= X 4(i) (+) X 3(i) (+) X 2(i) (+) X 0(i) § Very high transfer rates, but very low I/O request rate

§ § RAID 4 Each disk operates independently, so that separate I/O requests can

§ § RAID 4 Each disk operates independently, so that separate I/O requests can be satisfied in parallel. More suitable for applications requiring high I/O request rates and less suited for applications requiring high data transfer rates. Large strips Bit by bit parity strip calculated across corresponding strips on each disk and the parity bits stored in the corresponding strip on the parity disk. RAID 4 involves a write penalty when an I/O write request of small size is performed. Updating not only user data but also the corresponding parity bits. Suppose that a write is performed that only involves a strip on disk X 1. For each bit i, X 4(i)=X 3(i) (+) X 2(i) (+) X 1(i) (+) X 0(i) X 4’(i)=X 3(i) (+) X 2(i) (+) X 1’(i) (+) X 0(i) = X 3(i) (+) X 2(i) (+) X 1’(i) (+) X 0(i) (+) X 1(i) = X 4(i) (+) X 1’(i)

RAID 5 § § § Like RAID 4 Parity striped across all disks Round

RAID 5 § § § Like RAID 4 Parity striped across all disks Round robin allocation for parity stripe Avoids RAID 4 bottleneck at parity disk Commonly used in network servers

RAID 6 § Two different parity calculations are carried out and stored in separate

RAID 6 § Two different parity calculations are carried out and stored in separate blocks on different disks § Recoverable even if two disks containing user data fail § Incurs a substantial write penalty due to each write affecting two parity blocks

6. 3 Optical Memory CD(Compact Disk). A nonerasable disk that stores digitized(数字化) audio information.

6. 3 Optical Memory CD(Compact Disk). A nonerasable disk that stores digitized(数字化) audio information. The standard system uses 12 cm disks and can record more than 60 minutes of uninterrupted playing time. CD-ROM(Compact Disk Read-Only memory). A nonerasable disk used for storing computer data. The standard system uses 12 cm disks and can hold more than 600 Mbytes. DVD(Digital Video/Versatile(多功能) Disk). A technology for producing digitized, compressed(压缩) representation of video information, as well as large volumes of other digital data. WORM(Write-Once Read-Many). A disk that is more easily written than CD-ROM, making single-copy disks commercially feasible(可行的). As with CD-ROM, after the write operation is performed, the disk is read-only. The most popular size is 5. 25 -inch, which can hold from 200 to 800 Mbytes of data. Erasable Optical Disk. A disk that uses optical technology but that can be easily erased and rewritten. Both 3. 25 -inch and 5. 25 -inch disks are in use. A typical capacity is 650 Mbytes. Magneto-Optical Disk. A disk uses optical technology for read and magnetic recording techniques assisted by optical focusing(聚焦). Capacities above 1 Gbyte are common

Optical Storage Disk Formation § Polycarbonate(resin松香) coated with highly reflective coat, usually aluminum §

Optical Storage Disk Formation § Polycarbonate(resin松香) coated with highly reflective coat, usually aluminum § Data stored as microscopic pits imprinted(刻压) on the reflective(反射) surface. First of all, with a finely focused, high-intensity(强度) laser to create a master disk. The master is used , in turn, to make a die(模子) to stamp out copies § Data retrieved by a low-powered laser housed in an optical-disk player.

CD-ROM Track § For a typical example, the track-to-track spacing is 1. 6 μm.

CD-ROM Track § For a typical example, the track-to-track spacing is 1. 6 μm. The recordable width of a CD-ROM, along its radius, is 32. 55 mm, so the total number of apparent(表观) tracks is 32, 550 μm divided by the track spacing, or 20, 344 tracks. The length is approximately 5. 27 km. The constant linear velocity of the CD-ROM is 1. 2 m/s , which yields a total of 73. 2 minutes. Since data is streamed from the disk at 176. 4 Kbytes/s, the storage capacity of the CD-ROM is 774. 57 Mbytes. 螺旋槽

CD-ROM Format §Sync: The sync field identifies the beginning of a block. §Header: The

CD-ROM Format §Sync: The sync field identifies the beginning of a block. §Header: The header contains the block address and the mode byte. §Data: user data §Auxiliary: Additional user data in mode 2. In mode 1, 288 -byte ECC 12 byte Sync 00 Layered ECC Min Sector Mode 00 FF x 10 Data 4 byte ID 2048 byte 288 byte 2352 bytes With the use of CLV, random access becomes more difficult. Locating a specific address involves moving the head to the general area , adjusting the rotation speed and reading the address, and then making minor adjustments to find access the specific sector. § § § Mode 0=blank data field Mode 1=2048 byte data +error correction Mode 2=2336 byte data

WORM § The WORM uses constant angular velocity, at the sacrifice(牺 牲) of some

WORM § The WORM uses constant angular velocity, at the sacrifice(牺 牲) of some capacity, to provide for more rapid access. § A typical technique for preparing the disk is to use a highpowered laser to produce a series of blisters(隆起的泡) in the disk. When the preformatted medium is placed in a WORM drive, a low-powered laser can produce just enough heat to burst(破裂) the prerecorded blisters. § During the read operation, a laser in the WORM drive illuminates(照射) the disk’s surface. Because the burst blisters provide higher contrast than the surrounding area, these are easily recognized by simple electronics. § The WORM optical disk is attractive for archival(档案库) storage of documents and files.

Erasable Optical Disk § The only pure optical approach that has proved attractive is

Erasable Optical Disk § The only pure optical approach that has proved attractive is called phase(相) change. § The phase change disk uses a material that has two significantly different reflectivities(反射性) in two different phase states. § In amorphous(非晶体) state, the molecules(分子) exhibit a random orientation. Reflecting light poorly. § A crystalline(晶体) state, having a smooth surface that reflects light well. § It can be rewritten and thus used as a true secondary storage. As such, it competes(竞争) with magnetic disk.

Digital Versatile Disk § Acceptable replacement for the analog(模拟) VHS(Very High Sensitivity) video tape

Digital Versatile Disk § Acceptable replacement for the analog(模拟) VHS(Very High Sensitivity) video tape , the video tape used in VCR(Video Cassette Recorder) and CD-ROM § A standard DVD holds 4. 7 Gbytes per layer, with a dual-layer single-sided DVD holding 8. 5 Gbytes. § DVD uses a form of video compression known as MPEG for high-quality full-screen pictures. § A single layer DVD can hold a two-hour, thirteen-minute movie.

§ § Magneto-Optical Disk MO disk drive uses an optical laser to enhance the

§ § Magneto-Optical Disk MO disk drive uses an optical laser to enhance the capabilities of a conventional magnetic disk system. The recording technology is fundamentally magnetic. However , an optical laser is used to focus the magnetic recording head so that greater capacities can be achieved. The disk is coated with a material whose polarity(极性) can be altered only at high temperatures. Data is written onto the disk by using the laser to heat a tiny spot on its surface and then applying a magnetic field. As the spot cools, it adopts the field’s northsouth polarity. The read operation is purely optical. The direction of magnetism can be detected by polarized(偏振) laser light. Polarized light reflected from a particular spot will change its degree of rotation depending on the magnetic field’s orientation. The principal advantage of the MO drive over a purely optical drive is the longevity(寿命) of the disks.

6. 4 Magnetic Tape § The tape medium is structured as a small number

6. 4 Magnetic Tape § The tape medium is structured as a small number of parallel tracks. Nine tracks in earlier system; 18 or 36 tracks in newer system § As with the disk , the tape is formatted to assist in locating physical records. § A tape drive is a sequential-access device. § Unlike the disk, the tape is in motion only during a read or write operation. § Magnetic tape was the first kind of secondary memory. It is still widely used as the lowest-cost , slowest-speed member of the memory hierarchy.

Magnetic Drum

Magnetic Drum