Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible that one read-write head can do both copy and paste at the same time even on different tracks? How does that happen?

share|improve this question
2  
If you mean "why is moving a large file from one directory to another on the same volume so much faster than moving it to a different partition?" then the answer is because only the file's entry in the file table is altered rather than physically moving the file. –  Andrew Lambert Dec 8 '11 at 8:21
    
Nope. Except that there have been, at times in computer history, disk drives with more than one head, and sometimes more than one arm. –  Daniel R Hicks Dec 8 '11 at 12:28

3 Answers 3

up vote 12 down vote accepted

I/O requests are put in a queue, and handled one by one.

There are various disk scheduling algorithms, picking the best one improves the time required to handle all the requests that are in the queue. A disk scheduling algorithm in general orders this queue in an attempt to more efficiently handle the request such that the head has to move less, the FIFO aka FCFS algorithm is an exception to this as it just reads the queue...

Given that the seek time (the time to go to a location) is smaller if the head has to move less fast, multiple requests are handled fairly fast using the right disk scheduling algorithm. This is why it looks like if it was read/written very fast, but not in any case simultaneous... :)

I'll list the most popular disk scheduling algorithms, more can be found at Wikipedia.

Note: Files are usually fragmented, so to read one file multiple requests are put in the queue.

Note 2: If you mean "why is moving a large file from one directory to another on the same volume so much faster than moving it to a different partition?" then the answer is because only the file's entry in the file table is altered rather than physically moving the file. — Comment by Amazed

FIFO aka FCFS: First-In First-Out aka First Come First Served

All requests are taken from the start of the queue without reordering them.

SSTF: Shortest Seek Time First.

The request that takes the least move of the head is taken from the queue.

Note how the head has to move less, it stays still for the first three images.

SCAN: Like an elevator.

This always take the furthest away, then handling stuff it passes along the way.

In this picture it starts at track 2 and plans to go to track 4; so, it tries everything at track 2, then track 3 (nothing), then track 4, after which it goes to the furthest request which is track 1; so, it goes back and tries track 4, track 3 (nothing), track 2 (nothing) and then track 1.

Images: University of Wisconsin-Madison - CS 537 - Disk Scheduling (Originally might be by a book)

share|improve this answer

One step at a time.

  1. Set k to 0.
  2. Read from x+k.
  3. Write to y+k.
  4. Increment k by 1.
  5. If not done, go to 2.
share|improve this answer
    
What is k, x and y? That numbered list is meaningless now... –  Tom Wijsman Dec 8 '11 at 11:45
1  
@Tom: This whole question is meaningless. I can't for the life of me understand how someone can't visualize moving stones from one pile to another one stone at a time. –  Ignacio Vazquez-Abrams Dec 8 '11 at 12:29
    
The problem with that metaphor is that you can also move them all at the same time. The question might be stated in a bad way, but you can't expect much more from a layman... –  Tom Wijsman Dec 8 '11 at 13:11

How is it possible that one read-write head can do both copy and paste at the same time even on different tracks?

It isn't possible.

Firstly read-write heads do not perform "copy" or "paste" operations. Those are much higher level concepts that apply in file-management applications such as Windows Explorer.

The application and the operating system progressively break the copy and paste operation down into multiple smaller and smaller operations. Eventually the disk controller asks the disk to read some sectors. Later it asks the disks to write some data to certain other sectors. During and between these operations the actual disk-heads may also be performing lots of other unrelated operations and seeking back and forth across the physical columns or tracks. Optimisations are carried out at many levels in this process to maximise the amount of useful work that can be carried out by the disk every microsecond and to maximise the number of processes whose IO-operations can be progressed, according to their established priorities.

share|improve this answer
    
i got it sir,its about cpu scheduling –  NullPoiиteя Apr 19 '12 at 9:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.