write on track / head / cylinder on a magentic disk

113 views Asked by At

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?

1

There are 1 answers

0
caf On

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.