Loading

CentOS 7 Arm 内核离线升级

为什么要升级内核?

Docker 在CentOS系统中需要安装在 CentOS 7 64 位的平台,并且内核版本不低于 3.10;CentOS 7.× 满足要求的最低内核版本要求,但由于 CentOS 7默认内核版本比较低,部分功能(如 overlay2 存储层驱动)无法使用,并且部分功能可能不太稳定。所以建议大家升级到最新的稳定内核版本。

较低内核版本导致Redis无法启动

Defaulted container "redis" out of: redis, sentinel, split-brain-fix, redis-exporter, config-init (init)
1:C 16 Jul 2025 12:09:37.913 # WARNING Your kernel has a bug that could lead to data corruption during background save. Please upgrade to the latest stable kernel.
1:C 16 Jul 2025 12:09:37.913 # Redis will now exit to prevent data corruption. Note that it is possible to suppress this warning by setting the following config: ignore-warnings ARM64-COW-BUG

离线升级

1. 查看当前内核版本

$ uname -sr

Linux 4.18.0-193.28.1.el7.aarch64

2. 更新内核

下载对应内核版本rpm包

https://kojipkgs.fedoraproject.org/packages/kernel/5.6.8/300.fc32/aarch64/

yum -y localinstall *.rpm

3. 设置默认启动项

$ awk -F\' '$1=="menuentry " {print i++ " : " $2}' /boot/efi/EFI/centos/grub.cfg
0 : CentOS Linux (5.6.8-300.fc32.aarch64) 7 (AltArch)
1 : CentOS Linux (4.18.0-193.28.1.el7.aarch64) 7 (AltArch)
2 : CentOS Linux (0-rescue-bff032b757384ba98ef82ab3e460e3d4) 7 (AltArch)

将5.6.8设置为首选内核版本

grub2-set-default 0

4. 重新生成grub配置文件

$ grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.6.8-300.fc32.aarch64
Found initrd image: /boot/initramfs-5.6.8-300.fc32.aarch64.img
Found linux image: /boot/vmlinuz-4.18.0-193.28.1.el7.aarch64
Found initrd image: /boot/initramfs-4.18.0-193.28.1.el7.aarch64.img
Found linux image: /boot/vmlinuz-0-rescue-bff032b757384ba98ef82ab3e460e3d4
Found initrd image: /boot/initramfs-0-rescue-bff032b757384ba98ef82ab3e460e3d4.img
done

5. 重启并查看内核版本

reboot

查看内核版本:

$  uname -r
5.6.8-300.fc32.aarch64

升级成功

posted @ 2025-07-16 20:10  亚里士多智  阅读(79)  评论(0)    收藏  举报