17

On several of the newer hard rives that I've used, I've noticed that they will often stop spinning when not in use - presumably to save energy and to prolong its life. Interestingly, however, I've also observed that when a drive isn't spinning, I'm still able to get a directory listing from the top level of the drive - and folders below it. The drive will spin up when I then open an actual file - but how is it possible for a directory listing to be provided when the drive isn't physically spinning?

  • 6
    "several of the newer hard [d]rives [...] will often stop spinning" - I think consumer-grade hard drives have started to do that already in previous century, haven't they? – GrzegorzOledzki Nov 30 '20 at 12:48
  • 12
    Hard drives don't provide directory listings by the way. They only provide bytes. – user253751 Nov 30 '20 at 13:41
  • 1
    @GrzegorzOledzki: yes, HDD auto spin-down timeouts have been a thing for many years, configurable with ATA commands, e.g. on Linux with hdparm to send those commands to the drive. Perhaps the OP means that external (or internal?) HDDs are starting to come with that as the default configuration, which most drives didn't used to. – Peter Cordes Dec 1 '20 at 3:01
67

Caching.

Both the operating system and drive have caches that buffer recently used drive data. If data is in the cache then it does not need to go direct to the disk platter.

Directory listing data will be quite likely to be buffered, especially if you have recently been to that directory.

Modern spinning drives have caches up to 64MB, while your operating system has almost all the memory not currently used by programs.

  • 12
    Seagate IronWolf 8TB (ST8000VN004) has a cache of 256 MB. – Cristian Ciupitu Nov 29 '20 at 20:19
  • 11
    File Allocation Tables (FAT) are not that big. Couple MB at most. Basically always cached because every drive access will go there first. – Nelson Nov 30 '20 at 1:22
  • 2
    For example I recently noticed that my windows keeps up to 10GB of recently accessed files in memory (Sometimes entire movies). Which makes perfect sense when the memory is not in use. – FloPinguin Nov 30 '20 at 8:48
  • 6
    In particular, the OS can smartly read the entire file table at the time the drive is mounted and never touch it again. Modifications to files (e.g. rename, move) are first written to memory, then, at some point, flushed to the hard drive, which now requires starting the motors – usr-local-ΕΨΗΕΛΩΝ Nov 30 '20 at 13:54
  • 2
    NTFS has 4% overhead for the master file table while ext4 has 1.6% overhead for the inodes. So on an 8TB NTFS formatted drive that'd be about 320MB overhead for ntfs. Since the Seagate Ironwolf has 256 MB of chache, most of it, especially subtrees used often, fit neatly into the drives NAND based cache. – jaaq Dec 1 '20 at 14:14
9

In addition to traditional caching, it could be a hybrid drive (SSHD). It looks like a normal spinning disk, but also contains a small SSD. The idea is to get the performance of an SSD for your most frequently accessed data at the price/size of a spinning disk.

The SSD can get as large as 8 GB, for example the awkwardly named Seagate Firecuda. If the data is on the SSD the spinning disk can stop.

  • 1
    Didn't this trend kinda flop because nowadays SSDs are just affordable enough in general? – Hobbamok Dec 1 '20 at 8:57
  • 1
    @Hobbamok I wouldn't say it flopped. It's a transitional technology and the transition is almost over. Dual-drive hybrids are still viable if you need a lot of space on a budget. – Schwern Dec 1 '20 at 9:12
  • 1
    Yeah, I guess for a bigger impact the transition period was too short, and imho the marketing also screwed it up, this tech would still be awesome in budget range laptops, but its nowhere to be found outside of custom builds :/ – Hobbamok Dec 1 '20 at 9:38
  • 1
    @Hobbamok CPU, memory, and capacity sell computers, not hard drive speed, so they cut corners. I used them to replace sluggish 5400 RPM stock drives. Now I'm about to give away my first SSD. I think the other answer is likely correct, I brought hybrids up for completion's sake. – Schwern Dec 1 '20 at 10:01
  • 1
    @Hobbamok Usually, it isn't that worthy, but a decent 7200RPM is way better than a 5400RPM or 4800RPM HDD, and may be more suited for people who use tons of space, for cheap (E.g.: family photos and videos, emails from multiple accounts). Also, I've never seen any SHDD in a 2.5" form factor. – Ismael Miguel Dec 2 '20 at 11:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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