SATA / AHCI Mode

Many SATA controllers have two modes of operation: IDE mode (using the ata_generic or the ata_piix kernel modules for example), and AHCI mode (using the ahci module). Apple determines the mode of operation on boot based on whether the system is booted in EFI mode or BIOS compatibility mode (see the whole section on EFI/BIOS for more detail).

When you use BIOS mode the SATA controller will be switched to IDE mode. If you want to set the controller in AHCI mode while using BIOS compatibility before the kernel boots up, you can do it using GRUB2. The reason why you might want to do this, is because the AHCI mode and module ensures better performance under load, and is generally more stable.

The fix is to just add a setpci call on your GRUB configuration. To be safe you can test it by going into command line mode in GRUB, and doing something like this:

> lspci
(check for the ID for IDE mode, in my case 8086:2828)
> setpci -d 8086:2828 90.b=40
> lspci
(The 2828 ID is now gone, replaced by 8086:2829, AHCI/SATA mode)

You can add this to your GRUB configuration, and avoid losing it on upgrades, by adding a script like this to /etc/grub.d/:

#!/bin/sh
set -e
## Enable SATA (AHCI) mode on macbook 3,1
echo "setpci -d 8086:2828 90.b=40"

For more info see these blog posts: