1

I recently had a problem with the Macintosh HD that could not be repaired using the disk utility so I erased the disk (using disk utility) then restored from time machine (most recent backup)

Does this result in the HDD being reformatted or could any potentially bad disk areas be reused inadvertently?

  • how did you erase the disk? – klanomath Nov 10 '14 at 20:20
  • "Erasing" the disk is a form of formatting, yes. – tubedogg Nov 11 '14 at 7:56
2

Klanomath's procedures are 100% correct if it's a hard drive.

I use a tool named Scannerz to evaluate drives and it's extremely conservative. If you find bad blocks their procedures are pretty much exactly what Klanomath described, except it will be quite evident how extensive the damage is during testing. SMART technology only finds bad sectors if a write attempt to them has been made and fails. If there's a lot of damage on the drive and it's never been used because it's in free space, SMART will never know about it but Scannerz will pick it up. Zeroing the drive as described will force sector reallocation, and if the supply of spares is exhausted, the operation will fail.

If it's a manufacturing oddity that yielded a few bad blocks, the drive can be recovered by reformatting as Klanomath described. If it's extensive, you could probably partition the bad areas out but that's a risk I wouldn't take. I know some people have done it with success, but you end up with a drive with multiple volumes where one likely existed before.

As far as SSDs go, ideally their drive management software is supposed to pull bad blocks when they're encountered during a write operation. Unfortunately, an SSD, like an HD can develop an odd block here or there that just fails while it's holding data. The problem here is a dilemma, because the people responsible for writing that code must ask themselves whether or not they should just yank a block right out of the middle of an existing file and replace it with a blank, or should they leave it in place, and let the user try to recover what they can from it. This problem is rare, but it can happen.

In any case, typically there are trim and garbage collection routines that an SSD uses that will (hopefully) automatically pull the bad blocks and correct them after a failed write operation. On some SSDs, these may occur while the system is in use, on others they may occur when there's a quiet time of a few minutes.

Steer clear of any tool that tells you it's going to take a bad sector and "repair" it. There's no such thing. That's a dishonest marketing trick that has it's roots back in the 1980's when drives were using MFM and developers could actually gain access to the drive directly, and even then, it was at best only sort of possible to do it. Those days disappeared with IDE when the controller was put right on the HD. Scannerz, for example, has an option to re-map sectors, but a warning will flash up telling you not to do it and that any information in the bad block is already basically dead, and the manual has a warning about a page and a half long, once again, basically telling you not to kid yourself.

  • +1 for mentioning Scannerz and the extensive description of ssd error handling – klanomath Nov 11 '14 at 10:35
1

According to wikipedia 3 levels of formatting are common:

  • Low-level formatting (i.e., closest to the hardware) marks the surfaces of the disks with markers indicating the start of a recording block (typically today called sector markers) and other information like block CRC to be used later, in normal operations, by the disk controller to read or write data. This is intended to be the permanent foundation of the disk, and is often completed at the factory.
  • Partitioning divides a disk into one or more regions, writing data structures to the disk to indicate the beginning and end of the regions. This level of formatting often includes checking for defective tracks or defective sectors.
  • High-level formatting creates the file system format within a disk partition or a logical volume. This formatting includes the data structures used by the OS to identify the logical drive or partition's contents. This may occur during operating system installation, or when adding a new disk. Disk and distributed file system may specify an optional boot block, and/or various volume and directory information for the operating system.

Problems with your disk may occur through physical (bad blocks) or non-physical reasons (bogus b-trees etc.).

Quick Erase or repartitioning will only rebuild the necessary metadata like Volume Header Attribute File etc. from scratch and doesn't map out bad blocks. It's just a high level formatting or a combination of partitioning (without error checking) and high level formatting.

Any other type of erase (1-pass zeros/3-pass/7-pass with read/write operations [valid at least for Mac OS X 10.6-10.10]) will map out bad blocks if sufficient reserve blocks are available. Usually the 1-pass-zeros is enough and doesn't stress the hdd as hard as the other methods.
This method is sometimes referred as Mid-level formatting because it's neither a full Low-level formatting nor a full Partitioning.

You may verify the number of bad blocks afterwards with any SMART utility.

If more than 5 bad blocks are detected get a new disk. Sooner or later it will fail.

The above-mentioned is not necessarily valid for SSDs. Do not full erase (especially 3-pass/7-pass) if there 's no unavoidable necessity.

A SSD has its own bad block management and wear leveling.

1

Plus 1's for everyone as far as I'm concerned. A good question and two good answers.

I'd like, however, to emphasize the following quote from Bob O:

Steer clear of any tool that tells you it's going to take a bad sector and "repair" it. There's no such thing. That's a dishonest marketing trick that has it's roots back in the 1980's when drives were using MFM and developers could actually gain access to the drive directly, and even then, it was at best only sort of possible to do it. Those days disappeared with IDE when the controller was put right on the HD. Scannerz, for example, has an option to re-map sectors, but a warning will flash up telling you not to do it and that any information in the bad block is already basically dead, and the manual has a warning about a page and a half long, once again, basically telling you not to kid yourself.

Drive recovery can be done, with some very, very expensive equipment and people with proper training. Any application that tells you it's going to turn a failed sector into a working sector without this type of equipment is flat out lying.

As far as S.M.A.R.T. monitoring goes, there's free download called "smartmontools" that you can get from the web. There are a few applications out there that basically, as far as I'm concerned, steal the work of the "smartmontools" people, put a GUI front end on it, and then sell it. They don't make it clear that it's a free tool, and they often don't even keep it up to date. Typically they store the binary in the application's folder under Contents->Resources and it will have the name "smartctl". You can check the version by navigating to that folder and typing "smartctl -v" and it will tell you which version they're using. Odds are, it's at least 6 months or more old.

You can get the real smartmontools at the following link:

http://www.smartmontools.org

It's a command line application, but it's at least as up to date as you can get.

Is S.M.A.R.T. a good testing concept ? Well, yes and no. The unfortunate thing about it is it will only recognize problems after the fact. It's sort of like a weather man that shows up to your house after a severe wind storm did damage and announces that a severe wind storm just did some damage. The thresholds are too lenient and often won't predict drive damage properly. Scannerz measures timing artifacts via relative performance indices, and based on a post I read recently in Ars Technica, apparently it's picking up more than S.M.A.R.T. is.

A word of warning about Scannerz: They say to stop all other user programs running other than their own, and they mean it. You can't start a scan on a drive and then start simultaneously download and watch a video or a news show or whatever. It will catch every little timing oddity and report it as an error. I suppose a super high speed system like the new Mac Pro's may not be that influenced by that, but my poor little systems will! I'm not that rich!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .