MacOS: "Invalid B-tree node size (4, 0)"

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
toke
Posts: 7
Joined: 24 Feb 2014, 17:16

MacOS: "Invalid B-tree node size (4, 0)"

#1 Post by toke »

Is there a way to fix this with TestDisk?

The disk is my last working old Time Machine disk, 8TB & hfs+.

One by one my TM disks has had a mechanical failure or corruption that prevent me from copying old backups to new disks.
Quite sad.

recuperation
Posts: 2737
Joined: 04 Jan 2019, 09:48
Location: Hannover, Deutschland (Germany, Allemagne)

Re: MacOS: "Invalid B-tree node size (4, 0)"

#2 Post by recuperation »

A repair may be possible even without Testdisk:

https://www.cgsecurity.org/testdisk_doc ... from-macos

toke
Posts: 7
Joined: 24 Feb 2014, 17:16

Re: MacOS: "Invalid B-tree node size (4, 0)"

#3 Post by toke »

I guess searching partitions is useless?
"Deep scan" has been going on for 14 hours with amazingly slow speed 27 MB/s.
It should take about 4 days for 8TB drive, but the counter is still at 01%...

Could it be that TestDisk sees every TM backup as an own separate partition?

Code: Select all

Wed Jul 19 20:59:06 2023
Command line: TestDisk

TestDisk 7.1, Data Recovery Utility, July 2019
Christophe GRENIER <grenier@cgsecurity.org>
https://www.cgsecurity.org
OS: Darwin, kernel 22.5.0 (Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64) x86_64
Compiler: GCC 4.2
ext2fs lib: none, ntfs lib: none, reiserfs lib: none, ewf lib: none, curses lib: ncurses 5.7
Hard disk list
Disk /dev/disk0 - 251 GB / 233 GiB - 61279344 sectors (RO), sector size=4096
Disk /dev/disk2 - 2000 GB / 1863 GiB - 3907029168 sectors (RO), sector size=512
Disk /dev/disk6 - 8001 GB / 7452 GiB - 15628053168 sectors, sector size=512
Disk /dev/rdisk0 - 251 GB / 233 GiB - 61279344 sectors (RO), sector size=4096
Disk /dev/rdisk1 - 250 GB / 233 GiB - 61202533 sectors (RO), sector size=4096
Disk /dev/rdisk2 - 2000 GB / 1863 GiB - 3907029168 sectors (RO), sector size=512
Disk /dev/rdisk5 - 2000 GB / 1862 GiB - 488327436 sectors (RO), sector size=4096
Disk /dev/rdisk6 - 8001 GB / 7452 GiB - 15628053168 sectors, sector size=512

Partition table type (auto): EFI GPT
Disk /dev/rdisk6 - 8001 GB / 7452 GiB
Partition table type: EFI GPT
New options :
 Dump : No
 Align partition: Yes
 Expert mode : Yes

Interface Advanced
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=15628053167 (expected 15628053167)
hdr_lba_start=34
hdr_lba_end=15628053134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
 1 P EFI System                    40     409639     409600 [EFI System Partition]
 2 P Mac HFS                   409640 15627790983 15627381344
     HFS+ blocksize=8192 + Backup, 8001 GB / 7451 GiB

HFS_HFSP_boot_sector
 2 P Mac HFS                   409640 15627790983 15627381344
     HFS+ blocksize=8192 + Backup, 8001 GB / 7451 GiB

HFS+ magic value at 409640/0/1

HFS+ magic value at 409640/0/1
Volume header
HFS+ OK

Backup volume header
HFS+ OK

