Calculating hard disk reading time

15,370

I think the problem is not really about computers or hard disks, if it is asked like in the exam question. It is more about basics.

  • If you have 7200 RPM, that means the disk will rotate (7200/60) = 120 times per second
  • Each time the disk does a whole rotation, you are theoretically able to read 1 complete track. That means reading 1 track takes (1/120)s

So, now the question of the 1ms seek time:

  • If you can do a continuous read, then you have to add the seek time only once. So you have (1/120)s for each track and the one-time addition of seek time. This seems like an oversimplification.
  • More realistically: Assuming the question implies that you need an additional 1ms (1/1000)s to switch from one track to the next, you can not read 120 tracks each second as the rotation alone would suggest.
  • Taking the rotation and the seek time into account, each track will take (1/1000 + 1/120)s to read.

Note:

As @sawdust correctly points out in the comments, this answer uses multiple simplifications. This is due to the fact that no more information was given in the question and I tried to work with the basics. If the question is more complex (or dealing with actual hardware, instead of being an exam question), these factors have to be accounted for:

  • The disk might have multiple (say, N) platters, so the 20000 tracks can be distributed over the N platters. In general, a platter can be used on both sides.[1] So the 20000 tracks each of the 2N Read-/Write-Heads in the drive are not 20000 cylinders, but rather 20000/(2N) cylinders. That might enable to read 2N tracks at the same time. Then, reading 2N tracks takes (1/120)s.
  • The seek time should not be fixed to 1ms. It is usually a combination of head seek time, where the head is moved to the correct cylinder (which might not be always constant depending on where you are on the drive), PLUS the rotational latency, which means the disk itself has to rotate until the head is above the correct sector. On average, the rotational latency might be simplified to be half of the time it takes the disk to do 1 whole revolution. So the rotational latency might be around (1/240)s for each new cylinder.
  • Real drives can have certain latency issues when facing problems to read the data correctly. This happens when blocks are damaged or otherwise difficult to read and by the drive tries to read the sectors with different head positionings and parameters to increase the chance of retrieving any data. The resulting latencies can sometimes even be observed with new retail drives and must be taken into account when planning a real system that depends on timely disk reads. So you can not always assume that a track will be completely read after 1 single revolution. The problem can become very bad, so more enterprise drives offer features such as TLER to limit the allowed time to retry reading a sector.[2]

[1]: Wikipedia: Cylinder-Head-Sector
[2]: Western Digital: Difference between Desktop edition (WD Blue, WD Green and WD Black) and RAID (Enterprise) edition drives

Share:
15,370

Related videos on Youtube

Panayiotis Irakleous
Author by

Panayiotis Irakleous

Studying computer science

Updated on September 18, 2022

Comments

  • Panayiotis Irakleous
    Panayiotis Irakleous over 1 year

    I am studying for my exams and I am stuck on the following problem:

    One disk has 20000 tracks, a speed of 7200 RPM, and a seek time of 1 ms. The question asks for me to calculate the total time that is needed to read all tracks on the disk. It gives us one hint: the transfer time of a track is the time that it needs to do a full round under the disk head.

    I have tried to find the transfer time first but I don't know if correct. I get 7200/3600.

    How can I solve this one?

    • Xavierjazz
      Xavierjazz almost 9 years
      Sorry, it is against the policy of most here to help with homework - you'll have to do it yourself. :)
    • Ramhound
      Ramhound almost 9 years
      Helps if you use the correct terms.
    • Panayiotis Irakleous
      Panayiotis Irakleous almost 9 years
      is not a homework i practise for my exam
    • Panayiotis Irakleous
      Panayiotis Irakleous almost 9 years
      @Ramhound this is all that the exercise give us
    • Ramhound
      Ramhound almost 9 years
      The question says exactly "20000 buses"? It uses the term "buses"? Now come now....You indicating its not homework is just beating a dead horse, it basically is homework.
    • Panayiotis Irakleous
      Panayiotis Irakleous almost 9 years
      @Ramhound channels
    • Ramhound
      Ramhound almost 9 years
      So if its channels why did you use the term buses? The term "channels" doesn't make sense in this context either. How about you quote word for word what the question actually is?
    • Panayiotis Irakleous
      Panayiotis Irakleous almost 9 years
      @Ramhound i think is track. sorry for my english i am trying to translate the question. So i want to calculate the time in ms that we want to read all the disk
    • Ramhound
      Ramhound almost 9 years
      track; would be the correct word.
    • Panayiotis Irakleous
      Panayiotis Irakleous almost 9 years
      @Ramhound i am sorry for that. is there any formula that i can do to find the answer?
    • Ramhound
      Ramhound almost 9 years
      Existing questions cover this subject. Your basic course book would cover this. You might want to study the material before trying to do the questions, it might help, don't study the test....its not helpful. Question with your answer
    • Cfinley
      Cfinley almost 9 years
      @PanayiotisIrakleous The hint gives it away. Calculate how fast it takes for one track to go around once (in ms) and multiply that by how many tracks there are. Add the 1 ms seek time. That should do it.
    • Panayiotis Irakleous
      Panayiotis Irakleous almost 9 years
      @Cfinley for the seek time i will have to multiply it with the tracks?
    • Cfinley
      Cfinley almost 9 years
      @PanayiotisIrakleous You should only add that once, as you are reading from the start of the disk to the end of the disk.
    • Cfinley
      Cfinley almost 9 years
      @PanayiotisIrakleous Make sure that your units are the same. You have both minuets and milliseconds in the question, but the question doesn't ask for one specifically. I assumed ms in my previous comment.
    • sawdust
      sawdust almost 9 years
      The problem/question is incompletely specified. The geometry of the drive, i.e. tracks per cylinder, is not provided. Hence the number of seeks cannot be determined The seek time is given as a single constant, whereas with a real HDD, the seek time is a function of the number of cylinders traversed. Hence the time spent on seeks cannot be determined Also "transfer (to host) time" != "read (from track) time".
  • Cfinley
    Cfinley almost 9 years
    If you are unsure about the seek time, ask your instructor BEFORE the exam. Slizzered and I have different ideas how that should work. (I am assuming he is correct here).
  • Panayiotis Irakleous
    Panayiotis Irakleous almost 9 years
    someone told me that the seek time is to switch from one track to the next
  • Slizzered
    Slizzered almost 9 years
    @Cfinley I added your idea of only adding seek time once, since I find it at least worth to consider, given the rather ambigous wording of the question. Even if adding it for each track is correct, it might still be good to keep people thinking about the possible ways to interpret the question
  • Slizzered
    Slizzered almost 9 years
    @sawdust Yes, I did omit several facts that should never be overlooked when dealing with actual hardware. However, the question as stated does not give any further information. All the arithmetically-oriented exam questions I usually deal with are structured in a way that you can actually solve them. So, given the information, I assumed all other factors to be negligible. But you are correct, so I will add a disclaimer to the answer. Thanks for pointing that out