Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Cannot mount or repair external hfs drive - "Invalid B-tree node size"

I have a 3TB Western Digital MyBook which is usually hooked up to my Airport Extreme (A1354, ultimo 2009), which works just fine - I can read and write from and to the drive wirelessly through the Airport Extreme. However, my ISP decided to abruptly cut off my internet, and since I wanted to be hooked up to my hard drive as well as the internet, I set up my phone to act as a WiFi hotspot and connected to it, and also disconnected my MyBook from the Airport Extreme and connected it directly via USB to my MacBook Pro (runnning Yosemite 10.10.5).


The MyBook was not recognized and mounted by OSX, which I thought was weird. My boyfriend tried plugging it into his laptop, but since he has recently installed Ubuntu and has not yet set up support for HFS (we suppose), his OS did not recognize the drive format, so he could not mount and read the drive, either. We tried plugging the drive back into the Airport Extreme and connecting the Mac to it, but the drive did not show up in my Finder sidebar like it usually does after a little while. By now I was starting to get worried.


I plugged the MyBook back into my MacBook Pro and opened up the Disk Utility app. The drive and its single partition were visible in the sidebar. For the partition, "Verify Disk Permissions" and "Repair Disk Permissions" are currently greyed out, and I think that they were at that time, too. I attempted "Verify disk". The output textbox showed some "Verifying journaled HFS Plus unit" text, and more stuff in that vein. Then, further down, in red text (translated from Danish);


Invalid size of B-tree node.

The unit could not be fully verified.

Exit code for control of storage system is 8.

Error: The disk must be repaired. Click Repair disk.


And, when the text had stopped outputting, a popup appeared:

Disk utility stopped repair of "disk4s2"

Disk utility cannot repair this disk.

Make backups of as many of your files as possible, reformat the disk, and retrieve the backed up files.

(and an "OK" button)


Now I was very worried.

My boyfriend attempted to help, and we dug up all kinds of suggestions on various forums where people had had similar, but not quite the same problems.

We've tried the fsck tool in the Terminal with various options, none of which were successful. Here's a list of fsck stuff we've tried and the accompanying output:

-------------------------------------------------------------------------------- -----------

Computer-2:~ janedoe$ sudo fsck_hfs -drfy /dev/disk4s2

Password:

journal_replay(/dev/disk4s2) returned 0

** /dev/rdisk4s2

Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.

Executing fsck_hfs (version hfs-285).

** Checking Journaled HFS Plus volume.

Invalid B-tree node size

(4, 0)

** The volume could not be verified completely.

volume check failed with error 7

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 5859590054 0x15d423fa6

sector size = 512 0x200

VolumeObject flags = 0x07

total sectors for volume = 5859590056 0x15d423fa8

total sectors for embedded volume = 0 0x00

CheckHFS returned -1317, fsmodified = 0


Computer-2:~ janedoe$ sudo fsck_hfs -Rc -d /dev/disk4s2

journal_replay(/dev/disk4s2) returned 0

** /dev/rdisk4s2

Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.

Executing fsck_hfs (version hfs-285).

** Checking Journaled HFS Plus volume.

Invalid B-tree node size

(4, 0)

** The volume could not be verified completely.

volume check failed with error 7

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 5859590054 0x15d423fa6

sector size = 512 0x200

VolumeObject flags = 0x07

total sectors for volume = 5859590056 0x15d423fa8

total sectors for embedded volume = 0 0x00

CheckHFS returned -1317, fsmodified = 0


Computer-2:~ janedoe$ sudo fsck_hfs -l -r /dev/disk4s2

** /dev/rdisk4s2 (NO WRITE)

BTree rebuild requested but writing disabled

-------------------------------------------------------------------------------- -----------


We tried force mounting with the mount and diskutil mountDisk commands, none succeeded. Here's a list of the attempts we made and the accompanying output:

-------------------------------------------------------------------------------- -----------

Computer-2:~ janedoe$ diskutil list

~(irrelevant drives removed from output for brevity)~

/dev/disk4

#: TYPE NAME SIZE IDENTIFIER

0: GUID_partition_scheme *3.0 TB disk4

1: EFI EFI 314.6 MB disk4s1

2: Apple_HFS 3.0 TB disk4s2


Computer-2:~ janedoe$ sudo mkdir /Volumes/broken


Computer-2:~ janedoe$ sudo mount -t hfs /dev/disk4s2 /Volumes/broken/

mount_hfs: Invalid argument


Computer-2:~ janedoe$ sudo mount -t hfs /dev/disk4 /Volumes/broken/

mount_hfs: Invalid argument


Computer-2:~ janedoe$ sudo mount -t msdos /dev/disk4s1 /Volumes/broken

