Hard Drives Continued CSC 370 Blum 1 Power
Hard Drives Continued CSC 370 (Blum) 1
Power Connectors The larger is the so-called Molex connector. CSC 370 (Blum) The smaller is called the mini connector. 2
Two Categories • There are two basic categories of hard drives which have different interfaces. • IDE/ATA – ATA (Advanced Technology Attachment) is the formal name for IDE (Integrated Drive Electronics) is one of the standard interfaces between the motherboard and drives • SCSI: – Small Computer System Interface (“scuzzy”) is another interface particularly well suited for connecting many devices to CSC 370 (Blum) 3
Different Interfaces/Different Connectors • IDE/ATA uses a 40 -pin rectangular connector. • SCSI uses one of the following – 50 -pin D-shaped connector (narrow SCSI) – 68 -pin D-shaped connector (wide SCSI) – or 80 -pin D-shaped connector (wide SCSI usingle connector attachment (SCA)) CSC 370 (Blum) 4
Data Interface Connectors ATA/IDE SCSI CSC 370 (Blum) 5
IDE/ATA Jumper Settings • If two IDE/ATA drives share the interface, one is designated the master the other the slave. The various jumper settings are mainly connected with this. It may specify the drive – As the master – As the slave – As either depending on its position CSC 370 (Blum) 6
IDE/ATA Jumpers • • MA: Master SL: Slave CS: Cable select SO: Sole/Only (not shown) • SP: Slave Present (not shown) CSC 370 (Blum) 7
SCSI Jumper • SCSI drives tend to be higher-end drives. They are more sophisticated and the SCSI interface more flexible. Thus the SCSI drives tend to have more jumpers. CSC 370 (Blum) 8
SCSI Jumper (Cont. ) • The master-slave designation in ATA/IDE drives is effectively an an address – one bit to distinguish/address between two drives • The SCSI interface allow more devices (in this case drives) to be connected to a single interface. There are more bits (3 or 4) in the address. • The jumpers indicating this address are known as the device ID jumpers. CSC 370 (Blum) 9
The Terminator • SCSI devices are connected to one another in an arrangement known as a daisy chain. • The termination active jump determines if the device is the “end of the line. ” CSC 370 (Blum) 10
Disable Auto Start/ Delay Auto Start • Recall the power issues involved in spinning up. • Disable Auto Start says do not spin up as soon as you get power but wait for some signal from the controller • Delay Auto Start says when you detect power, delay awhile then spin up • Stagger Spin: delay a time factor based on your ID (address) CSC 370 (Blum) 11
More SCSI Jumper Settings • Narrow/Wide: select between two standard SCSI bus widths • Force SE: select between Single Edge (SE) and (high voltage) Differential (HVD) signals – SE uses one voltage which may be high or low; HVD uses two voltages the 2 nd is the negative of the first, one then examines the voltage difference • Disable Parity: will or won’t use parity CSC 370 (Blum) 12
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). CSC 370 (Blum) 13
Drive cooler CSC 370 (Blum) 14
Bay cooler CSC 370 (Blum) 15
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) CSC 370 (Blum) 16
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. CSC 370 (Blum) 17
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. CSC 370 (Blum) 18
Zone Dependent Data Transfer Rate CSC 370 (Blum) 19
Interleaving • When storing a file larger than a sector, it is sometimes faster to store it on nonconsecutive 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 –… CSC 370 (Blum) 20
Interleaving (cont. ) CSC 370 (Blum) 21
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. CSC 370 (Blum) 22
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. CSC 370 (Blum) 23
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. CSC 370 (Blum) 24
Cylinder and Head Skewing Staggering on a given platter (cylinder skew) and staggering from platter-to-platter (head skew). CSC 370 (Blum) 25
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 CSC 370 (Blum) 26
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. CSC 370 (Blum) 27
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). CSC 370 (Blum) 28
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. CSC 370 (Blum) 29
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 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. CSC 370 (Blum) 30
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. CSC 370 (Blum) 31
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) CSC 370 (Blum) 32
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 CSC 370 (Blum) 33
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) CSC 370 (Blum) 34
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). CSC 370 (Blum) 35
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 CSC 370 (Blum) 36
Filesystem • The filesystem indicates how the data is organized within the drive. – The drive is organized into platters, tracks and sectors. But at the high level data is organized into files. – The filesystem handles this correspondence between the physical location of data on the disk and its logical separation into files. CSC 370 (Blum) 37
File Allocation Table • One of the main features of the filesystem is the file allocation table (FAT). • The FAT is a table used to store the location of files. Sometimes a file cannot be stored entirely in consecutive locations. Then the operating system stores the information about all of the parts of the file and how they are arranged in the FAT. CSC 370 (Blum) 38
Fragmentation • When the files are broken into pieces, it is known as fragmentation. • There is a defragmentation utility that rearranges the data stored on a disk to minimize the amount of fragmentation. • Because reading contiguous data is faster, defragmenting can help with performance. CSC 370 (Blum) 39
Go to My Computer, right click on a drive, choose Properties CSC 370 (Blum) 40
On the dialog box, choose the Tools tab CSC 370 (Blum) 41
Click on the Defragment Now button CSC 370 (Blum) 42
Disk Defragmenter: This could take awhile CSC 370 (Blum) 43
Near beginning of defrag (Note different computer from previous slide) CSC 370 (Blum) 44
Getting bored CSC 370 (Blum) 45
Getting nowhere fast CSC 370 (Blum) 46
Can’t take much more of this CSC 370 (Blum) 47
Finally CSC 370 (Blum) 48
Too many sectors • Tied up with the concept of FAT is the notion of clusters. • The hard drive is organized into sectors but a large hard drive has a large number of sectors. – E. g. 10 GB drive has approx. 20, 000 sectors. CSC 370 (Blum) 49
Clusters • The various sectors must be addressed. Operating systems have a limited size address which in turn limits the number of sectors. – Early partitioning was used to allow hard drives to exceed this limit. • Another solution to this limitation was to address groups of sectors instead of individual sectors. – A set of sectors (4 to 64) grouped together for addressing purposes is known as a cluster. CSC 370 (Blum) 50
FAT • The file allocation table (FAT) stores information about clusters. • The FAT describes how each cluster is being used, for example, which clusters are free and which are being used. – Sometimes the operating system indicates that a cluster is being used when it is not. This is called a lost cluster. – You can free up disk space by reassigning lost clusters with the Scan. Disk utility. • The FAT also indicates how clusters are chained together to form files. CSC 370 (Blum) 51
Disk scanning CSC 370 (Blum) 52
FAT • The FAT is located right after the volume boot sector. • The differences in filesystems (such as FAT, FAT 32 and NTFS) lie in the size of the address and the management of the FAT. • For example, there are usually two copies of the FAT (the second serving as a backup of the first). FAT and FAT 32 differ in how they manage this backing up process. • One can determine the filesystem of a drive by using the chkdsk command. CSC 370 (Blum) 53
chkdsk Command (while running) CSC 370 (Blum) 54
chkdsk Command (completed) CSC 370 (Blum) 55
Chkdsk on a floppy CSC 370 (Blum) 56
FAT Comparison (2 G) CSC 370 (Blum) Not 32 as the name might suggest 57
Slack • With limited addresses and drive capacities growing, cluster sizes were growing. • The problem with large clusters is that one cannot use part of a cluster for one file and the rest for another. • Thus with large clusters there was a lot of unused disk space (known as “slack”). CSC 370 (Blum) 58
Partitioning helped • Breaking the drive down into smaller pieces helped since the address only had to identify clusters within a partition. This allowed for smaller clusters and less slack. • The switch from FAT (FAT 16) to FAT 32 increased the size of the address used to identify clusters. Thus the cluster size could be reduced without introducing a lot of partitions. CSC 370 (Blum) 59
Partitioning can still help • Although FAT 32 allows one to address many more clusters, doing so can have detrimental effects. – The size of the file allocation table increases if there are more clusters. – The file allocation is something you may read often and thus something you might want to cache. But if it is too big, it will not fit in the cache or take up too much room in cache. CSC 370 (Blum) 60
Cluster size automated • The numbers of sectors in a cluster is set automatically within FAT 32. It is based on the size of the partition. – < 256 MB – 256 MB to 8 GB – 8 GB to 16 GB – 16 GB to 32 GB – 32 GB to …. CSC 370 (Blum) 1 sector/cluster 8 sectors/cluster 16 sectors/cluster 32 sectors/cluster 64 sectors/cluster 61
Directories and Folders • Users think of files are stored in directories (or folders). So in addition to the actual location of the information associated with a file, the disk must also store the logical information about where the user believes the file to be stored – the directory structure. • To each directory, there corresponds a file containing a table with information about what files are in the folder. CSC 370 (Blum) 62
Directory entry data • Each directory table entry has data for – Name of the file (and extension) – Attribute byte (read-only, etc. ) – Last data/time the file was modified – File size – Pointer to the first cluster CSC 370 (Blum) 63
Attribute Byte CSC 370 (Blum) 64
File Properties (Right click on file) CSC 370 (Blum) 65
File Properties Dialog Box CSC 370 (Blum) 66
Directory Tree • The files are in directories (folders). The directories are in directories. Ultimately every file on a drive is contained in the root directory. • The root directory plays a special role. The corresponding file is located right after the two copies of the FAT. CSC 370 (Blum) 67
Limited Size? • FAT (a. k. a. FAT 16) limited the size of the root directory. – See table on next slide • FAT 32 lifted this restriction. – Still the root directory is a poor place to locate files. CSC 370 (Blum) 68
FAT Limitations on number of entries in directory file CSC 370 (Blum) 69
File name size limitations • Originally MSDOS filesystems used 11 bytes for the name (8 bytes) and extension (3 bytes) of the file in the directory table entry. – Users were stuck with this naming convention. • Microsoft introduced VFAT in Windows 95 to allow for longer file names. – An alias table was set up, a user’s long file name was assigned to a short file name. CSC 370 (Blum) 70
References • PC Hardware in a Nutshell (Thompson and Thompson) • http: //www. pcguide. com CSC 370 (Blum) 71
- Slides: 71