Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Hard Drive Storage. 2 Introduction zThis sections discusses: yHow a hard drive works yHow to estimate storage size yHow to estimate time.

Similar presentations


Presentation on theme: "1 Hard Drive Storage. 2 Introduction zThis sections discusses: yHow a hard drive works yHow to estimate storage size yHow to estimate time."— Presentation transcript:

1 1 Hard Drive Storage

2 2 Introduction zThis sections discusses: yHow a hard drive works yHow to estimate storage size yHow to estimate time

3 3 Hard Drive Parts zHard drives have circular platters on which data may be read or written. zThere may be more than one such platter per drive. zThe platters are further divided into tracks. zTracks are divided into sectors. zSimilarly positioned tracks on different platters are grouped into cylinders.

4 4 Hard Drive Picture zAll Pictures taken from www.howstuffworks.com www.howstuffworks.com

5 5 Side Picture zThis picture shows the read/write heads clearly.

6 6 Sectors and Tracks zThe yellow is a track zThe blue is a sector

7 7 Estimating Storage Size zThere are usually 512 bytes/sector. zYou need to find the number of sectors per track and the number of cylinders per drive. zThe number of tracks per cylinder is the same as the number of read/write heads. zTime for an example:

8 8 Storage Size Example zMy old drive has 2484 cylinders, 16 read/write heads, and 63 sectors. zTrack capacity = 63 x 512 = 32,256 bytes/track. zCylinder Capacity = 16 x 32,256 = 516,096 bytes/cylinder zDrive Capacity = 2484 x 516, 096 = 1.282 x 10 9 bytes/drive zThis is 1,222.6 MB

9 9 Space Allocation zSpace on a disk drive is usually not allocated one sector at a time, but rather many sectors are allocated when a request is made. zThis set of sectors is called a block, an allocation unit, a cluster, etc.

10 10 Space Estimate for a File zSuppose I have a file of fix-length records. How much disk space will it occupy? zI need to know: yThe block size yThe record size yThe number of records

11 11 File Space Calculation zI need to calculate yThe blocking factor, bf, is the number of records per block. yThe total number of blocks, b. yIf desired, the number of tracks and/or cylinders may be calculated as well. zLet’s try one…

12 12 File Space example zSuppose I have a file that has 500,000 records, each of which is 250 bytes long. zSuppose a block is one sector. zMy blocking factor is FLOOR(512/250) = 2 yNote this is unspanned record format. zThe number of blocks is CEIL(500,000/2) = 250,000 blocks/file.

13 13 File Space Example II zUsing the previous drive capacity numbers z#Tracks = CEIL(250,000/63) = 3969 z#Cylinders =3969/16 = 2048.0625

14 14 Time Calculation zThe next question is how much time does it take to retrieve a file? zThere are four different times that may be associated with a file retrieval: ySpin-up time is the time it takes for the drive to spin up to its rated rotational speed. (Does not usually apply to hard drives) ySeek time is the time it takes to move the read/write heads to the correct cylinder yRotational delay is the time it takes to rotate the platter over the appropriate sector yTransfer time is the rate at which data can be transferred.

15 15 Time Discussion zSpin-up plus seek time plus rotational delay is Latency Time. yDisk manufacturers use this term to mean rotational delay only. zThe spin-up time and seek time must be known. zThe rotational delay and the transfer time may be inferred from the rotational speed of the disk and the number of bytes per track. yIn other words, a disk that rotates at 10,000 rpm and has 32,000 bytes per cylinder can transfer 320,000,000 bytes per minute.

16 16 More Discussion zThis assumes the heads do not have to move to do this transfer. zIf the heads need to move to retrieve a sector, rotational delay and seek time must be added in for each such move. zThis is why fragmentation slows down disk access.

17 17 Time Calculation Example zSuppose I have my previous 1.222 GB hard drive. zSuppose further it rotates at 10,000 rpm, has an average seek time of 10 milliseconds. We will ignore spin-up time. z10,000 rpm = 166.67 rps = 6msec/rotation. yThis means one rotation takes 6 milliseconds. yThe average rotational delay is 3msec. z166.7 rps x 32,256 bytes/track =5.37MB/sec yThis is the transfer rate

18 18 Time Calculation Example II zOur previous file had the following: y#Blocks = 250,000 y#Tracks = 3969 y#Cylinders =2048.0625 z 6msec/track x 3969 tracks =23,814 msec yOr 23.8 seconds zAdd in the seek time for each cylinder: y2049 x 10msec=20,490msec=20seconds zTotal time is about 43 seconds. Plus 3 milliseconds rotational delay.

19 19 Time Calculation III zWhat if the file is badly formatted and each block requires a seek? yEach read requires 6/63 = 0.1 msec yEach read requires a seek of 10 msec yEach needs 3 msec rotational delay yEach read: total 13.1 msec yThere are 250,000 sectors to be read x3,275,000 msec total = 3275 sec = 54.6 minutes

20 20 The End Slide zText here


Download ppt "1 Hard Drive Storage. 2 Introduction zThis sections discusses: yHow a hard drive works yHow to estimate storage size yHow to estimate time."

Similar presentations


Ads by Google