ASMedia SATA Controller not recognized

DTIVKITT

New Member
May 15, 2022
6
0
1
Hi Everyone. I need a little help here :)

I decided do install PVE but my SATA Controller doesn't get recognized. Tested on Windows and everything works fine, so not a hardware problem.

lspci -v returned that:
....
Code:
04:00.0 IDE interface: ASMedia Technology Inc. Device 0624 (rev 01) (prog-if 85 [PCI native mode-only controller, supports bus mastering])
        Subsystem: ASMedia Technology Inc. Device 1060
        Flags: bus master, fast devsel, latency 0, IRQ 10, NUMA node 0
        I/O ports at ec00 [size=8]
        I/O ports at e880 [size=4]
        I/O ports at e800 [size=8]
        I/O ports at e480 [size=4]
        I/O ports at e400 [size=16]
        Memory at fe02e000 (32-bit, non-prefetchable) [size=8K]
        Expansion ROM at fdf80000 [disabled] [size=512K]
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit-
        Capabilities: [78] Power Management version 3
        Capabilities: [80] Express Legacy Endpoint, MSI 00
        Capabilities: [100] Virtual Channel
        Capabilities: [800] Advanced Error Reporting
        Kernel modules: pata_acpi

Having in mind this controller is a SATA one and not a PATA, I tried the following:

Tried to blacklist pata_acpi according to this post:
https://unix.stackexchange.com/ques...sata-controller-106x-not-working-under-ubuntu

Code:
cd /etc/modprobe.d/
cp pve-blacklist.conf pve-blacklist.conf.bak
nano pve-blacklist.conf

ADD TO THE LAST LINE:
blacklist pata_acpi

update-initramfs -u

After rebooting, nothing changed. The same pata_acpi being loaded.

Then, digging bit further, found this:
https://lore.kernel.org/linux-ide/YVx5aRInLEvV3eaQ@slm.duckdns.org/T/
and this:
https://bbs.archlinux.org/viewtopic.php?id=271095

Saying my controller is not listed in the ahci.c file.
The problem is, these links are not talking about PVE, they are talking about Ubuntu and I couldn't find an ahci.c file in PVE
(or am I not looking on the right place?).

My board highlited in the ahci.c mentioned above: https://github.com/torvalds/linux/blob/master/drivers/ata/ahci.c#L604

Any help would be apreciated.
 
From what you have dug up, it looks like it is supported from kernel version 5.16 onwards. The ahci.c is part of the kernel. PVE just uses the kernel (we build our own package from it). You can either build your own kernel, or you have to wait till a newer kernel version is released.
 
  • Like
Reactions: DTIVKITT
I think I'll try to build my kernel, just need some help with it. Unfortunately I have little experience in Linux/PVE.
If that doesn't work, waiting is the way.
Any idea when a new version will be released (based on the previous ones) ?
 
!!! BEFORE STARTING PLEASE DO READ THIS !!!

First of all, I managed do edit the kernel and add my board to the ahcI.c file, BUT, I can get only 5 disks to work (the controller Is a 10 port SATA, so only 50% working) If that's ok for you, you can proceed, If not, don't waste your time and go buy a compatible expansion card.
The error I get Is "ubsan: array-index-out-of-bounds in drivers/ata/libahci.c:968:41 / index 15 is out of range for type 'ahci_em_priv [8]'"
If there Is anyone who can help me with this part, I really appreciate :)


The kernel version is not exactly the same as the one in pve. The version we are going to install is the Linux 5.15.39-4-pve #2 SMP PVE 5.15.39-4 (Mon, 08 Aug 2022 15:11:15 +0200)

OK, THAT BEING SAID, LETS GO TO WORK

Be aware the "make" part may take some time (a couple of minutes or even hours)

MAKE SURE YOU HAVE AT LEAST 100GB FREE SPACE ON THE PVE-ROOT PARTITION (If you don't, you could try IncreasIng It by addIng a new HD/SSD or creatIng a VM wIth PVE on a PC and just copy the 5 deb fIles created at the end)


CHECK IT BY TYPING:
df -h

INSTALL DEPENDENCIES

Code:
apt install asciidoc-base automake bc bison cpio debhelper dh-python file flex gcc git kmod libdw-dev libelf-dev libiberty-dev libnuma-dev libpve-common-perl libslang2-dev libssl-dev libtool lintian lz4 perl-modules python2-minimal rsync sed sphinx-common tar xmlto zlib1g-dev dwarves

GO TO ROOT DIRECTORY
cd

CLONE KERNEL FROM GIT
git clone git://git.proxmox.com/git/pve-kernel.git

ENTER KERNEL DIRECTORY
cd pve-kernel

INITIALIZE THE SUBMODULES
make submodule

EDIT THE ahci.c FILE
nano /pve-kernel/submodules/ubuntu-jammy/drivers/ata/ahci.c

FIND THESE LINES (around line 600) BY SCROLLING
OR IF YOU ARE USING NANO EDITOR, PRESS "CTRL + _" AND TYPE "600", THIS WILL GET YOU CLOSE TO THE LINES YOU WANT

/* Asmedia */ { PCi_VDEViCE(ASMEDiA, 0x0601), board_ahci }, /* ASM1060 */ { PCi_VDEViCE(ASMEDiA, 0x0602), board_ahci }, /* ASM1060 */ { PCi_VDEViCE(ASMEDiA, 0x0611), board_ahci }, /* ASM1061 */ { PCi_VDEViCE(ASMEDiA, 0x0612), board_ahci }, /* ASM1062 */ { PCi_VDEViCE(ASMEDiA, 0x0621), board_ahci }, /* ASM1061R */ { PCi_VDEViCE(ASMEDiA, 0x0622), board_ahci }, /* ASM1062R */

ADD AT THE END

{ PCi_VDEViCE(ASMEDiA, 0x0624), board_ahci }, /* ASM1062+JMB575 */

THE END RESULT SHOULD BE SOMETHING LIKE THIS:

/* Asmedia */ { PCi_VDEViCE(ASMEDiA, 0x0601), board_ahci }, /* ASM1060 */ { PCi_VDEViCE(ASMEDiA, 0x0602), board_ahci }, /* ASM1060 */ { PCi_VDEViCE(ASMEDiA, 0x0611), board_ahci }, /* ASM1061 */ { PCi_VDEViCE(ASMEDiA, 0x0612), board_ahci }, /* ASM1062 */ { PCi_VDEViCE(ASMEDiA, 0x0621), board_ahci }, /* ASM1061R */ { PCi_VDEViCE(ASMEDiA, 0x0622), board_ahci }, /* ASM1062R */ { PCi_VDEViCE(ASMEDiA, 0x0624), board_ahci }, /* ASM1062+JMB575 */

SAVE AND CLOSE (CTRL + X / Y / ENTER)

GO TO ROOT DIRECTORY
cd

ENTER KERNEL DIRECTORY
cd /pve-kernel/

TO ENSURE A RECENT AND CLEANLY CHECKED OUT SUBMODULE
git submodule foreach git fetch --tags git submodule update --init

COMPILE (IT MAY TAKE SOME TIME, SO BE PATIENT)
make

THE END RESULT SHOULD BE SOMETHING LIKE THIS
root@x4-850:~/pve-kernel# ls abi-blacklist modules.prepared abi-prev-5.15.39-4-pve patches build pkg-zfs.prepared build.prepared pve-headers-5.15.39-4-pve_5.15.39-4_amd64.deb config-5.15.39.org pve-kernel_5.15.39-4_amd64.buildinfo debian pve-kernel_5.15.39-4_amd64.changes debian.prepared pve-kernel-5.15.39-4-pve_5.15.39-4_amd64.deb fwlist-previous pve-kernel-libc-dev_5.15.39-4_amd64.deb linux-tools-5.15_5.15.39-4_amd64.deb README linux-tools-5.15-dbgsym_5.15.39-4_amd64.deb submodules Makefile ubuntu-jammy.prepared

NOW ITS TIME TO INSTALL
dpkg -i linux-tools-5.15_5.15.39-4_amd64.deb && dpkg -i linux-tools-5.15-dbgsym_5.15.39-4_amd64.deb && dpkg -i pve-headers-5.15.39-4-pve_5.15.39-4_amd64.deb && dpkg -i pve-kernel-libc-dev_5.15.39-4_amd64.deb && dpkg -i pve-kernel-5.15.39-4-pve_5.15.39-4_amd64.deb

REBOOT

AFTER REBOOTING TYPE
umane -r

AND CHECK IF THE VERSION HAS CHANGED

THIS IS IT.
UNFORTUNATELY IT DOESNT SOLVE ALL MY PROBLEMS WITH THIS BOARD, BUT ITS A WORKAROUND.


USEFUL LINKS:
THE ubsan BUG I SAID
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1970074

SOME IDEA ON HOW TO BULD THE KERNEL
https://forum.proxmox.com/threads/building-the-pve-kernel-on-proxmox-ve-6-x.76137/

INCREASING PVE-ROOT SPACE
https://www.redhat.com/sysadmin/resize-lvm-simple

https://access.redhat.com/documenta.../6/html/storage_administration_guide/ext4grow
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!