In macOS what is the kext cache?

ddixon
New Contributor II

This maybe a stupid question to the Mac Administrator elite out there in JAMF nation, but what is the kext cache, and how does one rebuild or repair it? Also, when is it appropriate to do so?

2 REPLIES 2

Hugonaut
Valued Contributor II

no stupid questions!

everytime your computer starts up it takes a cache of the kernel extensions present. it uses the kernel extension cache to increase speed & efficiency. the reason you would rebuild your kext cache is when you change or add a kernel extension, it then needs to be accounted for in the kextcache. Someone please correct me if I'm innacurate / missing anything. off the cuff here

these commands rebuild your kextcache & why is in the following man page notes, more do exist these are examples & hopefully point you in the right direction.

sudo kextcache -i /
sudo kextcache -u /
sudo kextcache -system-caches

if you type "man kextcache" into your terminal you get the following - specific to the commands above. lots more info when you go to the man page

KEXTCACHE(8) BSD System Manager's Manual KEXTCACHE(8) NAME kextcache -- create kext cache files SYNOPSIS kextcache -prelinked-kernel filename [options] [--] [kext_or_directory ...] kextcache -system-prelinked-kernel [options] [--] [kext_or_directory ...] kextcache -system-caches [options] kextcache -update-volume os_volume [options] PRIMARY OPTIONS You must specify one of these options to have kextcache do anything: -system-caches Rebuild the info caches for system kexts on the root volume. -i os_volume, -invalidate os_volume Rebuild out-of-date caches and update any helper partitions associated with os_volume. This option mimics sudo touch /System/Library/Extensions on os_volume. If kextcache cannot find or make sense of os_volume/usr/standalone/bootcaches.plist, the volume is treated as if no caches need updating: success is returned. -u os_volume, -update-volume os_volume Rebuild out-of-date caches and update any helper partitions associated with os_volume. os_volume/System/Library/Caches/com.apple.bootstamps/ is used as a cache of metadata from any helper partitions. See -caches-only and -force. Which caches are rebuilt depends on the Mac OS X release installed on os_volume. If kextcache cannot find or make sense of os_volume/usr/standalone/bootcaches.plist the volume is treated as if no caches need updating: success is returned.
________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

ddixon
New Contributor II

Is the kext cache related to the approval of kernel extensions that one must do when running under the macOS High Sierra and above macOS's? And could one reset the "System Extension Blocked" messages that a user gets when installing certain applications and utilities to their defaults by clearing the kext cache? I ask this because I want to be able to test installations and uninstalls of various applications and utilities on macOS computers and return them to their original state without using a program such as Deep Freeze or such.