Determining the OS X version on a nonbooted-but-bootable disk

Happens every time: Client comes in with a nonbooting Mac that turns out to need an OS reinstall, but they don’t have their installer media. It’s less of an issue with recovery partitions and Internet Recovery, but it happens often enough to be annoying. Here’s how to find the installed OS version.

  • Start the problem machine in target disk mode and connect it to a functional box.
  • On the working machine, open Terminal and enter
strings /path/to/mach_kernel | grep 'Darwin'
  • The path to the mach_kernel will be /Volumes/drivename/mach_kernel.
  • The returned data should look something like this
Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64
  • grepping ‘Darwin Kernel Version’ returns marginally cleaner results, but requires too much typing.
  • Anyway, now cross reference your kernel version with Wikipedia’s Darwin release history tableet voíla, your installed system version.

Sometimes, it’s the little things. Hat tip to Mac Help for the right command.