CSC 203 1.5 Computer System Architecture Department of Statistics and Computer Science University of Sri Jayewardenepura
Secondary Memory 2
Technologies Magnetic storage Floppy, Zip disk, Hard drives, Tapes Optical storage CD, DVD, Blue-Ray, HD-DVD Solid state memory USB flash drive, Memory cards for mobile phones/digital cameras/mp3 players, Solid State Drives 3
Magnetic Disk Purpose: Long term, nonvolatile storage Large, inexpensive, and slow Lowest level in the memory hierarchy Two major types: Floppy disk Hard disk Both types of disks: Rely on a rotating platter coated with a magnetic surface Use a moveable read/write head to access the disk Advantages of hard disks over floppy disks: Platters are more rigid ( metal or glass) so they can be larger Higher density because it can be controlled more precisely Higher data rate because it spins faster Can incorporate more than one platter 4
Disk Track 5
Components of a Disk The arm assembly is moved in or out to position a head on a desired track. Tracks under heads make a cylinder (imaginary!). Only one head reads/writes at any one time. Block size is a multiple of sector size (which is often fixed). Disk head Arm assembly Arm movement Spindle Tracks Sector Platters 6
Internal Hard-Disk Page 223 7
Magnetic Disk A stack of platters, a surface with a magnetic coating Typical numbers (depending on the disk size): 500 to 2,000 tracks per surface 32 to 128 sectors per track A sector is the smallest unit that can be read or written Traditionally all tracks have the same number of sectors: Constant bit density: record more sectors on the outer tracks 8
Magnetic Disk Characteristic Disk head: each side of a platter has separate disk head Cylinder: all the tracks under the head at a given point on all surface Read/write data is a three-stage process: Seek time: position the arm over the proper track Rotational latency: wait for the desired sector to rotate under the read/write head Transfer time: transfer a block of bits (sector) under the read-write head Average seek time as reported by the industry: Typically in the range of 8 ms to 15 ms (Sum of the time for all possible seek) / (total # of possible seeks) Due to locality of disk reference, actual average seek time may: Only be 25% to 33% of the advertised number 9
Typical Numbers of a Magnetic Disk Rotational Latency: Most disks rotate at 3,600/5400/7200 RPM Approximately 16 ms per revolution An average latency to the desired information is halfway around the disk: 8 ms Transfer Time is a function of : Transfer size (usually a sector): 1 KB / sector Rotation speed: 3600 RPM to 5400 RPM to 7200 Recording density: typical diameter ranges from 2 to 14 in Typical values: 2 to 4 MB per second 10
Disk I/O Performance Disk Access Time = Seek time + Rotational Latency + Transfer time + Controller Time + Queueing Delay 11
Disk I/O Performance Disk Access Time = Seek time + Rotational Latency + Transfer time + Controller Time + Queueing Delay Estimating Queue Length: Utilization = U = Request Rate / Service Rate Mean Queue Length = U / (1 - U) As Request Rate Service Rate -> Mean Queue Length ->Infinity 12
Example Setup parameters: 16383 Cycliders, 63 sectors per track, 3 platters, 6 heads Bytes per sector: 512 RPM: 7200 Transfer mode: 66.6MB/s Average Read Seek time: 9.0ms (read), 9.5ms (write) Average latency: 4.17ms Physical dimension: 1 x 4 x 5.75 Interleave: 1:1 13
Disk performance Preamble: allows head to be synchronized before read/write ECC (Error Correction Code): corrects errors Unformatted capacity: preambles, ECCs and inter sector gaps are counted as data Disk performance depends on seek time time to move arm to desired track rotational latency time needed for requested sector to rotate under head Rotational speed: 5400, 7200, 10000, 15000 rpm Transfer time time needed to transfer a block of bits under head (e.g., 40 MB/s) 14
Disk performance Disk controller chip that controls the drive. Its tasks include accepting commands (READ, WRITE, FORMAT) from software, controlling arm motion, detecting and correcting errors Controller time overhead the disk controller imposes in performing an I/O access Avg. disk access time = avg. seek time + avg. rotational delay + Transfer time + controller overhead 15
Example Advertised average seek time of a disk is 5 ms, transfer rate is 40 MB per second, and it rotates at 10,000 rpm Controller overhead is 0.1 ms. Calculate the average time to read a 512 byte sector. 16
RAID- (Redundant Array of Inexpensive Disks) A disk organization used to improve performance of storage systems An array of disks controlled by a controller (RAID Controller) Data are distributed over disks (striping) to allow parallel operation 17
RAID 0- No redundancy No redundancy to tolerate disk failure Each strip has k sectors (say) Strip 0: sectors 0 to k 1 Strip 1: sectors k to 2k 1...etc Works well with large accesses Less reliable than having a single large disk 18
Example (RAID 0) Suppose that RAID consists of 4 disks with MTTF (mean time to failure) of 20,000 hours. A drive will fail once in every 5,000 hours A single large drive with MTTF of 20,000 hours is 4 times reliable 19
RAID 1 (Mirroring) Uses twice as many disk as does RAID 0 (first half: primary, next half: backup) Duplicates all disks On a write, every strip is written twice Excellent fault tolerance (if a disk fails, backup copy is used) Requires more disks 20
RAID 3 (Bit Interleaved Parity) Reads/writes go to all disks in the group, with one extra disk (parity disk) to hold check information in case off a failure Parity contains sum of all data in other disks If a disk fails, subtract all data in good disks from parity disk 21
RAD 4 (Block Interleaved Parity) RAID 4 is much like RAID 3 with a strip for strip parity written onto an extra disk A write involves accessing 2 disks instead of all Parity disk must be updated on every write 22
RAID 5- Block Interleaved Distributed Parity In RAID 5, parity information is spread throughout all disks In RAID 5, multiple writes can occur simultaneously as long as stripe units are not located in same disks, but it is not possible in RAID 4 23
Secondary Storage Devices: CD-ROM 24
Physical Organization of CD-ROM Compact Disk read only memory (write once) Data is encoded and read optically with a laser Can store around 600MB data Digital data is represented as a series of Pits and Lands: Pit = a little depression, forming a lower level in the track Land = the flat part between pits, or the upper levels in the track Reading a CD is done by shining a laser at the disc and detecting changing reflections patterns. 1 = change in height (land to pit or pit to land) 0 = a fixed amount of time between 1 s 25
Organization of data LAND PIT LAND PIT LAND...------+ +-------------+ +---.....0 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0.. Cannot have two 1 s in a row! => uses Eight to Fourteen Modulation (EFM) encoding table. 0's are represented by the length of time between transitions, we must travel at constant linear velocity (CLV)on the tracks. Sectors are organized along a spiral Sectors have same linear length Advantage: takes advantage of all storage space available. Disadvantage: has to change rotational speed when seeking (slower towards the outside) 26
CD-ROM Addressing 1 second of play time is divided up into 75 sectors. Each sector holds 2KB 60 min CD: 60min * 60 sec/min * 75 sectors/sec = 270,000 sectors = 540,000 KB ~ 540 MB A sector is addressed by: Minute:Second:Sector e.g. 16:22:34 Type of laser CD: 780nm (infrared) DVD: 635nm or 650nm (visible red) HD-DVD/Blu-ray Disc: 405nm (visible blue) Capacity CD: 650 MB, 700 MB DVD: 4.7 GB per layer, up to 2 layers HD-DVD: 15 GB per layer, up to 3 layers BD: 25 GB per layer, up to 2 layers 27
Solid state storage 28
Solid state storage Memory cards For Digital cameras, mobile phones, MP3 players... Many types: Compact flash, Smart Media, Memory Stick, Secure Digital card... USB flash drives Replace floppies/cd-rw Solid State Drives Replace traditional hard disks Uses flash memory Type of EEPROM Electrically erasable programmable read only memory Grid of cells (1 cell = 1 bit) Write/erase cells by blocks 29
Solid state storage Cell=two transistors Bit 1: no electrons in between Bit 0: many electrons in between Performance Acces time: 10X faster than hard drive Transfer rate 1x=150 kb/sec, up to 100X for memory cards Similar to normal hard drive for SSD ( 100-150 MB/sec) Limited write: 100k to 1,000k cycles 30
Solid state storage Size Very small: 1cm² for some memory cards Capacity Memory cards: up to 32 GB USB flash drives: up to 32 GB Solid State Drives: up to 256 GB 31
Solid state storage Reliability Resists to shocks Silent! Avoid extreme heat/cold Limited number of erase/write Challenges Increasing size Improving writing limits 32