Hard Disk Analysis

Steven Pungdumri

CSC 471 Introduction to Computer Graphics: Final Project

Dr. Zoe Wood

12/8/2010

 

 

Objective

It would be interesting to be able to observe various attributes of hard disk operation as they actually occur on the platters.  Although there are tools to analyze and view hard disk usage, there are currently none that provide accurate visualization in the form of physical disk platters present in the drive itself.  This graphics project sets out to map hard disk accesses as accurately as possible, representing each platter contained in the drive.  This would open the door to the ability to view other interesting operations, such as cache hits and misses, access times, reads, writes, and more.

Background

Current implementations of displaying hard disk data consist of pie charts, linear representations of data, and other 2-D graph representations.  Although these are definitely helpful, observing the disk usage more literally might show certain insightful trends in reads and writes of the disk.

Western Digital was kind enough to provide some sample data from a PCMark05 HDD - General usage test.  Because this testing software is available to the public, this implementation of hard disk modeling would be applicable towards any data output from a run of the same test.  With this data, the more interesting data to visualize was prioritized and provided enough information to model.

Approach

Data

From a quick analysis of the provided data, accesses would be the starting point of data to display.  The Logical block addresses (LBA) would be the means of placing data at the correct positions.  Cache hits and misses could be estimated by analyzing each access time, but will be left for future work.

A simple parser was written to read in the data from the CSV file containing the test run, and was designed to store all of the data available regardless of its use in this project in order to provide the data for future work.  The data is then partitioned and stored in a hash map corresponding to the head each lies on.  A hash map is used specifically in order to insert and retrieve objects quickly corresponding to the specific LBA.  The partitioning of the data is to be more efficient with what is rendered in OpenGL, only rendering what is on the main platter in view.

Procedure

Mapping Data

The original design was to implement a Cylinder-Head-Sector (CHS) layout of each platter.  This layout is very straight forward, and equations converting LBA to the corresponding cylinder, head, and sector are prevalent.  This approach was abandoned however, because although it is beneficial to learn the CHS layout, this is not how hard disks are laid out today.

The Zone-Bit-Recording (ZBR) layout was used instead, the difference being that there are various zones across each platter, of which there are a constant or variable number of cylinders with a variable number of sectors depending on the zone.  This layout is used today in order to be more efficient with platter space towards the outside of each platter.

The lack of equations and relationship of track to zone, zone to head, and sector to zone was a great hindrance during this project and lead to the majority of time and work being spent on calculating equations to represent these relationships and compromising the design between flexibility and simplicity by observing trends seen in published data.  The decision was to take in a user specified number of zones, tracks per zone, and base sectors per zone.  Analyzing data below proved fruitful in identifying a trend for the number of sectors per track with respect to the zone, although it did not provide much assistance in a common relationship between the number of tracks per zone, therefore this was left as a constant specified by the user.  The insight to use a polynomial equation for the number of sectors per track per zone was implemented, with variables provided by the user.  This with the total number of sectors of the disk (or the highest LBA in the provided data) dynamically creates the polynomial equation used for mapping data by LBA.

 

Zone

Tracks in Zone

Sectors Per Track

Data Transfer Rate (Mbits/s)

0

624

792

372.0

1

1,424

780

366.4

2

1,680

760

357.0

3

1,616

740

347.6

4

2,752

720

338.2

5

2,880

680

319.4

6

1,904

660

310.0

7

2,384

630

295.9

8

3,328

600

281.8

9

4,432

540

253.6

10

4,528

480

225.5

11

2,192

440

206.7

12

1,600

420

197.3

13

1,168

400

187.9

14

18,15

370

173.8

Zone

Tracks in Zone

Sectors Per Track

Data Transfer Rate (Mbits/s)

0

454

232

92.9

1

454

229

91.7

2

454

225

90.4

3

454

225

89.2

4

454

214

85.8

5

454

205

82.1

6

454

195

77.9

7

454

185

74.4

8

454

180

71.4

9

454

170

68.2

10

454

162

65.2

11

454

153

61.7

12

454

142

57.4

13

454

135

53.7

14

454

122

49.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Table 1: Quantum hard disk data (From Quantum Fireball TM Product Manual, © 1996 Quantum Corporation).

                  

Figure 1: Trends from Quantum hard disk data.

After some work with CHS equations, observed trends and relationships, and other sources of reference, the following equations were produced and implemented in mapping data to platters, used each time a specific access was drawn on the model.  Again, most of the variables used in these equations are dynamically generated with the values input by the user.

Graphics

