Hard Drive – Fixing HDD Corruption After Power Cutoff

bootfsckhard drivehfs+

Yesterday a breaker tripped in the same room as my Mac Pro 1,1 running Yosemite (Hacked boot.efi.) All other machines powered up but this one. Attempting to mount via Target Disk Mode timed out, so I pulled the drive and put it in a sled so I could access it with my MacBook. First attempt was with Disk Utility, it failed (Who'd have guessed?) I then popped open a terminal window and ran a fsck_hfs -r -d and it appeared to be doing work, but failed to fix the issue. I tried running it several times but to no success.

Posted is my log file, which is odd. There are 2 files which have no thread records, and when fsck_hfs attempts to make them, it returns OK, but appears to have failed on account of it re-attempting multiple times. Anyone else have issues with inconsistent thread counts, and if so, how did you go about a repair? (I know there is always backup, reformat, and reinstall, but given the nature of data and configurations on the drive, I'd like to avoid it as much as possible.)

sudo fsck_hfs -r -d /dev/disk1s2journal_replay(/dev/disk1s2) returned 0
** /dev/rdisk1s2
    Using cacheBlockSize=32K cacheTotalBlock=24576 cacheSize=786432K.
   Executing fsck_hfs (version hfs-285).
** Checking Journaled HFS Plus volume.
   The volume name is Macintosh HD
** Checking extents overflow file.
** Checking catalog file.
** Rebuilding catalog B-tree.
Extent records for rebuilt file 4:
    [ 295120, 129792 ]
    [ 0, 0 ]
    [ 0, 0 ]
    [ 0, 0 ]
    [ 0, 0 ]
    [ 0, 0 ]
    [ 0, 0 ]
    [ 0, 0 ]
hfs_UNswap_BTNode: invalid node height (1)
btree file 4:  1000 records
...
btree file 4:  1718000 records
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is Macintosh HD
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 22063)
    CheckCatalogBTree: fileCount = 706831, fileThread = 706829
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
   Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000
                  CBTStat = 0x0800 CatStat = 0x00000000
** Repairing volume.
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is Macintosh HD
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 22063)
    CheckCatalogBTree: fileCount = 706831, fileThread = 706829
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
   Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000
                  CBTStat = 0x0800 CatStat = 0x00000000
** Repairing volume.
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
    FixOrphanedFiles: nodeName for id=2095107 do not match
    FixOrphanedFiles: Created thread record for id=2095107 (err=0)
    FixOrphanedFiles: nodeName for id=2095108 do not match
    FixOrphanedFiles: Created thread record for id=2095108 (err=0)
** Rechecking volume.
** Checking Journaled HFS Plus volume.
   The volume name is Macintosh HD
** Checking extents overflow file.
** Checking catalog file.
   Incorrect number of thread records
(4, 22063)
    CheckCatalogBTree: fileCount = 706831, fileThread = 706829
** Checking multi-linked files.
** Checking catalog hierarchy.
** Checking extended attributes file.
** Checking volume bitmap.
** Checking volume information.
   Verify Status: VIStat = 0x0000, ABTStat = 0x0000 EBTStat = 0x0000
                  CBTStat = 0x0800 CatStat = 0x00000000
** The volume Macintosh HD could not be repaired after 3 attempts.
    volume type is pure HFS+ 
    primary MDB is at block 0 0x00 
    alternate MDB is at block 0 0x00 
    primary VHB is at block 2 0x02 
    alternate VHB is at block 975093950 0x3a1ec0be 
    sector size = 512 0x200 
    VolumeObject flags = 0x07 
    total sectors for volume = 975093952 0x3a1ec0c0 
    total sectors for embedded volume = 0 0x00 
    CheckHFS returned 8, fsmodified = 1

Best Answer

After trying to use freely available tools for so long, I gave up and purchased DiskWarrior. Fixed the thread-count issue on the first pass. It's a shame that this wasn't easily possible with non-commercial tools, but DiskWarrior does it's job extraordinarily well.