Preview only show first 10 pages with watermark. For full document please download

Secondary Storage Devices

   EMBED


Share

Transcript

Lecture # 3 Secondary Storage Devices Classification of Physical Storage Media • Can differentiate storage into: – volatile storage: • loses contents when power is switched off – non-volatile storage: • Contents persist even when power is switched off. Physical Storage Media • Cache – Close to CPU – fastest and most costly form of storage; volatile; managed by the computer system hardware. • Main memory: – Fast access (10 to 100 of nanoseconds; 1 nanosecond = 10–9 seconds) – Generally too small (or too expensive) to store the entire database • Flash memory – Data can be written at a location only once, but location can be erased and written to again • Magnetic-disk – Data is stored on spinning disk, and read/written magnetically – Primary medium for the long-term storage of data • Optical storage – non-volatile, data is read optically from a spinning disk using a laser – CD-ROM (640 MB) and DVD (4.7 to 17 GB) most popular forms • Tape storage – non-volatile, much slower than disk, tape can be removed from drive  storage costs much cheaper than disk, but drives are expensive – Storage Hierarchy • Typical storage hierarchy: – Main memory (RAM) for currently used data. – Disk for the main database (secondary storage). – Tapes for archiving older versions of the data (tertiary storage). Secondary Storage Devices • Magnetic media • Tape • Disks • Optical Media • Compact Discs • CD-R, WORM (Write Once, Read Many) • CD-RW • DVD • DVD-R • DVD-RW Examples of Magnetic Media • Some you are probably familiar with: • Cassette tapes • VHS video tape • Computer Tape • 8-track • DAT Hard Disks • Today, most people use Hard Disks for secondary storage • The basic technology used in hard disks is similar to that of magnetic tape •The disk head can move to any point on the platter but in the tap can not move. •In tap: The head touches the tape. In disks: the head never touches the platter •Data is stored and retrieved in units called disk blocks or pages. Hard Disks Storing Information on a Hard Disk • Each platter is broken up into tracks and sectors • Tracks are concentric circles on the disk • Each track is broken up into a series of sectors Track Sector (ring between the lines) Sectors and Blocks • Sectors are further broken up into blocks • A block is a fixed size unit of storage • 512 bytes/block is most commonly used • 1024 bytes/block is common with SCSI disks • 2048 bytes/block is used with CDs • If the user stores onto the hard disk a file which is larger than the block size, then multiple blocks are used. Blocks and Files • If a file takes up multiple blocks, it is necessary to keep track of which blocks comprise that file • Each block is assigned an address • The location of a “file” is stored in what is called a “File Allocation Table” (or FAT) • When the hard disk is formatted, several blocks are reserved so that the Operating System can manage where files are stored on the disk • FATs are often used to keep track of the filename and directory as well. Filesystems • Files are managed within a “filesystem” • The filesystem defines how and where files are stored within a hard disk (or partition) • When a disk is formatted, a filesystem is placed on the disk • Common filesystems include: • FAT16 (MSDOS) • VFAT (Windows 95) • FAT32 (Windows 98) • NTFS (Windows NT) • UFS (UNIX) • ext2/ext3 (Linux) • ISO9660 (CD Roms) Optical Media • Optical disks are very much like hard disks •Optical disks store information as bits in a physical medium • A laser is used to determine if a bit is present or not. CD ROM • CD Roms use the same technology as audio Compact Discs. •Copies of the disc are created through a copies process • The discs are aluminum sandwiched between plastic • CDs are single sided. Label Acrylic Aluminum Plastic CD-R •CDR discs can be written once and read many times • CDRs are made out of aluminum and plastic, but also contain a dye layer • This dye is modified by a laser when the disc is being written • The laser heats up the dye and it becomes nonreflective Label Acrylic Aluminum Dye Plastic CD-RW • CD-RW is similar to CD-R • The main difference is that the dye can be made reflective again through an erase process • In this way, CD-RW discs can be written many times • Too much erasing, the dye starts to fade. Label Acrylic Aluminum Dye Plastic DVD – Digital Versatile Disk • DVDs hold approximate 7 times the information that CDs do in the same amount of storage space • DVDs come in 3 types • Single Sided/Single Layer (4.7 GB) • Single Sided/Double Layer (8.5 GB) • Double Sided/Double Layer (17 GB) • DVD uses a laser with a shorter wavelength so the bits are smaller • More bits can be stored on a DVD • Narrower track Fragment What is file fragment? • Files may be fragmented in several sectors of HD • Fragmentation can slow down the system 17 Defragment • Each time file is opened, the O/S has to reassemble the file from different areas of the hard drive • Disk Defragmentation : – Analyzes the disk – Rearrange the disk by placing files in contiguous blocks – To reduce disk arm movement during sequential accesses – Does not change the linked structure of the file system! • Utility should be run at least monthly. Can vastly improve system performance. Defragmenting Volumes • OS attempts to save files in locations on the hard disk that are large enough to accommodate the entire file. • If there is no suitable location, OS saves fragments of the file in several locations. • This fragmentation of files on the hard disk decreases system performance because the computer must read file data from various locations on the hard disk. Defragmenting Example (Windows OS) • Windows provides defragmenting: two methods of – Disk Defragmenter, which is a snap-in tool. – The defrag command-line tool. • Both tools enable you to defragment files or volumes of any cluster size • Windows provides the Disk Defragmenter utility to reorganize clusters contiguously – Improves performance by minimizing movement of the read/write heads – Should be used regularly to ensure system runs at peak performance Using Disk Defragmenter 21 Disk Defragmentation Options in Windows Description Analyse Click this button to analyze the disk for fragmentation. After the analysis, there is graphic representation of how fragmented the partition is, and a dialog box appears informing you if the disk should be defragmented or not. Defragment Click this button to defragment the disk. During defragmentation, there is a graphic representation of the defragmented partition. Pause Click this button to temporarily stop analyzing or defragmenting a volume. Stop Click this button to interrupt and stop analyzing or defragmenting a volume. View Report Click this button to view additional information about the files and folders that were analyzed. 22 Before and after Defragmentation • Files become fragmented as they are stored in noncontiguous clusters; • a defragmenting utility moves files to contiguous clusters and improves disk performance 23