Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Discovering Hard Disk Physical Geometry Through Microbenchmarking (stuffedcow.net)
152 points by rrampage on Nov 9, 2019 | hide | past | favorite | 18 comments


By symmetry, there are two similar layouts that order cylinders from inside to outside, but I have not seen these used.

That's because the fastest transfer speeds occur at the outside, and drives are filled starting from the first logical block (often the first set of files to appear on a drive is the OS), so it makes sense to.

Interestingly, optical media (DVDs, CDs, BDs, LDs) start at the innermost radius so the fastest transfer speeds are at the end. On the other hand, bare optical media is handled physically and the outer edges are more likely to be damaged, so it makes sense to start on the inside (and the initial sectors contain critical information about the media, which if damaged would render it completely unreadable) --- I don't know if this is the official reason for the layout, but it's plausible. Here's an informative graphic comparison:

https://en.wikipedia.org/wiki/File:Comparison_disk_storage.s...


IIRC correctly, unlike HDDs, (audio) CD players change their rotation speed to match the data density, because they need the data at a constant bit rate. So it wouldn’t matter whether the data starts inside or outside. I think your argument about physical robustness is very plausible.

Additionally, starting from the inside allowed for physically smaller disc formats without any special software support: https://en.m.wikipedia.org/wiki/Mini_CD

I don’t know for sure if that possibility was part of the original design. But it must have been introduced somewhat early, given that every CD player tray I’ve ever seen has that extra ridge to hold the smaller discs in place.


Depends on the drive. Game consoles and computers tend to have CAV drives. Early 1x speed 'media player' drives tend to be CLV though yeah because they're working at the margins of acceptable bitrate as it is with real time constraints.


It’s still dumb from a power utilization standpoint to go inside to outside when that means you always have to spin the fastest for the always present data and slow down as you go.


CDDA is purely CAV optical medium.


CDDA is CLV. https://en.m.wikipedia.org/wiki/Constant_linear_velocity

CD ROM drives may spin CD's with CAV, but if so the data rate changes, increasing steadily towards the outer edge of the disc.


I suspect CD ROMs used CAV (in contrast to audio CDs which used CLV) because the processors (perhaps originally based off audio processors) could intially only deal with a fixed data rate, and with CLV + random access, the drive would have to spin up and down repeatedly according to where on the disk the laser had seeked to, which would have a large impact on random access times. As the speed of drives got faster and faster (up to 52x) that problem wouldve been exacerbated too.


One other thing you might want to measure is how quickly you can do a write to disk. On some 2.5" WD Black drive I was benchmarking years back, I got a ~2 ms minimum time between uncached writes. Keep in mind it's 8.333 ms per rotation on a 7200 RPM drive. The simplest methodology is to perform a write at sector zero, wait until it's acked, then perform one at sector N, and see how low you can set N. It was a bit less than a quarter the way around the track.

So if you wanted to optimize your file system for some sequential fsync workload (which iirc affected Firefox performance at some point), well, you might want strategically placed regions around disk for updating your write-ahead log.

That drive burnt 230 μs just doing a cached write, which only took 30 μs (or 60?) on an Intel SSD, so there was a lot of fluff going on.


He says that short stroking only improves iops by about 20%, which is nothing to sneeze at but also not that impressive.


The case I'm talking about is no-stroking, where you're on the same track.


People do approximately the same thing with flashbench on SD cards, to figure out the best alignment for more speed and less wear. RAID options of Ext4 are also exploited on both SD and SSD, to get the fs to align writes to desired block sizes. See https://wiki.gentoo.org/wiki/SDCard and https://thelastmaimou.wordpress.com/2013/05/04/magic-soup-ex...


Really glad people like the author exist. Who would do all this (presumably) on their own time, merely to satisfy their own curiosity.

Bravo!


Yes, this is as detailed as the last article about c++ vs rust microbenchmarks. Excellent content, and likely tooka really long time to write.


Astounding depth. Reminds me of tuning interleaves with SpinRite, some time before the old disk he's using was made.


Turns out I had some exceedingly out of date ideas of how sectors are laid out on the platters.

Now I understand some of the conversations about logical cylinder addressing when drives first started getting too big for the addressing scheme.


One of the coolest articles I've seen in a long time!


I’m surprised this hasn’t (yet) been exploited in one way or another for fingerprinting.


Something similar has been used for detecting faked drive specifications and rotational speeds:

https://forum.hddguru.com/viewtopic.php?t=38333

(That site and the HDDoracle one linked from there have lots of low-level information about hard drives, mostly in the context of data recovery.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: