1 - 更新CPU微码
pve 启动时,看到屏幕上有提示要求更新 microcode。
添加仓库
需要添加 unstable repo:
echo "deb http://deb.debian.org/debian/ unstable non-free-firmware" > /etc/apt/sources.list.d/debian-unstable.list
执行更新:
apt update && apt list --upgradable
安装微码,intel 选择:
apt -y install intel-microcode
amd 选择:
apt -y install amd64-microcode
更新完之后重启,发现之前报告要求更新 microcode 的信息消失了,搞定。
记得把 unstable 仓库删除,避免不小心更新到这个仓库中的其他软件。
rm /etc/apt/sources.list.d/debian-unstable.list
引发问题
安装上面的方式安装微码之后,即使注释或者删除 debian-unstable.list 文件,在 apt update 时也会出现以下提示:
$ apt update
Hit:1 https://mirrors.ustc.edu.cn/debian bookworm InRelease
Hit:2 https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bookworm InRelease
Hit:3 https://mirrors.ustc.edu.cn/debian bookworm-updates InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
N: Repository 'Debian bookworm' changed its 'firmware component' value from 'non-free' to 'non-free-firmware'
N: More information about this can be found online in the Release notes at: https://www.debian.org/releases/bookworm/amd64/release-notes/ch-information.html#non-free-split
如果不想继续看到这个提示,可以修改文件:
vi /etc/apt/apt.conf.d/no-bookworm-firmware.conf
输入内容:
APT::Get::Update::SourceListWarnings::NonFreeFirmware "false";
再次执行 apt update 命令就不会再出现这个提示了:
$ apt update
Hit:1 https://mirrors.ustc.edu.cn/debian bookworm InRelease
Hit:2 https://mirrors.ustc.edu.cn/debian bookworm-updates InRelease
Hit:3 https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
参考资料
2 - [归档]安装r8125驱动
警告
发现更新驱动之后,普通模式下可以正常工作,但一旦开启直通,这个驱动就会无法工作。
而因为 r8139 被加入黑名单,导致没有驱动可用,然后网卡就无法使用。
因为这个网卡是用于管理网络的,所以 pve 也跟着失联了……
因此,放弃更新这个驱动。后续移除了所有的 2.5g 网卡,统一使用 cx3 pro 40g (hp544+)或者 cx4 25g 网卡。
准备工作
apt install -y dkms
apt install -y pve-headers-$(uname -r)
apt install --fix-broken
下载驱动
https://github.com/awesometic/realtek-r8125-dkms/releases
mkdir ~/temp
cd ~/temp
wget https://github.com/awesometic/realtek-r8125-dkms/releases/download/9.010.01-2/realtek-r8125-dkms_9.010.01-2_amd64.deb
通过安装包安装驱动
dpkg -i realtek-r8125-dkms_9.010.01-2_amd64.deb
输出为:
dpkg -i realtek-r8125-dkms_9.010.01-2_amd64.deb
Selecting previously unselected package realtek-r8125-dkms.
(Reading database ... 86910 files and directories currently installed.)
Preparing to unpack realtek-r8125-dkms_9.010.01-2_amd64.deb ...
Unpacking realtek-r8125-dkms (9.010.01-2) ...
Setting up realtek-r8125-dkms (9.010.01-2) ...
locale: Cannot set LC_ALL to default locale: No such file or directory
Loading new realtek-r8125-9.010.01 DKMS files...
Deprecated feature: REMAKE_INITRD (/usr/src/realtek-r8125-9.010.01/dkms.conf)
Building for 6.2.16-4-pve
Building for architecture amd64
Building initial module for 6.2.16-4-pve
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/realtek-r8125/9.010.01/source/dkms.conf)
Done.
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/realtek-r8125/9.010.01/source/dkms.conf)
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/realtek-r8125/9.010.01/source/dkms.conf)
r8125.ko:
Running module version sanity check.
- Original module
- No original module exists within this kernel
- Installation
- Installing to /lib/modules/6.2.16-4-pve/updates/dkms/
depmod...
这个版本是 9.010。
通过源码安装驱动
发现代码里面有更新到 9.011,只是没有打包发布为 deb 格式。但是可以从源码开始安装。
git clone https://github.com/awesometic/realtek-r8125-dkms.git
cd realtek-r8125-dkms
./dkms-install.sh
输出为:
./dkms-install.sh
About to run dkms install steps...
Deprecated feature: REMAKE_INITRD (/usr/src/r8125-9.011.01/dkms.conf)
Creating symlink /var/lib/dkms/r8125/9.011.01/source -> /usr/src/r8125-9.011.01
Sign command: /lib/modules/6.2.16-4-pve/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/r8125/9.011.01/source/dkms.conf)
Building module:
Cleaning build area...
'make' -j16 KVER=6.2.16-4-pve BSRC=/lib/modules/6.2.16-4-pve modules......
Signing module /var/lib/dkms/r8125/9.011.01/build/src/r8125.ko
Cleaning build area...
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/r8125/9.011.01/source/dkms.conf)
r8125.ko:
Running module version sanity check.
- Original module
- Installation
- Installing to /lib/modules/6.2.16-4-pve/updates/dkms/
depmod...
Finished running dkms install steps.
更换驱动
屏蔽 r8169 驱动:
sudo sh -c 'echo blacklist r8169 >> /etc/modprobe.d/blacklist_r8169.conf'
重启机器,检验:
lsmod | grep r81
r8125 262144 0
r8169 114688 0
对比没有更新驱动的输出:
lsmod | grep r81
r8169 114688 0
检验
更新之前,客户端和服务器端都使用默认的 r8169 驱动,iperf3 测试速度为 2.35-2.36G。
更新客户端驱动为 r8125 驱动, iperf3 测试速度为 2.35-2.36 G,几乎没有变化。
继续更新服务器端驱动为 r8125 驱动, iperf3 测试速度为 2.35/2.36G,几乎没有变化。
总结:更新驱动未能带来速度方面的直接收益。