Computer-2:~ janedoe$

~(This worked, but to what use? The EFI partition does not contain my data)~


Computer-2:~ janedoe$ diskutil mount /dev/disk4s2

Volume on disk4s2 failed to mount

If the volume is damaged, try the "readOnly" option


Computer-2:~ janedoe$ diskutil mount readOnly /dev/disk4s2

Volume on disk4s2 failed to mount

If the volume is damaged, try the "readOnly" option


Computer-2:~ janedoe$ sudo diskutil mountDisk /dev/disk4

One or more volume(s) failed to mount


Computer-2:~ janedoe$ mount -t hfs force /dev/disk4

GetMasterBlock: Error 2 opening force

GetMasterBlock: Error 2 opening force

mount_hfs: Operation not permitted

-------------------------------------------------------------------------------- -----------


We've also tried using DiskWarrior 5.0. DiskWarrior can attempt to mount the drive, but it will fail. Using "Rebuild" leads to a report that DiskWarrior has found errors and has repairs ready, but cannot replace the original directory due to an OS X services failure:

-------------------------------------------------------------------------------- -----------

DiskWarrior has successfully built a new directory for the disk named "Untitled." The new directory cannot replace the original directory due to an OS X services failure.


Overview


Try rebuilding again. If this problem persists, please restart from a Recovery disk and then try rebuilding again.


The original directory is severely damaged and it was necessary to scavenge the directory to find file and folder data.


Some file and folder data may be missing, and some files that had been lost or thrown away may have been recovered.


The disk was not mounted prior to rebuilding. Only the preview disk will appear if you preview the replacement directory.


• All errors in the directory structure such as tree depth, header node, map nodes, node size, node counts, node links, indexes and more have been repaired.


• 1 missing Folder had to be recreated.


• Incorrect values in the Volume Information were repaired.


• Critical values in the Volume Information were incorrect and were repaired.


Disk Information:


Files: 0

Folders: 0

Free Space: 3.00 TB

Format: Mac OS Extended (Journaled)

Block Size: 8.192

Disk Sectors: 732.448.757

Media: WD My Book 1140


Time: 01/05/16 18.29

DiskWarrior Version: 5.0


Details


Disk: "Untitled"

Recreated this Missing Folder

Repaired the Total File Count of the Volume Information

Repaired the Total Folder Count of the Volume Information

Repaired the Available Disk Space of the Volume Information

Repaired the Text Encodings Bitmap of the Volume Information

Repaired the Encodings Bitmap of the critical Volume Information

Location: "Local Device"

-------------------------------------------------------------------------------- -----------


One time (we tried several times), DiskWarrior presented a different report, saying it could replace the original directory. However, upon clicking "replace", we were presented with a popup saying that the new directory had no files and as such, there would be no files or folders in the disk once the directory had been replaced, so of course we canceled.


We tried physically removing the disk itself from its cabinet and disk controller and attaching it to a different controller that my boyfriend had lying around. In this case, when attaching the (also different) USB cable to my MacBook Pro, a popup appeared saying that "The disk you inserted was not readable by this computer" with three buttons: "Initialize", "Ignore" and "Eject". Our research on the internet showed that "Initialize" would format the drive, so we tried "Ignore" and messed around a bit trying some of the stuff above before abandoning the setup, ejecting the drive and putting it back into its original cabinet. We tested the other controller by attaching a different external drive to it and attaching it to my MacBook Pro - and it could read that drive just fine.


Of course, we have restarted the computer, drive and Airport Extreme many times, also.


We are at our wit's end, and I am so worried that I won't get my data back. I hope someone here has the answer that will save me!

MacBook Pro, OS X Yosemite (10.10.1)

Posted on May 1, 2016 10:06 AM

Reply
3 replies

May 8, 2016 4:06 AM in response to Kattejammer

Just wanted to inform others having the same problem of my solution. First off, I tried Stellar Volume Optimizer which supposedly can fix B-tree errors, but with a 3TB disk this was an unrealistic task that might have taken 3 weeks! So I bought another 3TB disk and used Data Rescue 4 to scan, recover and transfer my files. This proces took 2.5 days, and unfortunately it did not recover all of my files - a rough guess is about 50 percent. Sad, but better than nothing.

May 8, 2016 7:28 AM in response to Kattejammer

Best tool for this job IME is DiskWarrior. If you don't want to buy your own copy, and it's not really priced for one-off use on a speculative basis, your local AppleStore Genius may be able to help out.

If you have your own copy and it doesn't automatically repair the disk contact DW support who can normally help with the trickier cases.

C.

Cannot mount or repair external hfs drive - "Invalid B-tree node size"

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