Apple Event: May 7th at 7 am PT

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

fsroot tree is invalid after Mojave install

Good morning


After installing macOS Mojave I ran the disk utility to make sure everything was loaded properly, and ran across this conclusion by the disk utility-


Running First Aid on “Macintosh HD” (disk1s1)



NOTE: First Aid will temporarily lock the startup volume.



Verifying file system.

Volume could not be unmounted.

Using live mode.

Performing fsck_apfs -n -l -x /dev/rdisk1s1

Checking the container superblock.

Checking the EFI jumpstart record.

Checking the space manager.

Checking the space manager free queue trees.

Checking the object map.

Checking volume.

Checking the APFS volume superblock.

The volume Macintosh HD was formatted by hfs_convert (748.1.46) and last modified by apfs_kext (945.200.129).

Checking the object map.

Checking the snapshot metadata tree.

Checking the snapshot metadata.

Checking the extent ref tree.

Checking the fsroot tree.

error: btn: invalid btn_btree.bt_key_count (expected 2000421, actual 2000470)

fsroot tree is invalid.

The volume /dev/rdisk1s1 could not be verified completely.

File system check exit code is 0.

Restoring the original state found as mounted.



Operation successful.


Not sure what to do to correct this as I've never run across this problem after installing a new OS. A simple, insightful solution would be much appreciated.

Thank you.

-thurfore

MacBook Air (13-inch, Early 2015), macOS Mojave (10.14), null

Posted on Oct 2, 2018 2:42 AM

Reply
Question marked as Best reply

Posted on Jan 13, 2019 3:33 AM

Hey, I had the same issue on my Late 2012 MBP and this worked:


  1. Start up Mac in single-user mode by restarting then press and hold Command + S.
  2. Type /sbin/fsck -fy into the command line and press Enter. This will initiate a file system check. You will see the same error, however in this case the repair will continue and fix the issue.
  3. Type reboot and press Enter.
  4. Login as normal and run First Aid on Disk and the error should be gone.


Hope this helps.


31 replies
Question marked as Best reply

Jan 13, 2019 3:33 AM in response to thurfore

Hey, I had the same issue on my Late 2012 MBP and this worked:


  1. Start up Mac in single-user mode by restarting then press and hold Command + S.
  2. Type /sbin/fsck -fy into the command line and press Enter. This will initiate a file system check. You will see the same error, however in this case the repair will continue and fix the issue.
  3. Type reboot and press Enter.
  4. Login as normal and run First Aid on Disk and the error should be gone.


Hope this helps.


Dec 29, 2018 8:01 AM in response to thurfore

I had this problem too after I upgraded to Mojave. I noticed Time Machine was no longer backing up and displaying the error "An error occurred while copying files. The problem may be temporary. If the problem persists, use Disk Utility to repair the backup disk". Running First Aid on the external USB back up drive indicated no errors. Running First Aid on the MacBook Pro SSD I was getting the same error: btn: invalid btn_btree... error.


I tried running Disk Utility First Aid in recovery mode and using the fsck_apfs command with various parameters (also in recovering mode) but it would keep displaying the same error and not fix it. I called Apple support a number of times and they weren't able to offer a solution to fix the problem (tried reinstalling Mac OS and other things).


But, I did fix it, by doing the following.


What I used:

- 8GB USB thumb drive

- external USB HDD of greater than or equal capacity of the MacBook Pro SSD

- a lot of patience


Process:

- Created a bootable USB of Mac OS Mojave install image (HOWTO here) with a USB thumb drive

- Booted Mac from USB thumb drive with Mojave install and with external USB HDD connected

- Installed Mac OS Mojave to the external USB HDD

- At the last stage of the Mac OS install, used the migration wizard to migrate all my data to the Mac OS install on the external drive

- Booted from external USB HDD to make sure it was working and had my data

- Shutdown, disconnected external drive, and booted from USB thumb drive again

- Erased the Macintosh HD (SSD in MacBook) with disk utility and reformatted with journaled file system

- Installed Mac OS to MacBook Pro (internal SSD)

- Then ran data migration wizard again on this install to migrate data from external USB HDD back to the MacBook Pro internal SDD

- Run First Aid on the internal SSD again, and there where no errors

