3

I am developing a high performance database and I want to write directly to a specific track/cylinder with multiple heads at the same time. How is this done in Linux with SATA disks through the SATA bus? Any docs, examples you could recommend?

Nulik
  • 6,748
  • 10
  • 60
  • 129
  • The typical HDD can only perform one read or write operation at a time. In order to perform such optimized block operations, you probably need to write your own filesystem. But since most (or all?) modern HDDs employ zoned recording and bad sector remapping, you can never be sure of where the track ends and the access of the "next" (adjacent) sector ends up involving a seek and/or rotational latency. – sawdust Sep 03 '13 at 10:22

1 Answers1

5

You cannot directly do this. With modern drives the physical drive layout is abstracted away by the drive controller, which for any disk made in the last 20 years is inside the drive itself. The interface seen by the host computer is defined in terms of linear logical block addresses (the C/H/S values reported by the drive are for compatibility only and bear no relation to the hardware layout).

However, it is likely that (in the absence of remapped blocks) simply writing blocks of adjacent logical blocks is the fastest option - that's because drives tend to be optimised to perform fast linear writes.

caf
  • 233,326
  • 40
  • 323
  • 462