HFS+ Invalid leaf record and rebuild B-tree not possible

Using TestDisk to repair the filesystem
Forum rules
When asking for technical support:
- Search for posts on the same topic before posting a new question.
- Give clear, specific information in the title of your post.
- Include as many details as you can, MOST POSTS WILL GET ONLY ONE OR TWO ANSWERS.
- Post a follow up with a "Thank you" or "This worked!"
- When you learn something, use that knowledge to HELP ANOTHER USER LATER.
Before posting, please read https://www.cgsecurity.org/testdisk.pdf
Locked
Message
Author
panilssen
Posts: 1
Joined: 27 Jan 2020, 13:47

HFS+ Invalid leaf record and rebuild B-tree not possible

#1 Post by panilssen »

I have serious problems with my External 8TB disk.
I did a full Timemachine backup to the disk, and it's encrypted.
Installed fresh (wiped everything) OSX Mojave on internal disk. My external Timemachine disk will no longer mount.
Here are "diskutil info disk5"

Code: Select all

Device Identifier:         disk5
   Device Node:               /dev/disk5
   Whole:                     Yes
   Part of Whole:             disk5
   Device / Media Name:       Backup+ Hub BK

   Volume Name:               Seagate
   Mounted:                   No

   Content (IOContent):       Apple_HFS
   File System Personality:   Journaled HFS+
   Type (Bundle):             hfs
   Name (User Visible):       Mac OS Extended (Journaled)
   Journal:                   Unknown (not mounted)
   Owners:                    Disabled

   OS Can Be Installed:       No
   Booter Disk:               disk4s3
   Media Type:                Generic
   Protocol:                  USB
   SMART Status:              Not Supported
   Volume UUID:               85473300-0C26-31E0-92BA-FBAF2348AF8A
   Disk / Partition UUID:     784988D6-B233-4BFC-AB1C-45EA7FF24640

   Disk Size:                 8.0 TB (8000852983808 Bytes) (exactly 15626665984 512-Byte-Units)
   Device Block Size:         512 Bytes

   Volume Total Space:        0 B (0 Bytes) (exactly 0 512-Byte-Units)
   Volume Free Space:         0 B (0 Bytes) (exactly 0 512-Byte-Units)

   Read-Only Media:           No
   Read-Only Volume:          Not applicable (not mounted)

   Device Location:           External
   Removable Media:           Fixed

   Solid State:               Info not available
   Virtual:                   Yes

   This disk is a Core Storage Logical Volume (LV).  Core Storage Information:
   LV UUID:                   784988D6-B233-4BFC-AB1C-45EA7FF24640
   LVF UUID:                  88FE1CF9-588B-4660-AA7A-2BFBEC9646E5
   LVG UUID:                  0F743A5A-2253-477A-B824-3B407493957C
   PV UUID (disk):            26E0DC58-BAC9-4BFC-9031-521E769068B5 (disk4s2)
   Fusion Drive:              No
   Encrypted:                 No
When I try "sudo fsck_hfs -d /dev/disk5" i got this output

Code: Select all

journal_replay(/dev/disk5) returned 0
** /dev/rdisk5
	Using cacheBlockSize=32K cacheTotalBlock=65536 cacheSize=2097152K.
   Executing fsck_hfs (version hfs-522.0.9).
** Checking Journaled HFS Plus volume.
   The volume name is Seagate
** Checking extents overflow file.
   Invalid leaf record count
   (It should be 190 instead of 192)
** Checking catalog file.
   Invalid sibling link
(4, 318227)
Node 318227's back link is 0x76bc9; expected 0x8939c
    disk offset = 0x1cea98000, size = 0x2000
Index key doesn't match first node key
   Invalid index key
(4, 318227)
   Missing thread record (id = 19)
Index key doesn't match first node key
   Invalid index key
(4, 252464)
   Incorrect block count for file .store.db
   (It should be 17717 instead of 17345)
   Incorrect block count for file 0.indexCompactDirectory
   (It should be 4099 instead of 6420)
   Incorrect block count for file live.1.indexArrays
   (It should be 12288 instead of 20142)
   Incorrect block count for file live.1.indexCompactDirectory
   (It should be 131 instead of 4402)
   Incorrect block count for file live.1.indexDirectory
   (It should be 265 instead of 712)
Index key doesn't match first node key
   Invalid index key
(4, 319555)
   Incorrect block count for file store.db
   (It should be 1075 instead of 1527)
** Rebuilding catalog B-tree.
hfs_UNswap_BTNode: invalid node height (1)
** The volume Seagate 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 15626665982 0x3a36bfffe 
	sector size = 512 0x200 
	VolumeObject flags = 0x07 
	total sectors for volume = 15626665984 0x3a36c0000 
	total sectors for embedded volume = 0 0x00 
	CheckHFS returned 8, fsmodified = 1
Have installed Testdisk (Macports), but don't know how to fix the disk. Can anyoe help?

Locked