error: btn: invalid btn_btree.bt_key_count

I recognised the symptoms:

  1. Excessive disk trashing.
  2. General slow down.
  3. Backblaze and Time Machine causing the rainbow spinner.

My filesystem needed first aid. I think I can trace this back to the latest macOS update. I swear that half the updates cause filesystem corruption of some sort, but it also feels like I’m running First Aid at least once a month anyway!

Unfortunately for me, the error this time was:

error: btn: invalid btn_btree.bt_key_count

Apparently Diskutil can’t fix that error. The only thing you can do is erase the drive, reinstall MacOS and then restore your data. I was dreading it.

I have a Time Machine backup but I decided to make another backup of my home directory, while logged into another account. Lucky I did as an IO error showed up in Library/Caches/ – thankfully I think in an Apple app I don’t use.

I expected the business of restoring everything to be awful, but in the end the MacOS installer fired up Migration Assistant which let me restore my last Time Machine backup.

With that done it was time to install Brew again. The first package to go back in was coreutils but “brew reinstall” has a bug where it won’t accept parameters. I should have used “install” but “reinstall” with  “–with-default-names” doesn’t work. Also coreutils and related packages are “keg-only” now so no symlinks to /usr/local/bin are made. You have to run “brew link” to link all the commands. It was a simple job then to rename each file, removing the “g” prefix.

I’ll find more things as I go that aren’t configured I’m sure, but thankfully restoring from Time Machine made the job much easier!

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close