GA-Z97X-Gaming 5: Random reboots and FileVault issues 🤮

Posted on Dec 18, 2019

TLDR: Weird things happen before booting into kernel: Update your BIOS

Since 2015 I am using the GA-Z97X-Gaming 5 for my main desktop machine and eversince the beginning it behaved a bit weird.

  • It sometimes needed 2 to 4 tries to POST. (“THE BOOT LOOP”)
  • Kernel panics happened out of nowhere (but quite rarely). Most crash reports would mention something about APFS but I was never able to get more out of them.
  • In about 20% of boot processes, Clover reseted after selecting ‘FileVault Preloader’ (“THE CLOVER RESET”)
  • In about 40% of boot processes, the FileVault Preloader was not able to boot into the kernel (“FILEVAULT PRELOADER”)

After four years I somehow got used to boot my machine two or even four times. Since standby worked pretty good I almost never turned it off. I always thought it was an issue with the bootloader (Clover) but when I recently updated to revision 5098 the problem still wasn’t gone. That’s why I asked for help on insanelymac.com. Shortly after, I found the solution by myself 🙆‍♂️.

Troubleshooting

Starting from day one I thought it may be a bug in Clover. I didn’t want to spend the time to get into Clover’s source and debug it by myself. Therefore I waited it out and updated to newer revisions every now and then. The problem was never resolved.

Some days ago I started looking into “THE CLOVER RESET” …

  • I copied by bootloader usb thumb drive over to another usb thumb drive and used that to boot OSX.
  • I cloned my OSX installation to another drive and disconnected the original drive.
  • I tried several Clover revisions: 5100, 5099, 5098, 5097, 5096, 5045
  • I enabled the debug settings in clover’s config. Using clover’s debug.log I was able to get details about what happend when the FileVault Preloader wasn’t able to boot into the kernel. It always stopped just before APFS driver loaded. That’s why I investigated further into ApfsDriverLoader.efi.
  • I tried to get rid of ApfsDriverLoader.efi and used a old version of apfs.efi.
  • I looked into ApfsDriverLoader’s source code. It was easy to find where the 'APFS driver loaded' message is logged but I didn’t want to get outright into debugging clover. (How do I even do that without a serial port?)
  • I googled for hours: “ApfsDriverLoader crash”, “Crash after FileVault Prebooter”, “GA-Z97X FileVault”
  • Somehow I landed in the FileVaul 2 thread on InsanelyMac and noticed that nobody had similar issues. That’s why I asked for help.

After another desperate day of googling I started looking into “THE BOOT LOOP”.

  • Google: “GA-Z97X-Gaming 5 takes several tries to post”, “GA-Z97X-Gaming 5 POST problem”, “GA-Z97X-Gaming 5 boot loop”, “GA-Z97X-Gaming 5 issues”
  • In some overclocker forum somebody wrote about how bad all the GA-Z97 BIOS’es are because of memory corruption, overclocking settings not being applied and some more. Another person mentioned that his MB (GA-Z97X-Gaming 5) works pretty good with BIOS F8a. F8a?! Gigabyte’s support website doesn’t even list the F8a BIOS!!
  • Memory corruption sounds like something that could trigger problems like that. It was my only clue …
  • After some more googling I found the F8a BIOS for my motherboard, downloaded it onto a FAT32 formatted thumb drive, flashed it using Q-Flash, loaded optimized default settings in BIOS and finally re-applied all needed BIOS settings for overclocking and OSX.

I couldn’t trust my eyes. It booted into Clover in a matter of seconds. FileVault Preloader loaded fast too, as well as OSX. I believed I just had some luck with that try and tried five additional times. No more boot loops, no more clover resets, no more not beeing able to load the kernel. I had this motherboard for four years and now it feels like it’s brand new.