X

Addressing physical vs. logical problems on hard disks in OS X

There are various reasons why files on a hard disk may not be properly accessible. Here are some reasons and ways to identify and address each in OS X.

Topher Kessler MacFixIt Editor
Topher, an avid Mac user for the past 15 years, has been a contributing author to MacFixIt since the spring of 2008. One of his passions is troubleshooting Mac problems and making the best use of Macs and Apple hardware at home and in the workplace.
Topher Kessler
4 min read

When managing your hard drive in OS X there are several potential problems that can crop up, including issues with the drive itself as well as those pertaining to the file setup on the drive. All of these can result in the inability to read or access files, and may, depending on the severity, result in anything from errors and brief pauses to system hangs or crashes. Apple lumps the management of some of these problems into its Disk Utility program, which is convenient but does have the effect of blending their meanings together, such as assuming a permissions fix and a disk fix are the same thing.

For example, if you are experiencing permissions errors, then if you reinstall your OS, you likely will eliminate the problems. Some people may take this to mean that if they get other problem warnings in Disk Utility, like file-system errors when running Disk Utility's Verify Disk routine, then they can similarly fix it by reinstalling their OS. Unfortunately this is not the case, and it may help to understand various realms of where problems may happen on hard disks.

  1. Physical problems

    Physical problems with hard drives include I/O errors that can happen because of bad blocks, overheating, or problems with the drive's firmware or controllers that result in an inability to read data. If this happens, then the drive's S.M.A.R.T. technology may kick in and issue a warning to any S.M.A.R.T. monitoring tools (including Disk Utility), but the use of S.M.A.R.T. is a bit hit-or-miss as it many times does not detect defects in a drive.

    If you suspect physical problems in a drive, either by major pauses in the system, kernel panics, or numerous I/O errors in the system logs (you can check this with the Console application), then your best bet is to immediately back up your files and then use a robust utility like TechTool Pro, Drive Genius, or Disk Tools Pro to run diagnostics on the drive. If you decide to run a "Verify Disk" routine with Disk Utility or other file-system management tools, you may find the disk repair routine will not be able to complete.

    One additional thing to consider is that while it may be possible to get the drive working again, drives are cheap and replacing a faulty one may be a far easier and lower risk task than fixing a bad one.

  2. File-system problems

    Beyond physical problems are issues with the filesystem setup on the drive (the formatting), which like physical problems can also result in hangs or crashes. These may happen through regular use of the system, especially if you experience any system crashes, power outages, or other problems that result in the sudden and unexpected ejection of your drive. It may also happen if you perform routines like resizing or creating new drive partitions. Each volume on the drive contains a number of directory files on it that are used to catalog where the data is stored, and these files may get corrupted through abusive use and result in the inability to locate data.

    To address file-system problems you can use Disk Utility's "Verify Disk" routine to check the disk's catalogue files, which should complete and give entry miscounts, unexpected numbers of entries, or other errors with "b-tree," "extents, " or "volume bitmap" files. In these cases you can try to fix the disk using Disk Utility's Repair Disk routine (you will have to run this from the OS X installation DVD for your boot drive), but your best bet would be to use a more robust volume management tool like Disk Warrior.

  3. File problems

    The last potential problem with hard drives are file-related issues that have more to do with the system and the way you use it rather than the drive itself. These are mainly permissions problems, where files may not be accessible because some action you performed on your system altered the permissions of a files, but can also be seen in file corruption. This can happen from system migration, manual alteration of files (especially with untested software), and installing applications and system updates.

    To fix permissions problems you can run a permissions fix on the boot drive using Disk Utility; however, do keep in mind that the requirements for permissions are, for the most part, much less strict than filesystem or physical drive integrity. Usually processes just need to be able to access a file, and there are many permissions permutations that can result in granting proper access to the file. Therefore, even if a file's permissions differ from Disk Utility's expectations in its permissions database, the files may still be perfectly accessible.

    To address file corruption, your best bet is to find a way to replace the file. Restore it from backup if you have to, or try to open it using an alternate program and then resave it to restore its contents in a fresh file format.

While these three areas may seem distinct, keep in mind there can be some blending of them. For instance, if despite reformatting and repartitioning a drive you still get filesystem errors, then it may be that a subtle physical problem is resulting in filesystem corruption. Likewise, if file corruption and permissions issues keep cropping up, then it may be that filesystem corruption (and subsequently physical problems) could be to blame. If you have recurring problems on your drive, be sure to first check the drive for physical errors, and then move to checking the filesystem for logical errors, followed by addressing individual file permissions and corruption.



Questions? Comments? Have a fix? Post them below or e-mail us!
Be sure to check us out on Twitter and the CNET Mac forums.