8

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?

2
  • 3
    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. Commented Dec 8, 2011 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. Commented Dec 8, 2011 at 12:28

3 Answers 3

15

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)

3
  • Thanks. So SATA protocols like AHCI aren't really parallel?
    – Stas
    Commented Dec 23, 2018 at 15:35
  • 1
    Short Question is this answer still valid for SSD? SSD doesn't have any physical motor to move the pointer. So is this answer still applicable to SSD? Commented May 26, 2022 at 7:56
  • 1
    No, this is no longer applicable to SSD Commented May 26, 2022 at 13:03
4

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.

1
  • i got it sir,its about cpu scheduling Commented Apr 19, 2012 at 9:56
3

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.
3
  • 1
    What is k, x and y? That numbered list is meaningless now... Commented Dec 8, 2011 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. Commented Dec 8, 2011 at 12:29
  • 2
    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... Commented Dec 8, 2011 at 13:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .