Enabling SATA AHCI on a Linux Macbook3,1

I have a Macbook3,1 with the following SATA controller:

00:1f.2 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 03)

This chip can work either in AHCI or IDE mode. Even though (in numbers) AHCI and IDE should have similar performance, I have found that AHCI mode is much better. Specially when the disk is under heavy siege by more than one application.

The catch is that Macbooks turn off AHCI when booting in BIOS mode, which is the mode I use for GNU/Linux. I understand this also affects Windows.

Pictured: a girl after enabling AHCI on her Linux Macbook

After some googling I found this post that explains how to activate AHCI mode using GRUB2.

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/:

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

I understand this is also relevant for newer Macbooks and “standard” PC hardware, so you might want to do some googling. The easy way to know if you are on the right mode is to run lspci -nn on a regular terminal (not GRUB) and see if you have a SATA controller that is in the wrong mode.

This entry was posted in English, planetdebian, planetgnome, Tips and tagged , , , . Bookmark the permalink.

3 Responses to Enabling SATA AHCI on a Linux Macbook3,1

  1. Yves-Alexis Perez says:

    Note that you could also install in UEFI mode (using Sledge’s images). It works just fine.

  2. diegoe says:

    But, isn’t EFI unable to provide 2D/3D accel? According to the internets I can only get X working on the framebuffer driver, and not with the proper intel one, for example. Basically: can I run GNOME Shell properly? Does it suspend? Can I get correct video-out?

  3. obi says:

    I’ve added this as a page fragment to the Debian wiki.

    Could you complete the page on the wiki:

    in a similar way as f.e.:

    Even if you just add cpuinfo/lspci/lsusb, it’d be helpful already.

Comments are closed.