Debian降级内核
在排查 三星PM9A1 NVMe存储初始化timeout无法识别 我发现 三星PM9A1 NVMe存储 之前在内核 5.15/5.19 工作正常,但是近期升级到 Kernel 6.x 之后无法识别。所以尝试降级内核 5.x :
搜索官方提供的内核选项:
搜索debian发行版提供的内核
apt-cache search linux | grep -P "^linux-image[^ ]*[0-9]\-amd64 "
输出显示:
搜索debian发行版提供的内核的列表
linux-image-6.1.0-27-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-29-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-11-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-12-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-17-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-20-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-21-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-23-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-26-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-28-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-31-amd64 - Linux 6.1 for 64-bit PCs (signed)
linux-image-6.1.0-30-amd64 - Linux 6.1 for 64-bit PCs (signed)
如果需要安装某个低版本,则使用指定内核版本:
指定低版本内核安装
apt install linux-image-6.1.0-13-amd64
systemctl restart
哦,对于 debian 12,当前不提供旧版本 5.x 内核了么?
How To Install Linux Kernel 5.15 on Debian 11 提供了一个思路就是自己编译主线内核...
查看了一下 Debian version history 原来Debian内核版本是固定的:
Bullseye(11) 内核 5.10
Bookworm(12) 内核 6.1
也就是说如果要回退内核,需要降级到 Debian 11 ?
debian 提供了一个 debian内核镜像归档
下载5.19内核软件包
https://snapshot.debian.org/file/d8f2d453d5d16ad368123ad590e6756a22629474/linux-image-amd64_5.19.11-1_amd64.deb
https://snapshot.debian.org/file/749b600d0a97136e186bd3565c484f60a56e786f/linux-image-5.19.0-2-amd64_5.19.11-1_amd64.deb
安装低版本内核:
安装5.19内核
dpkg -i linux-image-5.19.0-2-amd64_5.19.11-1_amd64.deb linux-image-amd64_5.19.11-1_amd64.deb
安装输出信息:
安装5.19内核
Selecting previously unselected package linux-image-5.19.0-2-amd64.
(Reading database ... 94938 files and directories currently installed.)
Preparing to unpack linux-image-5.19.0-2-amd64_5.19.11-1_amd64.deb ...
Unpacking linux-image-5.19.0-2-amd64 (5.19.11-1) ...
Preparing to unpack linux-image-amd64_5.19.11-1_amd64.deb ...
Unpacking linux-image-amd64 (5.19.11-1) over (5.19.11-1) ...
Setting up linux-image-5.19.0-2-amd64 (5.19.11-1) ...
I: /vmlinuz.old is now a symlink to boot/vmlinuz-6.1.0-31-amd64
I: /initrd.img.old is now a symlink to boot/initrd.img-6.1.0-31-amd64
I: /vmlinuz is now a symlink to boot/vmlinuz-5.19.0-2-amd64
I: /initrd.img is now a symlink to boot/initrd.img-5.19.0-2-amd64
/etc/kernel/postinst.d/dkms:
dkms: autoinstall for kernel 5.19.0-2-amd64 was skipped since the kernel headers for this kernel do not seem to be installed.
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-5.19.0-2-amd64
/etc/kernel/postinst.d/zz-update-grub:
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.1.0-31-amd64
Found initrd image: /boot/initrd.img-6.1.0-31-amd64
Found linux image: /boot/vmlinuz-6.1.0-30-amd64
Found initrd image: /boot/initrd.img-6.1.0-30-amd64
Found linux image: /boot/vmlinuz-5.19.0-2-amd64
Found initrd image: /boot/initrd.img-5.19.0-2-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Linux From Scratch (12.2) on /dev/nvme0n1p2
Adding boot menu entry for UEFI Firmware Settings ...
done
Setting up linux-image-amd64 (5.19.11-1) ...
注意,这里安装有一些报错,例如 dkms
报错,因为没有安装对应 5.19 内核的 headers包导致的。由于我只是临时使用,所以这里没有修复。实际上安装时应该再加上:
linux-headers-amd64_5.19.11-1_amd64.deb
由于降级到 5.19 还没有解决 三星PM9A1 NVMe存储初始化timeout无法识别 ,所以继续降级到 5.15:
下载5.15内核软件包
https://snapshot.debian.org/archive/debian/20220201T025006Z/pool/main/l/linux-signed-amd64/linux-image-amd64_5.15.15-2_amd64.deb
https://snapshot.debian.org/archive/debian/20220201T025006Z/pool/main/l/linux-signed-amd64/linux-image-5.15.0-3-amd64_5.15.15-2_amd64.deb
安装 5.15:
安装5.15内核
dpkg -i linux-image-amd64_5.15.15-2_amd64.deb linux-image-5.15.0-3-amd64_5.15.15-2_amd64.deb
警告
很遗憾,我的内核降级没有解决 三星PM9A1 NVMe存储初始化timeout无法识别 ,还在探索中