Difference between revisions of "AHCI"

From ArchWiki
Jump to navigation Jump to search
m (Troubleshooting: - corrected grammar for better readability)
 
(28 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category: Storage (English)]]
+
[[Category:Storage]]
[[Category:HOWTOs (English)]]
+
[[es:AHCI]]
{{Article summary start| Summary }}
+
[[ja:AHCI]]
{{Article summary text|Enabling AHCI data transfer mode for SATA devices}}
+
[[zh-hans:AHCI]]
{{Article summary heading|Languages}}
+
[[Wikipedia:AHCI|AHCI]] (Advanced Host Controller Interface) is the native work mode for SATA drives. AHCI has two main benefits: support for hot pluggable SATA drives (mimicking USB drives' behavior) and [[Wikipedia:Native Command Queuing|Native Command Queuing]] (NCQ). It has been present in the Linux kernel since version 2.6.19 and will be loaded automatically in current Arch kernel
{{i18n_entry|English|AHCI}}
 
<!--
 
{{Article summary heading|Related Articles}}
 
{{Article summary wiki|}}
 
-->
 
{{Article summary end}}
 
'''AHCI''', abbreviation for ''a''dvanced ''h''ost ''c''ontroller ''i''nterface, is the native work mode for SATA drives, and has been present in the Linux kernel since version 2.6.19.
 
 
 
While SATA drives are usually configured as legacy/parallel ATA by default, enabling AHCI through the BIOS has two main benefits: support for hot pluggable SATA drives (mimicking USB drives' behavior) and NCQ, or ''n''ative ''c''ommand ''q''ueuing.
 
 
 
== Add the AHCI module to the kernel image ==
 
Edit {{filename|/etc/[[mkinitcpio]].conf}} and add {{codeline|ahci}} to the {{codeline|MODULES}} variable:
 
MODULES="ahci"
 
 
 
Rebuild the kernel image so that it includes the newly added module:
 
# mkinitcpio -p kernel26
 
  
 
== Configure from BIOS ==
 
== Configure from BIOS ==
The way for accessing the BIOS depends on the motherboard; usually, {{keypress|Del}} is used to display the menu.
+
If your BIOS set SATA as legacy/parallel ATA, you can access BIOS setting depends on the motherboard; usually, {{ic|Del}} is used to display the menu.
  
Once the BIOS options are available, Enter search for settings such as:
+
Once the BIOS options are available, search for parameters resembling:
 
  Enable SATA as: IDE/AHCI
 
  Enable SATA as: IDE/AHCI
 
or:
 
or:
 
  SATA: PATA Emulation/Native/Enhanced
 
  SATA: PATA Emulation/Native/Enhanced
  
Choose {{codeline|AHCI}} or {{codeline|Native}}, save your settings and exit the BIOS. Consult the motherboard's manual if it's not clear which of the modes is AHCI, since the naming can vary.
+
Choose {{Ic|AHCI}} or {{Ic|Native}}, save the settings and exit the BIOS. Consult the motherboard's manual if it's not clear which of the modes is AHCI, since the naming can vary.
  
After altering and saving the BIOS settings, Linux should load the AHCI driver on the next boot. {{codeline|dmesg}}'s output should confirm this:
+
After altering and saving the BIOS settings, Linux should load the AHCI driver on the next boot. {{Ic|dmesg}}'s output should confirm this:
 
<pre>
 
<pre>
 
SCSI subsystem initialized
 
SCSI subsystem initialized
Line 51: Line 35:
 
  ata2.00: 625142448 sectors, multi 16: LBA48 NCQ (depth 31/32)
 
  ata2.00: 625142448 sectors, multi 16: LBA48 NCQ (depth 31/32)
  
== Pitfalls ==
+
== Troubleshooting ==
* Windows XP does not have stock AHCI drivers, meaning that it relies on drivers from the motherboard's CD or webiste.
+
It is possible that the AHCI module is not loaded automatically if SATA configuration is switched from IDE to AHCI after installing Arch.
* During booting, if there is a delay before [[GRUB]] appears, check BIOS settings. There might be an option that introduces such a delay so that "lazy" optical drives are able to boot.
+
In such case, an error message will appear at early boot indicating that the root partition was not found.
  
== Resources ==
+
If that happens, the {{Ic|failsafe}} boot option should still work fine.
*[http://en.wikipedia.org/wiki/AHCI AHCI on Wikipedia]
+
Once started in failsafe mode, you have to run [[mkinitcpio]] to re-generate initramfs images.
*[http://en.wikipedia.org/wiki/NCQ NCQ on Wikipedia]
 
*[http://downloadcenter.intel.com/Detail_Desc.aspx?agr=Y&ProductID=2101&DwnldID=17268&strOSs=44&OSFullName=Windows*%20XP%20Professional&lang=eng Intel Matrix Storage Manager]
 
*[http://expertester.wordpress.com/2008/07/27/how-to-enable-ahci-windows-xp/ AHCI on Windows XP]
 

Latest revision as of 10:22, 18 May 2019

AHCI (Advanced Host Controller Interface) is the native work mode for SATA drives. AHCI has two main benefits: support for hot pluggable SATA drives (mimicking USB drives' behavior) and Native Command Queuing (NCQ). It has been present in the Linux kernel since version 2.6.19 and will be loaded automatically in current Arch kernel.

Configure from BIOS

If your BIOS set SATA as legacy/parallel ATA, you can access BIOS setting depends on the motherboard; usually, Del is used to display the menu.

Once the BIOS options are available, search for parameters resembling:

Enable SATA as: IDE/AHCI

or:

SATA: PATA Emulation/Native/Enhanced

Choose AHCI or Native, save the settings and exit the BIOS. Consult the motherboard's manual if it's not clear which of the modes is AHCI, since the naming can vary.

After altering and saving the BIOS settings, Linux should load the AHCI driver on the next boot. dmesg's output should confirm this:

SCSI subsystem initialized
libata version 3.00 loaded.
ahci 0000:00:1f.2: version 3.0
ahci 0000:00:1f.2: PCI INT B -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: irq 764 for MSI/MSI-X
ahci 0000:00:1f.2: AHCI 0001.0200 32 slots 6 ports 3 Gbps 0x3f impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq sntf stag pm led clo pmp pio slum part ems 
ahci 0000:00:1f.2: setting latency timer to 64
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
scsi4 : ahci
scsi5 : ahci

and for NCQ:

ata2.00: 625142448 sectors, multi 16: LBA48 NCQ (depth 31/32)

Troubleshooting

It is possible that the AHCI module is not loaded automatically if SATA configuration is switched from IDE to AHCI after installing Arch. In such case, an error message will appear at early boot indicating that the root partition was not found.

If that happens, the failsafe boot option should still work fine. Once started in failsafe mode, you have to run mkinitcpio to re-generate initramfs images.