AMD EPYC Server mit Ubuntu - SATA Hot-Swap aktivieren
Auf AMD EPYC Serverplattformen (sowohl Rome als auch Milan) funktioniert Hot-Swap von SATA Datenträgern nicht mit der Standardkonfiguration von Ubuntu 22.04 LTS oder Proxmox VE 7.x. Ursache ist die beim Ubuntu Kernel konfigurierte CONFIG_SATA_MOBILE_LPM_POLICY=3 Kerneloption, die den Energieverbrauch von Mobilgeräten verringert. Die Kernel Bootoption ahci.mobile_lpm_policy=1 behebt das Problem. Bei Verwendung von Microsoft Windows (Server 2022, Server 2019, Windows 10) treten ebenso keine Hot-Swap Probleme auf.
SATA Hot-Swap aktivieren
Die folgenden Kernel Bootparameter ermöglichen Hot-Swap:[1]
- ahci.mobile_lpm_policy=0
- ahci.mobile_lpm_policy=1
- ahci.mobile_lpm_policy=2
Hintergrundinformationen
CONFIG_SATA_MOBILE_LPM_POLICY Konfigurationsmöglichkeiten
Beim Kompilieren des Linux Kernels kann eine gewünschte Standard-SATA Link Power Management (LPM) Richtlinie für Chipsets ("South Bridges") gewählt werden (CONFIG_SATA_MOBILE_LPM_POLICY).
Folgende Richtlinien stehen zur Auswahl zur Verfügung:[2][3]
CONFIG_SATA_MOBILE_LPM_POLICY | Description | ata_lpm_policy_names[][4] / ata_lpm_policy[5] |
---|---|---|
0 | Keep firmware settings (Vanilla Kernel Default) | ATA_LPM_UNKNOWN |
1 | Maximum performance | ATA_LPM_MAX_POWER |
2 | Medium power | ATA_LPM_MED_POWER |
3 | Medium power with Device Initiated PM enabled | ATA_LPM_MED_POWER_WITH_DIPM |
ATA_LPM_MIN_POWER_WITH_PARTIAL | ||
4 | Minimum power | ATA_LPM_MIN_POWER |
Hinweis: Die Einstellung "Minimum power" ist dafür bekannt, dass sie bei einigen SSDs/HDDs Probleme verursacht und sollte daher nicht verwendet werden.[6]
Der Ubuntu 22.04 Kernel 5.15 wird mit der Option CONFIG_SATA_MOBILE_LPM_POLICY=3 kompiliert.[1] Mit dieser Einstellung wird ein nicht genutzter Port beim Bootvorgang abgeschaltet[7]. Dies spart Energie und ist vor allem bei mobilen Geräten von Bedeutung, da damit die Akkulaufzeit erhöht wird. Bei Server-Systemen funktioniert damit aber kein Hot-Swap. Im Zuge der Entwicklung des Linux Kernel 5.19 wurde überlegt, CONFIG_SATA_MOBILE_LPM_POLICY=3 generell als Standardwert zu setzen. Aufgrund der Probleme mit Hot-Plug wurde davon abgesehen.[8][9]
SATA Hot-Swap Problem Beispiele
Die folgenden Beispiele wurden mit folgendem Beispielsetup durchgeführt:
- Supermicro H12SSL-NT Mainboard (sowohl Hardware Revision 1.01 und 1.02)
- BIOS Version 2.3 und 2.4
- SC825TQC-R802LPB Chassis
- BPN-SAS3-825TQ Backplane (Problem lässt sich auch ohne Backplane nachstellen)
- SATA Datenträger via Slim-SAS Kabel direkt dem Mainboard verbunden (Bei Verwendung eines Microsemi Adaptec HBA 1000-8i kommt es zu keinem Hot-Swap Problem)
Die How-Swap Probleme treten ausschließlich auf AMD EPYC Systemen mit der Standardkonfiguration von Ubuntu 22.04 auf (ohne Kernel Bootoption ahci.mobile_lpm_policy=1).
Bei einem Test mit einem Supermicro X12DPi-N6 Mainboard mit 3rd Generation Intel Xeon Scalable Prozessoren kam es zu keinen Problemen in der Standardkonfiguration von Ubuntu 22.04.
Hot-Add Test
Beim Einstecken eines SATA Datenträgers wird der neue Datenträger nicht automatisch erkannt.
Hot-Removal Test
Ein Entfernen eines SATA Datenträgers im laufenden Betrieb (Hot-Removal) wird zunächst nicht vom Ubuntu Kernel erkannt.
Erst wenn ein Lese- oder Schreibzugriff auf den betroffenen Datenträger versucht wird, kommt es zu Fehlermeldungen:
[ 248.127538] ata5.00: exception Emask 0x10 SAct 0x1000000 SErr 0x90202 action 0x6 frozen [ 248.129086] ata5: SError: { RecovComm Persist PHYRdyChg 10B8B } [ 248.129859] ata5.00: failed command: READ FPDMA QUEUED [ 248.130630] ata5.00: cmd 60/00:c0:00:00:00/01:00:00:00:00/40 tag 24 ncq dma 131072 in res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x14 (ATA bus error) [ 248.132201] ata5.00: status: { DRDY } [ 248.132985] ata5: hard resetting link [ 248.447963] ata5: SATA link down (SStatus 0 SControl 300)
Einzelnachweise
- ↑ 1,0 1,1 Comment 51 for bug 1971576 (bugs.launchpad.net) On AMD EPYC, both ROME and Milan server platforms, SATA hot plug not working on Ubuntu 22.04 LTS. [...] Ubuntu kernel compile with configure CONFIG_SATA_MOBILE_LPM_POLICY=3. [...] To enable hotplug by adding below kernel parameter can make sata hot plug working ahci.mobile_lpm_policy=1. In our test, set to 0 or 2 also works.
- ↑ drivers/ata/Kconfig - Line 118 (git.kernel.org) [...] Select the Default SATA Link Power Management (LPM) policy to use for mobile / laptop variants of chipsets / "South Bridges". [...]
- ↑ Default SATA Link Power Management policy for low power chipsets - configname: CONFIG_SATA_LPM_POLICY (www.kernelconfig.io)
- ↑ ata_lpm_policy_names (elixir.bootlin.com)
- ↑ ata_lpm_policy (elixir.bootlin.com)
- ↑ ATA_HORKAGE_NOLPM (elixir.bootlin.com),
- ↑ Comment 46 for bug 1971576 (bugs.launchpad.net) When policy is set this way the code will look and see whether any links are enabled and power the port off if not. When the port is powered off, it doesn't get powered back on.
- ↑ RE: (PATCH 1/2) ahci: Add PhyRdy Change control on actual LPM capability (linux-ide Mailing List, 18.05.2022) This regression happened because it got brought back to 5.4-stable, and as it turns out the exact same FCH controller ID from the client silicon is used in another product. It's an ASUS server system with AMD Epyc processor. The regression is specifically along hotplug, that hotplug no longer works with the more aggressive policies.
- ↑ (PATCH 3/3) ahci: Document the loss of hotplug by new LPM policy (linux-ide Mailing List, 24.05.2022) Per AHCI spec v1.3.1, "7.3 Native Hot Plug Support", once LPM is enabled hotplug support needs to be disabled.
Weitere Informationen
- How to reset and detect plug-in HDD/SSD via IDE or SATA without rebooting? (askubuntu.com) sudo rescan-scsi-bus
- Hotplug SATA drive not being detected automatically while system is On/Up/Booted already (www.reddit.com) sudo echo 0 0 0 | tee /sys/class/scsi_host/host*/scan
Autor: Werner Fischer Werner Fischer arbeitet im Product Management Team von Thomas-Krenn. Er evaluiert dabei neueste Technologien und teilt sein Wissen in Fachartikeln, bei Konferenzen und im Thomas-Krenn Wiki. Bereits 2005 - ein Jahr nach seinem Abschluss des Studiums zu Computer- und Mediensicherheit an der FH Hagenberg - heuerte er beim bayerischen Server-Hersteller an. Als Öffi-Fan nutzt er gerne Bus & Bahn und genießt seinen morgendlichen Spaziergang ins Büro.
|