You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to repair bad sectors in Sierra

How do I repair bad sectors in Sierra whether it's internal or external and is there any software to help with this?

Mac OS X (10.7.2)

Posted on Jan 8, 2017 9:09 AM

Reply
13 replies

Jan 8, 2017 9:16 AM in response to ndt1231

If it's an SSD, you don't do it at all. The drive should automatically map out bad cells. Here's an excellent full description found on MacRumors by user MacRobert10.


Normally when an SSD is running, if it detects a bad or marginal block it's supposed to mark it as bad and replace the block with one from the over provisioned area. Detection usually occurs during a write operation and it's normal. Problems can occur when a block containing data, in other words, one that's already been written to, just goes bad. It's a sketchy situation because if the SSD takes the block out and it's in the middle of an existing file, that file will be taken out of the drive's index, essentially making it non-existent. If it leaves it in place, even though it has a bad block in it, the file remains and data can be recovered from the rest of the blocks making up the file. However, the OS will issue an I/O error during a read operation anytime it gets to that bad block, but at least some data may be recoverable.


The same dilemma exists with hard drives - what do you do with a bad block that's not being actively written to but contains data? I question whether or not an SSD will mark a block that's not being written to as bad even if it has problems. I think most are unaware of them until a write operation fails, but the firmware seems to vary considerably from manufacturer to manufacturer.


The way that's worked for me has been to do a system back up and using the manufacturers software, re-initialize the drive. It might be possible to correct the problem by using Disk Utility to re-partition the drive and use the security option to zero out all data. This might work because it might make the SSD's firmware attempt to write to the bad block and then, finally, mark it as bad and move it out of the available blocks. Of course, your SSD will be wiped clean. A simple format using Disk Utility won't work.


Dropped blocks can happen on SSDs just like they can on an HDD, and I'm not talking about HDD head crashes either. One block can just be marginal and it, for whatever reason, just goes bad. I'm actually familiar with this occurring on an iPhone that developed a bad block in the middle of a song. At the exact same point in the song, it would stop playing and iTunes would just quit. Re-iniitializing the iPhone from start and restoring the system fixed it, but that's an iPhone. There was some other post on here some time ago and the guy was having a similar problem with his SSD.


Most bad blocks on an SSD should be mapped out on detection and completely removed when the SSD gets around to doing it's house keeping. Once they've been removed, testing tools like Scannerz or Drive Genius should not be picking them up. If they are, you've got real problems - most likely you've run out of "spare's" in which case the SSD is dead.


There's no point in defragging an SSD. I doubt that would work because to defrag it, an app would have to read the bad block(s) prior to relocation which would fail, hence the operation would fail.


If these are normal rotational hard drives you're talking about, what makes you believe you have bad sectors? Fixing them on typical hard drives is a very long process (lots of sitting around waiting for the process to finish).

Jan 8, 2017 11:39 AM in response to ndt1231

Those errors have nothing to do with bad blocks/sectors. They are all file table (directory) errors. Boot to the Recovery partition (as it tells you) and run Disk Utility > First Aid on the drive producing the errors. If it reports anything as repaired, run it again. Keep running it until it says there are no errors. Though if you do this three times and it still can't fix the errors, you'd be better off making a full backup first, erasing the drive, and then restoring the backup.


Cache cleaning tools are rarely, if ever needed. Don't waste your time.

Jan 8, 2017 10:11 AM in response to ndt1231

You should probably explain the problem you are trying to solve.


For a variety of reasons, all hard disk drives eventually develop bad sectors that are mapped as unusable by the drive's firmware. Eventually, the number of bad sectors increases to the point the drive can no longer be considered reliable, and should be discarded. They can't be fixed. If Disk Utility finds errors that it "repairs" such "repair" should be considered temporary, since they are likely to occur again, perhaps in a very short period of time.


SSDs will also eventually fail, but for different reasons. They can't be fixed either.


