SSDs, HDDs, Bad Blocks & Sectors – The Truth You Thought You Knew
What are HDDs?
Hard disk drives are nonvolatile data storage devices, meaning they retain information stored on them whether they are supplied power or not. They are comprised of many individual components, the actuator and read-write heads to name a few, all of which are vital for operation. Take me to the SSD section!
All of these moving parts make it a delicate piece of equipment, leaving plenty of room for something to go wrong. With all due respect to these awesome pieces of technology, they’re getting a bit outdated (seriously, 1956). But there are still plenty of them out there, so we can’t forget about them just yet.
How do They Work?
Hard drives store data on a multitude of spinning disks that are coated with a magnetic material called ruthenium. An actuator arm inside of the hard drive aligns read-write heads to interpret data that’s been stored magnetically (0’s and 1’s). A second motor exists for the purpose of rotating the disks several thousands of times a minute.
These heads often need to access data stored on several different sectors to complete a given command. Furthermore resulting in increased read times, because it may have to wait for the platters to complete many rotations.
As data continues to be stored and erased in random locations over time, this effect is amplified. Although we’re talking mere seconds, it really becomes noticeable as HDDs age.
To combat this annoyance, read up on disk defragmentation
Or get a solid state drive because they are immune to these delays. This is one of the many reasons why HDDs are considered inferior to their speedy SSD brethren.
Bad Sectors on Your HDD
Bad sectors are little clusters of data on a platter that cannot be read for one reason or another. They are fairly common and have the potential to destroy the drive, along with your data. Bad sectors come in two different forms, or types: hard and soft.
Hard bad sectors are caused by physical damage. Whether it be knocked off a desk, a faulty mechanism in the drive, extreme heat, or anything of the sort, hard bad sectors cannot be repaired. But with some knowledge and common sense, they can be prevented.
Soft bad sectors are logical issues rather than physical ones. Soft bad sectors can happen as a result of error codes found in the sector not matching up with what’s actually there. Essentially, a miscommunication with regards to formatting. Soft bad sectors can be repaired by wiping the drive entirely, but it’s almost more trouble than it’s worth these days.
So, What Are SSDs?
Solid state drives are electronic storage devices that serve the same general purpose as HDDs. The difference is SSDs use a much more sophisticated process of storing data, increasing its speed, robustness, and cost.
One of the most important parts of any SSD is the controller. Think of it as the drives brain. An embedded processor executes code on a firmware-level and bridges the NAND memory components to the host computer.
NAND-flash memory
So what is NAND-flash memory? Information is stored in groups of memory cells comprised of individual floating-gate transistors, or cells. Electrons are stored Inside of the floating-gate transistor as 1’s or 0’s, where the data will reside until it is erased.
Electrons must penetrate the insulating material to be placed on the floating gate by a process called tunneling. Tunneling involves exposing the electrons to a very high voltage, which enables them to pass through the insulation and be stored. Below is a simple diagram of what a floating-gate transistor looks like.
Limited Life of Flash Storage
The downside to this process is that it causes physical degradation to the insulation material. And to reuse one data store on the floating gate, the whole gate needs to be erased and then rewritten. The cycle of programming and erasing in this way directly affects the longevity of each flash cell, resulting in a limited write endurance before the cell is completely degraded.
This is the reason that flash storage has a limited lifespan and fluctuates depending on levels of use.
Now that you know some of the science behind SSDs and NAND-flash technology, it is time to shed some light on bad blocks.
Bad Blocks on Your SSD
To reiterate, NAND-flash memory cells are neatly arranged on printed circuit boards to form rows of pages and columns of strings. Clusters of these strings and pages are called blocks. It can be rather confusing, so take a look at the diagram below.
Cells are marked invalid by the controller for a number of reasons, all of which are intended to balance the system. When a cell is marked as invalid it can’t be used again until it has been erased. In flash storage, data can only be erased by entire blocks at a time, not individual pages or strings.
And due to the nature of writing to flash storage, data on a given block is usually a mix of valid and invalid pages. And to make things even more complicated, in order to reinstate invalid pages, the valid data must be copied to an entirely new location so the whole block can be erased and reused.
This process is called garbage collection and plays a big part in another concept called write amplification, but we’ll save that for another time.
The issue at hand lies within the degradation of floating-gates that we mentioned earlier. No matter what, after a cell has gone through its maximum amount of program-erase cycles (P/E), it becomes unreliable and is removed.
Bad block management maintains a table of broken cells and replaces them with healthy cells that have not yet reached their maximum P/E cycles. The new block typically comes from spare cells that designers set aside for this reason, but if at any time a spare cell does not exist to replace the bad ones, data will be lost for good.
Read Disturb and Error Correcting Codes (ECC)
Due to what is called read disturb, when a particular cell is read over and over again, a nearby cell could also fail. Huge bummer, because this can cause a snowballing effect of bad news for your data. Luckily, the controller keeps track of the number of times each cell is read and moves data from cells about to be disturbed to new blocks.
When data is written, an error correcting code is paired with the data. During a data read operation, the controller calculates another ECC and compares it against the stored code. The controller knows an error exists in the data bits if the two codes do not match. The controller can usually adjust and fix the errors by using the discrepancy in the code, but that is not always the case.
Backup Your Data!
As the tech continues to advance, these issues occur less and less, but why not be safe? Always keep backups of your important data on external drives or in the cloud.
We hope you learned some valuable information about SSDs, HDDs, and their respective bad sectors and blocks. If your data is already long gone due to an issue we talked about, check out our store for a possible replacement!
Be sure keep an eye out for part 2 – The Ultimate Guide to Propriety Apple SSDs.
Show Your Love For This Post
Recommended Posts
High Sierra and Testing RAM
With macOS 10.13, otherwise known as High Sierra, Apple introduced an ambitious EFI update. Several of the changes include: the introduction of the Apple File System, support for NVMe drives, and the usual batch of security updates. However, these EFI updates can cause some unwanted behavior when you test your Apple computer’s memory. At Beetstech, we use a long-time industry standard, MemTest86 to perform a comprehensive test of each computer’s RAM.
But never the type to blindly accept test results, strange testing outcomes led us to discover a bug in MemTest86 affecting computers running the new EFI firmware. In short, the newly updated EFI causes MemTest86 to incorrectly fail certain tests. But there is good news: while normal operation of MemTest86 is limited under these new EFI updates, we also discovered some simple workarounds for testing your Apple’s memory in MemTest86.
So let’s dive into how we discovered the MemTest bug, devised a reliable work-around, and get into some nitty gritty details of MemTest86 operation.
MacBook Air Power-On Pads – Location & Use
They go by “jumper pads”, “short-circuit pads”, “power pads”, and “power-on pads”. Whatever you call them, there are two bits of metal on your MacBook logic board that can force your laptop to boot up, even if the power button won’t do the trick.
OEM MagSafe Chargers vs Cheap Imposters: Teardown for Truth
Anywhere premium products are produced, there are unsavory folks trying to make a quick buck selling cheap knockoffs. It happens in every industry, from clothes to food to tech. But in recent years, counterfeit electronics have surpassed nearly all other categories of counterfeit goods by dollar value, and Apple, being the de facto high-end electronics manufacturer, makes for a prime target.
But you’d never be caught buying counterfeit electronics, because you can tell the difference, can’t you?
The Ultimate Guide to Apple’s Proprietary SSDs
Remember the good ol’ days of carrying a spare battery, upgrading your own RAM, maybe even adding a second hard drive? If you’re an Apple user, those luxuries may be behind us, but upgrading your own solid state drive is still a privilege the Apple overlords allow us to have, for now that is.
Despite retaining the ability to upgrade your own SSD, ever since Apple introduced their proprietary “blade” SSDs in 2010, the task hasn’t been as simple as it once was. Apple talks up read and write speeds, but they rarely dive into the nitty gritty details of the technology behind the SSDs they use — drives specially designed only for Apple computers.
After countless questions, both from customers and our own staff, we decided to start our own investigation into the hardware involved. You have to be a bit of a private eye to uncover the secrets behind these drives, and the deeper we looked, the more surprises we found.
Your Hard Drive Cable Is A Ticking Time Bomb
Owners of a Unibody MacBook Pro laptop are probably already aware that failure of the hard drive flex cable is a common issue. While it affects just about the entire Unibody lineup, the Mid 2012 MacBook Pro 13″ (Model A1278) is especially prone to this type of failure.
What is it that makes the Mid 2012 release special in this regard? A design flaw in the flex cable that seems to be compounded by the properties of the aluminum housing.
Our repair services department noticed this issue when they’d replace a bad cable, only to have the customer return a few months later with another bad cable. And possibly again with yet another bad cable. It didn’t matter if we used a used cable or a new cable in the replacement. Customers kept returning with the same persistent issue. We had to figure out what was causing the issue and find a solution.
Thank you Jase for your blog on the nature of mass storage devices, which are a necessity for all our mobile devices, Notebooks, and workstations to function. Especially the point concerning SSD NANO storage; it gives the consumer a better idea of how and what SSD is about and can do for us. It also informs us that SSD’s are NOT infallible by design, and subject to corruption and fatigue just like any other physical component in our computing devices. With that in mind we can make a more informed choice on the brand/model of SSD storage to choose based… Read more »