PDA

View Full Version : Hard Drive I/O Error


Matthias
01-07-2010, 10:07 PM
My Macbook Pro's primary partition went belly up the other day. It seems the filesystem's tree got corrupted. While this is theoretically recoverable, I cannot run fsck because the disc won't mount. It says the disk has I/O errors preventing it from mounting. Meanwhile, my Boot Camp partition works great (I'm posting from Windows XP right now).

The disk itself attaches just fine, and all partitions are viewable- my Mac partition simply won't mount. I've even been able to run ddrescue, a utility that copies a partition bit-by-bit to another partition or image file (sans 130 megs of apparently corrupted sectors) so I have a nearly exact copy of the drive.

Has anyone seen this "I/O error" before? My googling attempts have returned up few mentions of it and no definition or solution. I'm planning to wipe the drive as soon as I verify that my new image file does indeed have at least some of my unbacked-up files on it, but if I can fix this I/O error and repair the filesystem, I'd much rather do that to recover the files before I ultimately wipe the partition.

What are your thoughts?

RandoM51
01-08-2010, 08:24 AM
Filesystem mount comes after fsck, not before, although the fsck(s) are generally triggered by a mount/mountall command during the boot process. The OS issues the mount/mountall command, the system checks the flags on each filesystem to see if it was unmounted cleanly and if not it runs a more in-depth fsck to check/repair the filesystem before mounting.

Typically if fsck itself returns an I/O error on a filesystem while the partition map itself looks fine it is because the partition and/or filesystem in question doesn't match---in terms of geometry---what the partition map reports.

It could also be hard errors on the disk where the partition itself resides. Since the partition map itself is stored elsewhere it will look fine and even your other partitions might be fine while that partition is still hosed up.

Either way, you're probably going to have to format(newfs/mkfs, whatever it is called in OSX) that filesystem/partition. After that you need to run a check for low level/physical disk errors on that partition before using it again. If you're lucky it will mark a few bad blocks and you can go on your merry way. If you're unlucky it will mark a ton of bad blocks... and then more each time you run it and it will be time for a new hard drive.

Matthias
01-08-2010, 04:41 PM
Filesystem mount comes after fsck, not before, although the fsck(s) are generally triggered by a mount/mountall command during the boot process. The OS issues the mount/mountall command, the system checks the flags on each filesystem to see if it was unmounted cleanly and if not it runs a more in-depth fsck to check/repair the filesystem before mounting.

Typically if fsck itself returns an I/O error on a filesystem while the partition map itself looks fine it is because the partition and/or filesystem in question doesn't match---in terms of geometry---what the partition map reports.

It could also be hard errors on the disk where the partition itself resides. Since the partition map itself is stored elsewhere it will look fine and even your other partitions might be fine while that partition is still hosed up.

Either way, you're probably going to have to format(newfs/mkfs, whatever it is called in OSX) that filesystem/partition. After that you need to run a check for low level/physical disk errors on that partition before using it again. If you're lucky it will mark a few bad blocks and you can go on your merry way. If you're unlucky it will mark a ton of bad blocks... and then more each time you run it and it will be time for a new hard drive.

I have a utility called TestDisk that can alter the geometry of the partition, but it didn't seem to report a mismatch between the map's expected geometry and the partition's, and the holes that popped up in my bitwise backup seemed to indicate bad sectors. I'm definitely going to reformat (using the handy dandy install disk), but am putting it off in the hopes that I could cobble it back together long enough to directly access the files. As it stands, I'm going to use this other utility, PhotoRec, to scan for file headers and grab data. I'm hoping the disk is non-fragmented enough for this to work.

What utility would I use to do the low level disk check you mentioned? And how many bad sectors are acceptable on a disk? Apple will replace the disk if I need it, but I'd rather avoid the hassle if possible, as school is starting soon.

RandoM51
01-10-2010, 11:31 AM
What utility would I use to do the low level disk check you mentioned? And how many bad sectors are acceptable on a disk? Apple will replace the disk if I need it, but I'd rather avoid the hassle if possible, as school is starting soon.

If it is a SATA/ESATA/ATA disk you might want to download a freeware SMART utility to see what the drive has to say about physical disk errors.

I'm not up to speed on disk utilities for OSX but you might check out Disk Warrior or TechTool Pro.

If there are a bunch of new physical errors on the disk I'd get the drive replaced if it is under warranty. It has been my experience that when a drive starts accumulating physical disk errors it is only a matter of time before it fails.

torrefaction
01-10-2010, 12:53 PM
Random has said just about everything worthwhile and important that needs to be said. In short,listen to him.

Matthias
01-10-2010, 10:23 PM
lol thanks Random (and torre). I just found out AppleCare comes with a copy of Tech Tools Deluxe, so I'm running a full line of diagnostics on the drive right now. Unfortunately, after about 8 hours, I'm only ~54k sectors into a scan of >3M, and already have 220 errors. Doesn't bode well. The last test is a volume check and repair though, which may patch thinks up well enough to recover files.

I haven't been able to get a straight response from Apple about whether they'll replace a drive with several bad sectors if SMART is still verified. I'll keep working with them about this, because I'd really like to not have to deal with a problem like this once school starts.