The graphics portions of this project were implemented in OpenGL.  The main topics used from computer graphics were hierarchical modeling, transformations (virtual trackball implementation), and lighting.  Platters were constructed from hierarchical modeling consisting of a cylinder and two circles drawn above and below.  The basic disk structure was then used for drawing the number of disks present (calculated by the number of sectors of the drive and the user input), as well as a main viewing disk of interest, which contained the colored data points.  Lighting was implemented mainly for aesthetics, but will be more important in future iterations of this project when 3-dimensional data points can be implemented to represent another attribute of accesses.

Coloring was done by mapping each access frequency with a corresponding color.  This was implemented with a table of colors ranging from blue to red, corresponding to a simplified rainbow spectrum.

Results

The result of this project is a working program which takes in a CSV input file, along with user specified inputs, requiring the following:

Usage: diskanalysis [numberOfZones] [numberOfTracksPerZone] [baseSectorsPerZone] [m] [n]

With m and n corresponding to the equation:

Initially, a more accurate geometry was calculated for each sector by drawing a GL_POLYGON with multiple iterations to show curvature of the sector with respect to its position from the center.  An early rendering of this without lighting is shown below.  This approach was abandoned however, in order to optimize the rendering time and to ensure each data point representing an access was of uniform size rather than varying with respect to its position from the center.

disk.png

Figure 2: Screenshot of initial rendering with accurate sector geometry and CHS modeling.

 

From this the layout of platters is constructed, and drawn with data points representing each access and a color corresponding to the frequency of accesses.  The following is a screenshot of the application viewing data from a platter of interest.

                   

                    Figure 3: Screenshot of the application observing a platter.

Future Work

Future work will consist of more research and possibly working with a hard disk company in order to obtain more accurate equations and values to map the data.  Work can also be done on analyzing and displaying other attributes of accesses of interest, such as cache hits and misses which would correspond to latency.

References

Dr. Zoe Wood, Cal Poly San Luis Obispo

Anort3, By. "Physical Placement of the Partitions - Hard-Disks - Storage." Tom's Hardware: Hardware News, Tests and Reviews. Web. 09 Dec. 2010. <http://www.tomshardware.com/forum/248308-32-physical-placement-partitions>.

Contrast, By. "Logical Block Addressing." DEW Associates Corporation. Web. 09 Dec. 2010. <http://www.dewassoc.com/kbase/hard_drives/lba.htm>.

Convention, By. "The Story of Storage: Hard Disk." LI HONG. Web. 09 Dec. 2010. <http://lihongxc.blogspot.com/2009/03/story-of-storage-hard-disk-hard-disk.html>.

"Cylinder-head-sector." Wikipedia, the Free Encyclopedia. Web. 09 Dec. 2010. <http://en.wikipedia.org/wiki/Cylinder-head-sector>.

"Hard Disk Sector Structures." DEW Associates Corporation. Web. 09 Dec. 2010. <http://www.dewassoc.com/kbase/hard_drives/hard_disk_sector_structures.htm>.

"Hard Disk Sector Structures." DEW Associates Corporation. Web. 09 Dec. 2010. <http://www.dewassoc.com/kbase/hard_drives/hard_disk_sector_structures.htm>.

"Hard Disks." Internet FAQ Archives - Online Education - Faqs.org. Web. 09 Dec. 2010. <http://www.faqs.org/docs/linux_admin/x1001.html>.

"HDD from Inside: Tracks and Zones. How Hard It Can Be?" HDDScan – Free HDD Test Utility with USB Flash and RAID Support. Web. 09 Dec. 2010. <http://hddscan.com/doc/HDD_Tracks_and_Zones.html>.

"Index of /~reese/EE3724/lectures/fixdisk." Electrical and Computer Engineering. Web. 09 Dec. 2010. <http://www.ece.msstate.edu/~reese/EE3724/lectures/fixdisk/>.

"Logical Block Addressing." Wikipedia, the Free Encyclopedia. Web. 09 Dec. 2010. <http://en.wikipedia.org/wiki/Logical_block_addressing>.

"NTFS.com HARD DRIVES. Hard Disk Drive Basics." NTFS.com File System Structure, Recovery Software, Hard Disk Internals. Web. 09 Dec. 2010. <http://www.ntfs.com/hard-disk-basics.htm>.

"R Graph Gallery (108) Rainbow in the RGB Space." Romain Francois, Professional R Enthusiast. Web. 09 Dec. 2010. <http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=108>.

"Zoned Bit Recording." StorageReview.com. Web. 09 Dec. 2010. <http://www.storagereview.com/guide/tracksZBR.html>.