LoginSignup
3
2

More than 1 year has passed since last update.

Proxmox VEのkernel バージョン固定方法

Last updated at Posted at 2022-05-09

はじめに

ProxmoxVEを数年運用してきたが、バージョンアップ時にkenelのバージョンが上がりシステムダウンすることが何度かあった。手動でインストールしたドライバーが新しいカーネルに対応できなかったり、最近ではPCI Passthroghで不具合が発生している。
いずれも一つ前のKernelのバージョンへ戻すことで運用再開できている。新しいバージョンでは情報が不足していることも多く、調査に時間かかるため、即運用したい状況ではこの方法が良いかと思う。

方法

ProxmoxVEはベースがdebianなので、GRUBの設定でも良いのだがproxmox-boot-toolという専用のコマンドが用意されているのでそちらを使用する。

1.カーネル一覧を確認

GRUBのカーネル一覧からバージョンの文字列だけ/boot/grub/grub.cfgの中から切り出して表示する。上から順に最新のものとなっている。最新のもので不具合がある場合は2番目のバージョンを控えておく。今回は5.13.19-6-pveを使用することとする。

root@hoge:~# grep "menuentry 'Proxmox VE GNU/Linux, with Linux"  /boot/grub/grub.cfg | sed -r "s/^(.*?Proxmox VE GNU\/Linux, with Linux )([0-9].*?pve)'.*$/\2/g"
5.15.30-2-pve
5.13.19-6-pve
5.13.19-4-pve
5.13.19-2-pve
5.11.22-7-pve
4.15.18-18-pve
4.15.18-7-pve
4.13.13-4-pve
4.13.13-3-pve
4.13.13-2-pve
4.13.13-1-pve

2.バージョンの指定・固定

バージョンを固定するコマンドは以下の通り。
proxmox-boot-tool kernel pin カーネルバージョン

root@hoge:~# proxmox-boot-tool kernel pin 5.13.19-6-pve
Setting '5.13.19-6-pve' as grub default entry and running update-grub.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.30-2-pve
Found initrd image: /boot/initrd.img-5.15.30-2-pve
Found linux image: /boot/vmlinuz-5.13.19-6-pve
Found initrd image: /boot/initrd.img-5.13.19-6-pve
Found linux image: /boot/vmlinuz-5.13.19-4-pve
〜〜〜
Found initrd image: /boot/initrd.img-4.13.13-2-pve
Found linux image: /boot/vmlinuz-4.13.13-1-pve
Found initrd image: /boot/initrd.img-4.13.13-1-pve
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Adding boot menu entry for EFI firmware configuration
done

再起動するとバージョンが変わっていることがわかる

root@hoge:~# reboot
root@hoge:~# uname -r
5.13.19-6-pve

3.固定の解除

バージョンの固定がされているかは、以下のコマンドで確認する
proxmox-boot-tool kernel list

root@hoge:~# proxmox-boot-tool kernel list
Manually selected kernels:
None.

Automatically selected kernels:
5.13.19-6-pve
5.15.30-2-pve

Pinned kernel:
5.13.19-6-pve

解除は以下のコマンド
proxmox-boot-tool kernel unpin

root@hoge:~# proxmox-boot-tool kernel unpin
Removed /etc/kernel/next-boot-pin.
Removed /etc/kernel/proxmox-boot-pin.
Reset default grub entry and running update-grub.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.30-2-pve
Found initrd image: /boot/initrd.img-5.15.30-2-pve
Found linux image: /boot/vmlinuz-5.13.19-6-pve
Found initrd image: /boot/initrd.img-5.13.19-6-pve
〜〜〜
Found initrd image: /boot/initrd.img-4.13.13-2-pve
Found linux image: /boot/vmlinuz-4.13.13-1-pve
Found initrd image: /boot/initrd.img-4.13.13-1-pve
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Adding boot menu entry for EFI firmware configuration
done

確認するとPinned kernelが消えていることがわかる

root@hoge:~# proxmox-boot-tool kernel list
Manually selected kernels:
None.

Automatically selected kernels:
5.13.19-6-pve
5.15.30-2-pve

おまけ

一度だけバージョンを変更するオプションもある
proxmox-boot-tool kernel pin バージョン --next-boot

root@hoge:~# proxmox-boot-tool kernel pin 5.13.19-6-pve --next-boot
Setting '5.13.19-6-pve' as grub default entry and running update-grub.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.30-2-pve
Found initrd image: /boot/initrd.img-5.15.30-2-pve
Found linux image: /boot/vmlinuz-5.13.19-6-pve
Found initrd image: /boot/initrd.img-5.13.19-6-pve
Found linux image: /boot/vmlinuz-5.13.19-4-pve
〜〜〜
Found initrd image: /boot/initrd.img-4.13.13-4-pve
Found linux image: /boot/vmlinuz-4.13.13-3-pve
Found initrd image: /boot/initrd.img-4.13.13-3-pve
Found linux image: /boot/vmlinuz-4.13.13-2-pve
Found initrd image: /boot/initrd.img-4.13.13-2-pve
Found linux image: /boot/vmlinuz-4.13.13-1-pve
Found initrd image: /boot/initrd.img-4.13.13-1-pve
Found memtest86+ image: /boot/memtest86+.bin
Found memtest86+ multiboot image: /boot/memtest86+_multiboot.bin
Adding boot menu entry for EFI firmware configuration
done
Pinned for next boot only.

再起動後、バージョンが変更されその後はまた最新のバージョンに戻る

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2