Scanning drive for bad blocks

The reason for some skips from iTunes turned out to be I/O errors in the Console logs. My drive had a few bad blocks. It didn't remap them automatically on write, so the damage appears to be permanent.


So I had Disk Utility erase and zero the drive, which I've heard remaps them on the filesystem level. But how do I confirm that?


All the tools I know scan the raw device and wouldn't be affected by a remapping via HFS. I could fill the volume to the brim and see if errors occur...

iMac (21.5-inch Mid 2011), Mac OS X (10.6.8)

Posted on Mar 5, 2012 6:49 AM

Reply
9 replies

Mar 5, 2012 7:16 AM in response to lachla

You can fix many bad blocks simply by repairing the directory*:

http://www.macmaps.com/directoryfaq.html


Some vital points which may escape someone skimming my document:

1. Backup your data before attempting any repair.


2. Repair Disk only works when booted off a compatible installer CD, and using the Utilities menu, or via the command line fsck -fy you can

do booting with command-S with built-in/USB Apple keyboard.


3. Repair Permissions has nothing to do with the directory.


4. Alsoft Disk Warrior is more powerful than Disk Utlity/fsck.


None require an erase. If Disk Warrior can't fix it, it usually is time to replace the hard drive.

Mar 5, 2012 9:04 AM in response to a brody

I don't see what bad blocks have to do with the directory, but in my case it is very likely surface damage. That's what the disk said after an extended SMART test, and it fits the fact that the blocks in question an't successfully be written.


*Apple* recommends zeroing the drive to "fix" bad blocks.


All I want is confirm that the blocks won't be used again. Maybe retrieve the map from HFS.

Mar 5, 2012 10:24 AM in response to lachla

When you reformatted, the drive-level software/firmware keeps track of which blocks are physically bad and won't use them in the future.


The real question I would be asking, is why did new bad blocks appear. See the discusison in this article,


http://www2.uic.edu/~aciani1/sector_blues.html#3.1


especially the conclusion 4.0 at the end. The fact that new bad blocks (physical) have appeared is a bad sign for a hard drive. From the above article,


"The occasional single bad sector isn't much to worry about either, especially after a power failure. However, no hard disk should have new bad sectors showing up regularly, or at all. This is a sign that something has gone wrong."


Also,


"If you see bad sectors appearing on the device (outside of ones created by a power failure, and maybe a bump or jar) then it is time to replace it, because others will soon join it, even if you could do a low level format. Most hard disk warranties are long enough to shake down the drive and find those marginal manufacturing defects. If the drive is out of warranty, then it is probably cheaper to replace it with one 4 times its size than to go through the headaches of loosing data. If your data is important to you, then make certain you have multiple copies on different devices; either back it up invisibly with a RAID 1 array, write it to tape, or write it out to optical disk."


If this were my computer, I would replace the drive.

Mar 5, 2012 10:45 AM in response to steve626

The firmware only remaps blocks after a successful write, to avoid silent data corruption. This even applies when erasing a drive, as the firmware can't distinguish that from everyday usage.


(Western Digital has software to force a remapping, but it comes as a DOS boot disk, probably won't work on an EFI Mac, and definitely won't work with external drives)


I said that blcosk couldn't be written and no firmware remapping has happened. I never said that new bad blocks appeared. So far I didn't scan because I think it would still find the old ones. My question is still how to avoid that / confirm the filesystem remapping.

Mar 5, 2012 10:54 AM in response to lachla

You indicated that iTunes was skipping, which you traced to bad blocks (physical). But had iTunes always skipped like this, or is this a new development? If it is a new development, that's a bad sign that something has physically changed in the disk.


I don't know how to confirm the filesystem remapping. But physical bad blocks should never have been written to (they should have been known from the original format of the drive with zeros being written) by iTunes or any other program and they should certainly not be appearing anew.

Mar 5, 2012 11:19 AM in response to lachla

Since a drive can come from the factory with bad sectors and bad sectors can occur later, I follow this policy with all my drives.


1: All new drives get a total Zero Erase (even new computers from Apple, requiring a complete OS X install naturally or reverse clone.)


2: Any drive about to receive +50 GB of data or a new partition that hasn't been Zero Erased Free Space in the last 6 months.



I'm interested in performance, so I'm not particularly fond of the delays caused by the drive trying to read from a failing sector (beachballing) and trying to make up it's mind to map it off or not.


I also don't suffer from as much issues following this policy, either creating partitions, user or system file corruptions. It's a preventative maintenance technique for a more reliable system.


It's possible a sector with a necessary system file(s) could fail on a existing system, why I clone my entire boot drive to a external drive regularly, because with that I can option key boot off of it, zero erase the internal and reverse clone, optimizing and defragmenting the boot drive in the process.


If the drive is still having issues after this, then I will replace it.


I burn DVD's of my music collection once a year as a extra backup which has saved me a few times when I don't immediately notice a song as gotten corrupted.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Scanning drive for bad blocks

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