# Fall 2001 CSCI 333 Homework 7 Solution

## Problem 1

Consider a disk drive with the following characteristics.

• 10 GB total storage
• 10 surfaces
• 800 cylinders
• interleaving factor of one
• rotational speed of 7500 rpm
• track-to-track seek time of 15msec
• average seek time of 90 msec

## The questions

Answer the following questions regarding the disk drive describe above.

1. How many 512 byte sectors are on this disk drive?
• 512 bytes is one-half kilobyte. 10 GB / .5 kb is 20M.
2. How many total tracks (on all cylinders) are on this disk drive?
• There are 800 cylinders and 10 surfaces (heads). Therefore there are 8,000 tracks.
3. How many sectors are stored on each single track?
• There are 20M sectors in all. If you divide that by 8,000 tracks, you get .0025M sectors per track. Oops! But computer folks think that M means 220, or 1048576, rather than 106. In that case, .0025 M is 2621.44 sectors per track, but you can't really have a .44 sector.
2621 sectors is a large number. Modern disk drives are more likely to have 8,000 cylinders than 800. Also, modern disk drives are zoned, that is, have a variable number of tracks. An IBM 40Gbyte disk drive manufactured in 2000 had 370 sectors per track in its inner cylinders and 792 sectors per track in its outer cylinders.
Early versions of BIOS could not handle disks with more than 63 sectors per track. Consequently, many disk drives pretend to have no more than 63 sectors in a track.
4. How many sectors are stored on each cylinder?
• It's the number of sectors per track multiplied by the number of tracks per cylinder. That's .025M, or 26214.4, ugh.
5. How long, in msec, does it take this disk to rotate?
• 7,500 rpm is 125 revolutions per second. So each revolution requires 8 msec.
6. How many bytes can be read in one disk rotation?
• One track is 1/8000 of the disk. That would be 20GB/8000 or 1,342,177.28 bytes.
7. What is the average rotation delay in reading from the disk?
• It's on-half the rotation time, or 4msec.
8. What is the maximum data transfer rate from the disk?
• You can read 1,342,177.28 bytes in 8msec, so it's 167,772,160 bytes per second.
9. What is the average time, in msec, required to read a random sector of data from the disk?
• Add the average seek time, 90 msec, to the average rotational time, 4 msec, and get 94 msec.
10. If a 100Mbyte file could be stored in consecutive sectors of the disk, how many cylinders and tracks would it require?
• The file is 104,857,600 bytes. According to our calculations there are 1,342,177.28 bytes per track, so that's 78.125 tracks. If we round that up to 79 tracks, it's 7 cylinders and 9 tracks.
11. How long would it take to read this 100Mbyte file stored in consecutive sectors?
• The first seek is 90 msec and the remaining track-to-track seek is 15 msec. On the average it would take 12 msec to read each track, 4 msec to wait for the disk to rotate to the right place and another 8 msec for a full rotation. The total is something like 90 msec plus 7*15 msec plus 79*12 msec, or close to 1142 msec.
12. If this 100Mbyte file was stored in sectors randomly scattered throughout the disk and the file must be read sequentially, how long would it take to read the file?
• Almost forever. The file would require 200k sectors. It would require about 94 msec to read each, so that total time would be a bit more than 19000 seconds, about five hours.
13. If this 100Mbyte file that was randomly scattered throughout the disk could be read in any order, how long would it take to read the file? Consider reading the file by moving from one end of the disk to the other, reading data blocks as they are encountered in each cylinder.
• It's a trick question. With 200k sectors in all, the average number of sectors in a track would be over 25. So, move to the start of the disk, in 90 msec, and then move to all the other 799 cylinders in 15*799 msec. That's about 12 second there. If you read all the data in a cylinder, that requires about 80 (10*8) msec. That's another 800*80, or 64000, msec. The quesstimated time would be about 75 seconds.

## Problem 1 -- as it should have been done

Consider a disk drive with the following characteristics.

• 10 GB total storage
• 10 surfaces
• 8192 (8k) cylinders
• interleaving factor of one
• rotational speed of 7500 rpm
• track-to-track seek time of 15msec
• average seek time of 90 msec

## The questions

Answer the following questions regarding the disk drive describe above.

1. How many 512 byte sectors are on this disk drive?
• 512 bytes is one-half kilobyte. 10 GB / .5 kb is 20M.
2. How many total tracks (on all cylinders) are on this disk drive?
• There are 8k cylinders and 10 surfaces (heads). Therefore there are 80k tracks.
3. How many sectors are stored on each single track?
• There are 20M sectors in all. If you divide that by 80k tracks, you get .25k, or 256, sectors per track,
4. How many sectors are stored on each cylinder?
• It's the number of sectors per track multiplied by the number of tracks per cylinder. That's 2.5k or 2560.
5. How long, in msec, does it take this disk to rotate?
• 7,500 rpm is 125 revolutions per second. So each revolution requires 8 msec.
6. How many bytes can be read in one disk rotation?
• One track has 256 512-byte sectors or 128k bytes.
7. What is the average rotation delay in reading from the disk?
• It's on-half the rotation time, or 4msec.
8. What is the maximum data transfer rate from the disk?
• You can read 128k bytes in 8msec, so it's 16,000k (which is not 16M) bytes per second.
9. What is the average time, in msec, required to read a random sector of data from the disk?
• Add the average seek time, 90 msec, to the average rotational time, 4 msec, and get 94 msec.
10. If a 100Mbyte file could be stored in consecutive sectors of the disk, how many cylinders and tracks would it require?
• With 128k bytes per track, the file will require 800 tracks or 80 cylinders.
11. How long would it take to read this 100Mbyte file stored in consecutive sectors?
• The first seek is 90 msec and the remaining track-to-track seek is 15 msec. On the average it would take 12 msec to read each track, 4 msec to wait for the disk to rotate to the right place and another 8 msec for a full rotation. The total is something like 90 msec plus 7*15 msec plus 79*12 msec, or close to 1142 msec.
12. If this 100Mbyte file was stored in sectors randomly scattered throughout the disk and the file must be read sequentially, how long would it take to read the file?
• Almost forever. The file would require 200k sectors. It would require about 94 msec to read each, so that total time would be a bit more than 19000 seconds, about five hours.
13. If this 100Mbyte file that was randomly scattered throughout the disk could be read in any order, how long would it take to read the file? Consider reading the file by moving from one end of the disk to the other, reading data blocks as they are encountered in each cylinder.
• With 200k sectors in all, the average number of sectors in a cylinder would be track would be 25 and the average number of sectors in a track would be 2.5. If you just calculate the time required to read the entire disk, you'll have a pretty good guess.
So, move to the start of the disk, in 90 msec, and then move to all the other 8192 cylinders in 15*8192 msec. That's about 123 second there. If you read all the data in a cylinder, that requires about 80 (10*8) msec. That's another 800*80, or 64000, msec. The estimated time would be about three minutes.