Sectors are not identical.
Superblock                        Backup superblock
0000 482b0004 80006000   H+....`.  482b0004 80002000   H+.... .
0008 6673636b 00003a39   fsck..:9  4846534a 00003a39   HFSJ..:9
0010 d950240c e0a96367   .P$...cg  d950240c e0a96367   .P$...cg
0018 00000000 d94ff9dc   .....O..  00000000 d94ff9dc   .....O..
0020 0295d81f 0065f811   .....e..  0295d81f 0065f811   .....e..
0028 00002000 3a376ea6   .. .:7n.  00002000 3a376ea6   .. .:7n.
0030 028c4420 38539adc   ..D 8S..  028c4420 38539adc   ..D 8S..
0038 00010000 00010000   ........  00010000 00010000   ........
0040 0379da95 0194decd   .y......  0379da95 0194decd   .y......
0048 00000000 00000001   ........  00000000 00000001   ........
0050 00000002 00323096   .....20.  00000002 00323096   .....20.
0058 00000000 00000000   ........  00000000 00000000   ........
0060 00000000 00000000   ........  00000000 00000000   ........
0068 a75af119 dd2e2c0b   .Z....,.  a75af119 dd2e2c0b   .Z....,.
0070 00000000 07470000   .....G..  00000000 07470000   .....G..
0078 07470000 00003a38   .G....:8  07470000 00003a38   .G....:8
0080 00000001 00003a38   ......:8  00000001 00003a38   ......:8
0088 00000000 00000000   ........  00000000 00000000   ........
0090 00000000 00000000   ........  00000000 00000000   ........
0098 00000000 00000000   ........  00000000 00000000   ........
00A0 00000000 00000000   ........  00000000 00000000   ........
00A8 00000000 00000000   ........  00000000 00000000   ........
00B0 00000000 00000000   ........  00000000 00000000   ........
00B8 00000000 00000000   ........  00000000 00000000   ........
00C0 00000000 01400000   .....@..  00000000 01400000   .....@..
00C8 01400000 00000a00   .@......  01400000 00000a00   .@......
00D0 00013a3a 00000a00   ..::....  00013a3a 00000a00   ..::....
00D8 00000000 00000000   ........  00000000 00000000   ........
00E0 00000000 00000000   ........  00000000 00000000   ........
00E8 00000000 00000000   ........  00000000 00000000   ........
00F0 00000000 00000000   ........  00000000 00000000   ........
00F8 00000000 00000000   ........  00000000 00000000   ........
0100 00000000 00000000   ........  00000000 00000000   ........
0108 00000000 00000000   ........  00000000 00000000   ........
0110 00000004 d4c00000   ........  00000004 d4c00000   ........
0118 18400000 0026a600   .@...&..  18400000 0026a600   .@...&..
0120 00099a3a 00048c00   ...:....  00099a3a 00048c00   ...:....
0128 000faa3a 0000c200   ...:....  000faa3a 0000c200   ...:....
0130 0012f0a9 0000c200   ........  0012f0a9 0000c200   ........
0138 0016062e 0000c200   ........  0016062e 0000c200   ........
0140 098b0005 0000c200   ........  098b0005 0000c200   ........
0148 0b44e287 0000c200   .D......  0b44e287 0000c200   .D......
0150 0b50fffe 0000c200   .P......  0b50fffe 0000c200   .P......
0158 0b53442f 0000c200   .SD/....  0b53442f 0000c200   .SD/....
0160 00000006 d2000000   ........  00000006 d2000000   ........
0168 18400000 00369000   .@...6..  18400000 00369000   .@...6..
0170 0001443a 00085600   ..D:..V.  0001443a 00085600   ..D:..V.
0178 000e263a 00018400   ..&:....  000e263a 00018400   ..&:....
0180 00107fcc 0000c200   ........  00107fcc 0000c200   ........
0188 00114219 00018400   ..B.....  00114219 00018400   ..B.....
0190 0013ba7f 0000c200   ........  0013ba7f 0000c200   ........
0198 0014822e 00018400   ........  0014822e 00018400   ........
01A0 00baf5ad 0000c200   ........  00baf5ad 0000c200   ........
01A8 0987e81d 0000c200   ........  0987e81d 0000c200   ........
01B0 00000000 00000000   ........  00000000 00000000   ........
01B8 00000000 00000000   ........  00000000 00000000   ........
01C0 00000000 00000000   ........  00000000 00000000   ........
01C8 00000000 00000000   ........  00000000 00000000   ........
01D0 00000000 00000000   ........  00000000 00000000   ........
01D8 00000000 00000000   ........  00000000 00000000   ........
01E0 00000000 00000000   ........  00000000 00000000   ........
01E8 00000000 00000000   ........  00000000 00000000   ........
01F0 00000000 00000000   ........  00000000 00000000   ........
01F8 00000000 00000000   ........  00000000 00000000   ........
copy backup superblock over main superblock

HFS_HFSP_boot_sector
 2 P Mac HFS                   409640 15627790983 15627381344
     HFS+ blocksize=8192 + Backup, 8001 GB / 7451 GiB

HFS+ magic value at 409640/0/1

HFS+ magic value at 409640/0/1
Volume header
HFS+ OK

Backup volume header
HFS+ OK

Sectors are identical.

Analyse Disk /dev/rdisk6 - 8001 GB / 7452 GiB - 15628053168 sectors
hdr_size=92
hdr_lba_self=1
hdr_lba_alt=15628053167 (expected 15628053167)
hdr_lba_start=34
hdr_lba_end=15628053134
hdr_lba_table=2
hdr_entries=128
hdr_entsz=128
Current partition structure:
 1 P EFI System                    40     409639     409600 [EFI System Partition]
 2 P Mac HFS                   409640 15627790983 15627381344

search_part()
Disk /dev/rdisk6 - 8001 GB / 7452 GiB - 15628053168 sectors
FAT32 at 40/0/1
check_FAT: Unusual media descriptor (0xf0!=0xf8)
FAT1 : 32-3182
FAT2 : 3183-6333
start_rootdir : 6334 root cluster : 2
Data : 6334-409599
sectors : 409600
cluster_size : 1
no_of_cluster : 403266 (2 - 403267)
fat_length 3151 calculated 3151
heads/cylinder 16 (FAT) != 1 (HD)
sect/track 32 (FAT) != 1 (HD)

FAT32 at 40/0/1
     EFI System                    40     409639     409600 [EFI System Partition] [EFI]
     FAT32, blocksize=512, 209 MB / 200 MiB

HFS+ magic value at 409640/0/1

HFS+ magic value at 409640/0/1
part_size 15627381344
     Mac HFS                   409640 15627790983 15627381344
     HFS+ blocksize=8192 + Backup, 8001 GB / 7451 GiB

Results
   P EFI System                    40     409639     409600 [EFI System Partition] [EFI]
     FAT32, blocksize=512, 209 MB / 200 MiB
   P Mac HFS                   409640 15627790983 15627381344
     HFS+ blocksize=8192 + Backup, 8001 GB / 7451 GiB

interface_write()
 1 P EFI System                    40     409639     409600 [EFI System Partition] [EFI]
 2 P Mac HFS                   409640 15627790983 15627381344

search_part()
Disk /dev/rdisk6 - 8001 GB / 7452 GiB - 15628053168 sectors
FAT32 at 40/0/1
check_FAT: Unusual media descriptor (0xf0!=0xf8)
FAT1 : 32-3182
FAT2 : 3183-6333
start_rootdir : 6334 root cluster : 2
Data : 6334-409599
sectors : 409600
cluster_size : 1
no_of_cluster : 403266 (2 - 403267)
fat_length 3151 calculated 3151
heads/cylinder 16 (FAT) != 1 (HD)
sect/track 32 (FAT) != 1 (HD)

FAT32 at 40/0/1
     EFI System                    40     409639     409600 [EFI System Partition] [EFI]
     FAT32, blocksize=512, 209 MB / 200 MiB
FAT32 at 46/0/1
check_FAT: Unusual media descriptor (0xf0!=0xf8)
FAT1 : 32-3182
FAT2 : 3183-6333
start_rootdir : 6334 root cluster : 2
Data : 6334-409599
sectors : 409600
cluster_size : 1
no_of_cluster : 403266 (2 - 403267)
fat_length 3151 calculated 3151
heads/cylinder 16 (FAT) != 1 (HD)
sect/track 32 (FAT) != 1 (HD)
set_FAT_info: name from BS used

FAT32 at 46/0/1
     EFI System                    46     409645     409600 [EFI System Partition] [EFI]
     FAT32, blocksize=512, 209 MB / 200 MiB

HFS+ magic value at 409640/0/1

HFS+ magic value at 409640/0/1
part_size 15627381344
     Mac HFS                   409640 15627790983 15627381344
     HFS+ blocksize=8192 + Backup, 8001 GB / 7451 GiB

HFS+ magic value at 409642/0/1

HFS+ magic value at 578952/0/1
part_size 15627381344
     Mac HFS                   578952 15627960295 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB

HFS+ magic value at 578954/0/1

HFS+ magic value at 648136/0/1
part_size 15627381344
     Mac HFS                   648136 15628029479 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB

HFS+ magic value at 648138/0/1

HFS+ magic value at 651856/0/1
part_size 15627381344
     Mac HFS                   651856 15628033199 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB

HFS+ magic value at 651858/0/1

HFS+ magic value at 657216/0/1
part_size 15627381344
     Mac HFS                   657216 15628038559 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB

HFS+ magic value at 657218/0/1

HFS+ magic value at 663280/0/1
part_size 15627381344
     Mac HFS                   663280 15628044623 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB

HFS+ magic value at 663282/0/1

HFS+ magic value at 667984/0/1
part_size 15627381344
     Mac HFS                   667984 15628049327 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB

HFS+ magic value at 667986/0/1

HFS+ magic value at 673328/0/1
part_size 15627381344
     Mac HFS                   673328 15628054671 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=673328, size=15627381344, end=15628054671, disk end=15628053168)

HFS+ magic value at 673330/0/1

HFS+ magic value at 678768/0/1
part_size 15627381344
     Mac HFS                   678768 15628060111 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=678768, size=15627381344, end=15628060111, disk end=15628053168)

HFS+ magic value at 678770/0/1

HFS+ magic value at 683056/0/1
part_size 15627381344
     Mac HFS                   683056 15628064399 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=683056, size=15627381344, end=15628064399, disk end=15628053168)

HFS+ magic value at 683058/0/1

HFS+ magic value at 688432/0/1
part_size 15627381344
     Mac HFS                   688432 15628069775 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=688432, size=15627381344, end=15628069775, disk end=15628053168)

HFS+ magic value at 688434/0/1

HFS+ magic value at 693808/0/1
part_size 15627381344
     Mac HFS                   693808 15628075151 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=693808, size=15627381344, end=15628075151, disk end=15628053168)

HFS+ magic value at 693810/0/1

HFS+ magic value at 699232/0/1
part_size 15627381344
     Mac HFS                   699232 15628080575 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=699232, size=15627381344, end=15628080575, disk end=15628053168)

HFS+ magic value at 699234/0/1

HFS+ magic value at 700432/0/1
part_size 15627381344
     Mac HFS                   700432 15628081775 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=700432, size=15627381344, end=15628081775, disk end=15628053168)

HFS+ magic value at 700434/0/1

HFS+ magic value at 705744/0/1
part_size 15627381344
     Mac HFS                   705744 15628087087 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=705744, size=15627381344, end=15628087087, disk end=15628053168)

HFS+ magic value at 705746/0/1

HFS+ magic value at 711072/0/1
part_size 15627381344
     Mac HFS                   711072 15628092415 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=711072, size=15627381344, end=15628092415, disk end=15628053168)

HFS+ magic value at 711074/0/1

HFS+ magic value at 715328/0/1
part_size 15627381344
     Mac HFS                   715328 15628096671 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=715328, size=15627381344, end=15628096671, disk end=15628053168)

HFS+ magic value at 715330/0/1

HFS+ magic value at 720720/0/1
part_size 15627381344
     Mac HFS                   720720 15628102063 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=720720, size=15627381344, end=15628102063, disk end=15628053168)

HFS+ magic value at 720722/0/1

HFS+ magic value at 726144/0/1
part_size 15627381344
     Mac HFS                   726144 15628107487 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=726144, size=15627381344, end=15628107487, disk end=15628053168)

HFS+ magic value at 726146/0/1

HFS+ magic value at 731504/0/1
part_size 15627381344
     Mac HFS                   731504 15628112847 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=731504, size=15627381344, end=15628112847, disk end=15628053168)

HFS+ magic value at 731506/0/1

HFS+ magic value at 736928/0/1
part_size 15627381344
     Mac HFS                   736928 15628118271 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=736928, size=15627381344, end=15628118271, disk end=15628053168)

HFS+ magic value at 736930/0/1

HFS+ magic value at 742320/0/1
part_size 15627381344
     Mac HFS                   742320 15628123663 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=742320, size=15627381344, end=15628123663, disk end=15628053168)

HFS+ magic value at 742322/0/1

HFS+ magic value at 747712/0/1
part_size 15627381344
     Mac HFS                   747712 15628129055 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=747712, size=15627381344, end=15628129055, disk end=15628053168)

HFS+ magic value at 747714/0/1

HFS+ magic value at 752944/0/1
part_size 15627381344
     Mac HFS                   752944 15628134287 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=752944, size=15627381344, end=15628134287, disk end=15628053168)

HFS+ magic value at 752946/0/1

HFS+ magic value at 758336/0/1
part_size 15627381344
     Mac HFS                   758336 15628139679 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=758336, size=15627381344, end=15628139679, disk end=15628053168)

HFS+ magic value at 758338/0/1

HFS+ magic value at 763736/0/1
part_size 15627381344
     Mac HFS                   763736 15628145079 15627381344
     HFS+ blocksize=8192, 8001 GB / 7451 GiB
This partition ends after the disk limits. (start=763736, size=15627381344, end=15628145079, disk end=15628053168)

toke
Posts: 7
Joined: 24 Feb 2014, 17:16

Re: MacOS: "Invalid B-tree node size (4, 0)"

#4 Post by toke »

recuperation wrote: 20 Jul 2023, 06:59 A repair may be possible even without Testdisk:

https://www.cgsecurity.org/testdisk_doc ... from-macos
I wonder why

Code: Select all

sudo fsck /dev/disk1s1
doesn't work in Ventura.
Haven't found anything about that being changed.

I did find the only repair command mentioned with this NVALID B-TREE NODE SIZE corruption

Code: Select all

sudo fsck_hfs -r -d /dev/disk1s1
in the first hour of googleing. Does not help.
Image
https://drive.google.com/file/d/16_CojM ... sp=sharing
(Was there something tampered in the history that you can't share pics from Gdrive?
All the forums I used past years have hosted pictures by themselves...)
Image
https://ibb.co/wMBR6Mg
Maybe I'm not allowed to embed links?
Last edited by toke on 20 Jul 2023, 16:06, edited 2 times in total.

toke
Posts: 7
Joined: 24 Feb 2014, 17:16

Re: MacOS: "Invalid B-tree node size (4, 0)"

#5 Post by toke »

Code: Select all

TokesMini2018:~ ext-toke$ sudo fsck_hfs -r -d /dev/disk6s2
Password:
journal_replay(/dev/disk6s2) returned 0
** /dev/rdisk6s2
	Using cacheBlockSize=32K cacheTotalBlock=81920 cacheSize=2621440K.
   Executing fsck_hfs (version hfs-627.100.6).
   Invalid content in journal
** 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 15627381342 0x3a376ea5e 
	sector size = 512 0x200 
	VolumeObject flags = 0x07 
	total sectors for volume = 15627381344 0x3a376ea60 
	total sectors for embedded volume = 0 0x00 
   Invalid content in journal
(4, 0)
	CheckHFS returned -1317, fsmodified = 1

toke
Posts: 7
Joined: 24 Feb 2014, 17:16

Re: MacOS: "Invalid B-tree node size (4, 0)"

#6 Post by toke »

Seems to be that TestDisk does not help in this corruption problem.

Time to spend money on DiskWarrior.
(Not to support the development of TestDisk...)

Locked