Change Windows 10 from SATA to AHCI

Windows 10 comes most of the time pre-installed as SATA mode. Linux cannot be installed in SATA mode. In order to change Windows to AHCI mode do the following:

However in order to be able to enable legacy boot you have to switch the SATA controller from RAID to AHCI, which can cause Windows to get unhappy about its boot device going away unless you warn it first.

  • Fire up an admin shell in Windows (right click on the start menu)
  • bcdedit /set safeboot minimal
  • Reboot into the BIOS
  • Change the SATA Controller mode from RAID to AHCI (dire warnings about “All data will be erased”. It’s not true, but you’ve back up first, right?) Set “Boot Mode” to “Legacy Support”.
  • Save changes and let Windows boot to Safe Mode
  • Fire up an admin shell in Windows (right click on the start menu again)
  • bcdedit /deletevalue safeboot
  • Reboot again and Windows will load in normal mode with the AHCI drivers

Setting EFI variables for Linux in Windows

My Lenovo Yoga 720 does not allow me to boot Linux in UEFI only mode yet grub is not able to set EFI variables in mixed mode.

So in order to get Grub added to UEFI you have to do that in Windows. The following will get you go:

bcdedit /enum firmware
bcdedit /copy "{bootmgr}" /d "<NameOfLinux>"
bcdedit /set "{<guid>}" path \EFI\<NameofLinux>\grubx64.efi
bcdedit /set "{fwbootmgr}" displayorder "{<guid>}" /addfirst

Replace <guid> with the Information obtained from calling bcdedit /enum firmware.