It should be noted that a number of non-Apple "disk manager" or "drive utility" products have been known to corrupt perfectly good and formerly reliable hard disk drives. Even if they don't directly cause damage to occur, they cannot possibly help, cannot possibly extend a hard disk's finite lifespan, and can only accelerate its eventual failure. Solution: don't use them. Implement a reliable backup strategy that suits your operational needs. When a drive becomes unreliable, replace it, and restore its content from that backup. To learn how to use Time Machine please read Use Time Machine to back up or restore your Mac - Apple Support.

Jan 8, 2017 10:25 AM in response to ndt1231

John has given you excellent information, which I would only end up repeating. But in a short version, a modern drive's firmware will attempt to catch and map out bad blocks if they form, all without your attention.


This doesn't mean they can't form after the fact. Such as, a file was written to sectors/blocks deemed to be good, but when you try to access a particular file later, the OS throws out an I/O error because of a bad block it can no longer read.


If you haven't seen any such message, and to repeat what I wrote in my first response, what makes you believe you have bad sectors? There's no point continuing if you just have a "feeling" or are guessing/assuming.

Jan 8, 2017 10:51 AM in response to ndt1231

You don't need it, or any other such third party software. The S.M.A.R.T. status of a drive can be seen in Disk Utility. The monitoring it claims to do is what the drive's own firmware already does, and will fix minor errors itself.


Manually fixing bad blocks requires cloning everything on the drive to another location. With all data safely on another physically separate drive, you then use Disk Utility to do a 1 pass erase on the entire drive. This will force the drive's firmware to write data to every sector, check each sector to see if the data can be read back, and map out any bad areas that can't be read. This will take a VERY long time on a 2 TB drive.


It is also completely unnecessary and a waste of time unless you have a genuine reason to pursue it. And that would be if a drive were causing enough I/O error message to appear that it would be a real concern. And any drive in that state isn't worth fixing since they will generally only get worse. Replacing it is the real solution.

Jan 8, 2017 2:49 PM in response to ndt1231

1. Kind of doesn't matter. The first will boot you to the hidden recovery partition on the drive. Adding the Option key boots you to the firmware. Either way will allow you to do a repair of the main drive since it will not be the current startup option.


2. Badly written software, power outages during a disk write, forced restarts during a disk write, other various stuff. It's not common.


3. Avoid the first three completely.


Cleaner apps are really good at, and known to remove things they shouldn't. Like system files. If an app came with an uninstaller, or the vendor makes one available on their site, use that. Otherwise, less complex apps can be removed by simply putting the app in the trash. Some small files may be left over (like settings and prefs), but they're inert without the app that uses them, and typically take up very little space.


All AV software (particularly for the Mac) is almost 100% useless. If they catch Windows malware as email attachments, it's unimportant. They can't run on a Mac anyway. About the only use it has is you know there's one there (if it's not a false positive), and you can avoid accidentally forwarding such malware to those you know running Windows. Is there Mac malware out there? Sure, but nothing yet that runs as a virus, which is software that runs and propagates without any input from you. Virtually all Mac malware are Trojans. Such apps must be downloaded and installed and/or run by you. Just downloaded, they still can't do anything until you launch them yourself. Because of that, AV software is helpless. They are all designed to stop unknown apps that launch themselves from running. That's why the emphasis on anti virus. AV software cannot stop a Trojan. You downloaded it, you ran it. By the time AV software sees what you've run, it's too late. Didn't do you much good, did it?


MalwareBytes for Mac is different, and actually very useful. It is not AV software. It doesn't run continuously trying to protect your Mac. What it does is try to clean up after the fact for malware you've already installed. That is mostly in the form of adware. Not dangerous, but highly annoying. Really obnoxious adware can slow you Mac down as it continually eats up system resources to push ads on the screen. But MB for Mac will also look for more dangerous items, such as keyloggers, back doors, etc. These nastier items are usually installed in Trojan manner by the user. Such as downloading illegal software from torrents or P2P sites. Yup, you installed a hacked copy of Photoshop, and also very likely malware you didn't know was tucked into that illegal installer.

How to repair bad sectors in Sierra

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.