fsck and Disk Utility won't repair Volume: invalid b-tree node size
I accidentally wrote some .iso
data to a disk through dd
by mistake. I cancelled the command after just 2 seconds but that was enough to wipe the first EFI partition (200MB) and a bit of the second partition where OS X and some files I do really like are stored.
The ISO image I accidentally wrote with dd
was 600mb in size so the total damage would be a maximum of 400 MB since I dd
from sector 0 until I hit Ctrl + C and EFI partition was gone.
I tried running fsck -fy
on that partition but it's a no-go.
sudo fsck_hfs -fy /dev/disk2s2
** /dev/rdisk2s2
Using cacheBlockSize=32K cacheTotalBlock=32768 cacheSize=1048576K.
Executing fsck_hfs (version diskdev_cmds-557~393).
** Checking Journaled HFS Plus volume.
Invalid B-tree node size
I don't know much about HFS+ but on any EXT Linux partition I could pretty much recover everything that wasn't wiped by dd
, even if overwritten. Here however I don't know where to start. There are some fancy GUI tools but they probably won't do anything else then fsck
does.
It can't be that the whole partition is gone because 400 MB (if the whole ISO would be written - but that wasn't the case) out of 400 GB was overwritten with data by accident. Partition table seems to be alright - gdisk
on Linux says it's OK and Disk Utility on Mac as well.
Volume was journaled (seems to be a problem for HFS+ utilities on Linux)
Any tips how to rescue my files?
Solution 1:
Download Testdisk. You would have to run it from an external disk. It’s a command line tool. It will diagnose problems with your partition table or filesystem and repair them. It’s very verbose so you won’t need any readmes. First recover your OS X partition and then your EFI partition. Comment back if you need any help using Testdisk.
Solution 2:
You should to try to rebuild the catalog file on the specified file system by specifying -r
option, for example:
$ fsck.hfsplus -fryd /dev/sdd2
See also: How to fix invalid map node linkage?