Presentation is loading. Please wait.

Presentation is loading. Please wait.

Still More on Hard Drives

Similar presentations


Presentation on theme: "Still More on Hard Drives"— Presentation transcript:

1 Still More on Hard Drives
CSC 370 (Blum)

2 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)

3 Drive cooler CSC 370 (Blum)

4 Bay cooler CSC 370 (Blum)

5 Retail vs. OEM Retail OEM (original equipment manufacturer)
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)

6 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)

7 Data transfer rate is track dependent
The spindle rotates at a specified angular speed (e.g 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)

8 Zone Dependent Data Transfer Rate
CSC 370 (Blum)

9 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 CSC 370 (Blum)

10 Interleaving (cont.) CSC 370 (Blum)

11 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)

12 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)

13 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 head skew. CSC 370 (Blum)

14 Cylinder and Head Skewing
Staggering on a given platter (cylinder skew) and staggering from platter-to-platter (head skew). CSC 370 (Blum)

15 Three-Step Process to Use Had 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)

16 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)

17 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)

18 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 in extended partitions. CSC 370 (Blum)

19 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. The extended partition can then be divided into logical partitions or logical volumes. CSC 370 (Blum)

20 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 drives if one has logical partitions. CSC 370 (Blum)

21 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)

22 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)

23 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)

24 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)

25 High-level formatting
After one partitions a disk, the next level of preparing it to be used to high-level (or logical) formatting. Logical formatting provides Volume partition sector System ID byte (identifies partition) Information for the filesystem Data on bad sectors CSC 370 (Blum)

26 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)

27 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)

28 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)

29 Go to My Computer, right click on a drive, choose Properties
CSC 370 (Blum)

30 On the dialog box, choose the Tools tab
CSC 370 (Blum)

31 Click on the Defragment Now button
CSC 370 (Blum)

32 Disk Defragmenter: This could take awhile
CSC 370 (Blum)

33 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,000 sectors. CSC 370 (Blum)

34 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 to allow to hard drives that exceeded 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)

35 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 ScanDisk utility. The FAT also indicates how clusters are chained together to form files. CSC 370 (Blum)

36 Disk scanning CSC 370 (Blum)

37 FAT The FAT is located right after the volume boot sector.
The differences in filesystems (such as FAT, FAT32 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 FAT32 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)

38 chkdsk Command (while running)
CSC 370 (Blum)

39 chkdsk Command (completed)
CSC 370 (Blum)

40 Chkdsk on a floppy CSC 370 (Blum)

41 FAT Comparison CSC 370 (Blum)

42 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. This with large clusters there was a lot of unused disk space (known as “slack”). CSC 370 (Blum)

43 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 (FAT16) to FAT32 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)

44 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)

45 Cluster size automated
The numbers of sectors in a cluster is set automatically within FAT32. It is based on the size of the partition. <256 MB  1 sector/cluster 256MB to 8 GB  8 sectors/cluster 8 GB to 16 GB  16 sectors/cluster 16 GB to 32 GB  32 sectors/cluster 32 GB to ….  64 sectors/cluster CSC 370 (Blum)

46 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)

47 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)

48 Attribute Byte CSC 370 (Blum)

49 File Properties CSC 370 (Blum)

50 File Properties Dialog Box
CSC 370 (Blum)

51 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)

52 Limited Size? FAT (a.k.a. FAT16) limited the size of the root directory. See table on next slide FAT32 lifted this restriction. Still the root directory is a poor place to locate files. CSC 370 (Blum)

53 FAT Limitations on number of entries in directory file
CSC 370 (Blum)

54 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)

55 References PC Hardware in a Nutshell (Thompson and Thompson)
CSC 370 (Blum)


Download ppt "Still More on Hard Drives"

Similar presentations


Ads by Google