If I run fsck_hfs -y -d /dev/rdisk2s10 it putters along, rebuilds the catalog B-tree then fails when writing the new catalog to disk.

bash-3.2# fsck_hfs -d -y  /dev/rdisk2s10
** /dev/rdisk2s10
Using cacheBlockSize=32K cacheTotalBlock=16384 cacheSize=524288K.
Executing fsck_hfs (version diskdev_cmds-491.6~3).
** Checking Journaled HFS Plus volume.
** Checking extents overflow file.
** Checking catalog file.
Invalid node structure
(4, 19740)
** Rebuilding catalog B-tree.
BlockFindAll:  1060209 blocks free, but need 2314620; ignoring for now
BlockFindAll:  found 1938640 blocks but needed 2314620
Disk full error
** The volume MongoDisk could not be repaired.
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 1953261182 0x746c667e 
sector size = 512 0x200 
VolumeObject flags = 0x07 
total sectors for volume = 1953261184 0x746c6680 
total sectors for embedded volume = 0 0x00 

Diskutil reports the following for this partition:

Device Identifier:        disk2s10
Device Node:              /dev/disk2s10
Part Of Whole:            disk2
Device / Media Name:      Apple_HFS_Untitled_1

Volume Name:              MongoDisk
Escaped with Unicode:     MongoDisk

Mounted:                  Yes
Mount Point:              /Volumes/MongoDisk 1
Escaped with Unicode:     /Volumes/MongoDisk%FF%FE%20%001

File System:              HFS+
Type:                     hfs
Name:                     Mac OS Extended
Owners:                   Enabled

Partition Type:           Apple_HFS
Bootable:                 Not bootable
Media Type:               Generic
Protocol:                 FireWire
SMART Status:             Not Supported
Volume UUID:              4758CE30-CA9C-3DF1-90D6-0436772E622D

Total Size:               1.0 TB (1000069726208 Bytes) (exactly 1953261184 512-Byte-Blocks)
Volume Free Space:        146.8 GB (146791854080 Bytes) (exactly 286702840 512-Byte-Blocks)

Read-Only Media:          No
Read-Only Volume:         Yes
Ejectable:                Yes

Whole:                    No
Internal:                 No

My suspicion is that the extents tree indicates a full volume, so that diskutil can't find a place to write it.

The man page for fsck_hfs claims that you can rebuild the btrees individually with the R flag. Doesn't work on Snow Leopard.

Is there a way to fix this short of reformating the drive?

Any recommendations to other commandline utilities to beat up on HFS file systems?

2 Answers 2

  • Perhaps Disk Warrior will be of some help. It's the best for recoverying the volume: http://www.alsoft.com/DiskWarrior/

  • Stellar Phoenix Macintosh - Mac data recovery software, recovers data from damaged, deleted, or corrupted volumes and even from initialized disks. They have a trial version, so I guess you can see if your data can be recovered...

  • Data Rescue II is the best data recovery software on the market for recovering files from a problem hard drive. Data Rescue II works when other tools fail. Data Rescue II is also completely safe to use since it does not attempt any risky repairs to the drive while its scanning.

  • FileSalvage is an extremely powerful Macintosh application for exploring and recovering deleted files from a drive or volume. FileSalvage is designed to restore files that have:

    • been accidentally deleted.
    • become unreadable due to media faults.
    • been stored on a drive before it was re-initialized/formatted.


mac data recovery

into Google will list some firms who specialize in recovering data. Data recovery isn't cheap.

  • In one sense this is not critical. It's used for time machine, and I can just reformat it. This is an opportunity to learn how to fix things myself, hence the request for other command line tools. Mar 19, 2013 at 10:37
  • However you get points for having a good description of commercial solutions. Mar 19, 2013 at 10:38

That's a wonderful little deadlock situation the Appleneers apparently did not think of. Here's how I solved it for an external USB drive:

  • Install Paragon HFS+ (from http://www.paragon-drivers.com/hfs-windows/ - the trial version suffices) on a Windoze and reboot it.
  • Attach the drive and open it in the Explorer.
  • Delete some dispensable files to gain some more space on the drive.
  • You likely need to empty its local Trash.
  • Unplug the drive (I could not find a way to cleanly eject)
  • Attach the drive to your Mac, and it should automatically try again to fix the file system, this time hopefully with success.

You must log in to answer this question.

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