- Time Machine backup works again!


I do find it hard to believe that First Aid was unable to fix the btree error in the first place however, and I had to go through this whole process to get Mac OS working properly again.

Oct 16, 2018 8:29 AM in response to thurfore

Same issue here on Mojave 10.14 with a MacBook Air (13-inch, Early 2014) and an encrypted hard drive. Ran Disk Utility and received the following message:


Checking the fsroot tree.

error: btn: invalid btn_btree.bt_key_count (expected 4123650, actual 4123708)

fsroot tree is invalid.


I booted into Recovery Mode (Command+R on start-up) and it would only allow me to run First Aid on the boot disc, and not the main hard drive. There are no other options, so this suggested resolution does not work!


Aside from formatting my drive and reinstalling everything, is there any other solution? Terminal?


Thanks!

Oct 27, 2018 6:07 PM in response to RandyKepple

Go back into recovery mode. Click on the "ghosted" MacHD and click the "Mount" icon. Your MacBook Air will ask you for your password to unlock your HD. Once you've done that, you HD Icon will appear as normal and you can then run Repair Disk. This will run the deferred repair necessary to fix the invalid btn_btree count. Once you've finished running this repair in recovery mode, reboot your MacBook Air and run Disk Utility again. You'll see the deferred repair command again and the invalid btn_btree count will be gone.

Nov 2, 2018 12:56 AM in response to MMDS

Hey, same issue here, but recovery mode didn't help, I did the following:


1) Boot to recovery mode (CMD +R when it chimes at boot),

2) I select the disk utility from the 4 options shown..

3) mount the drive (it's encrypted)

4) try to repair.


It shows the same as when normally booted, it doesn't get repaired, I tried running on the terminal

with fsck_hfs -fy /dev/disk1s2


and the same ...


I'm finding no normal issues during OSX usage, *but*, I found this when trying to resize my volume, to leave some space for a separate partition on the disk, I can't do it because of the hfs issues.

Nov 9, 2018 3:47 AM in response to MMDS

I've just updated to Mojave 10.14.1 and am now having the same issues as mangelajo et al.


I have been through the exact process you set out for them, but unfortunately that hasn't worked either.


I still get the 'snapshot is invalid' and btree count errors after repairing the mounted HD in recovery mode's disk utility.


It doesn't get past snapshot 1 of 3.


What else have you got?

Nov 22, 2018 3:18 AM in response to AJM_52

Same issue, Booting into Recovery and running First Aid doesn't help


Also, for me, the Mojave install was stuck, I had to manually Shut Down and continue once, I believe this caused the issue in the first place, or it might be a side effect, I don't know


All I know is error: btn: invalid btn_btree.bt_key_count (expected 9472147, actual 9472196) - and nothing repairs it

Dec 15, 2018 11:47 AM in response to MMDS

Booting into Recovery mode and running First Aid from there doesn't fix the "fsroot tree is invalid" issue. Neither does doing a Safe Boot and running First Aid. This has happened to me in the past after upgrading to High Sierra from Sierra. It was eventually fixed through an update Apple released about 6 months after High Sierra was released. I'm hoping Apple will release a similar fix eventually but hoping it'll be sooner this time around and won't take 6 months.

Feb 24, 2019 6:57 AM in response to Mac_2456

Same problem with my 2012 macbook pro after mojave install.

Could not get this to work either.

Spoke with apple support and went into apple store. No help either way. Just verified that my 512 ssd is good.

Told me to erase and reinstall but time machine backups might be corrupted too!!!

Horrible to release updates that make things worse!!

Feb 25, 2019 9:49 AM in response to MMDS

After trying several other suggestions this is the one that worked on my Macbook Pro 2017 with Mojave. Thank you!!! Go back into recovery mode. Click on the "ghosted" MacHD and click the "Mount" icon. Your MacBook Air will ask you for your password to unlock your HD. Once you've done that, you HD Icon will appear as normal and you can then run Repair Disk. This will run the deferred repair necessary to fix the invalid btn_btree count. Once you've finished running this repair in recovery mode, reboot your MacBook Air and run Disk Utility again. You'll see the deferred repair command again and the invalid btn_btree count will be gone.

fsroot tree is invalid after Mojave install

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