ga('set', 'anonymizeIp', 1);
Categories: 运维

LINODE的KVM架构LINUX更换内核

之前测试LINODE的日本机子,新机房已经是采用了KVM架构。更换内核的方法和老机房XEN更换内核方法有所不同。

  • 安装Grub
    安装过程中可能会询问安装位置,不需要安装到MBR

Arch Linux

pacman -S linux grub

CentOS 7

yum install kernel grub2

Debian

apt-get install linux-image-amd64 grub2

Fedora 22

dnf install kernel-core grub2

Ubuntu

apt-get install linux-image-virtual grub2

Gentoo

echo "GRUB_PLATFORMS=\"coreboot pc\"" >> /etc/portage/make.conf
emerge --ask sys-boot/grub sys-kernel/gentoo-sources genkernel
eselect kernel list
eselect kernel set [# of new kernel]
zcat /proc/config.gz > /usr/src/linux/.config
genkernel --oldconfig all
  • 配置Grub

编辑/etc/default/grub,修改以下项目:

GRUB_TIMEOUT=10
GRUB_CMDLINE_LINUX="console=ttyS0,19200n8"
GRUB_DISABLE_LINUX_UUID=true
GRUB_SERIAL_COMMAND="serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1"
GRUB_TERMINAL=serial

更新bootloader,更新内核后需要再一次运行该命令来更新GRUB目录,默认为列表第一个内核启动:

Arch Linux

grub-mkconfig -o /boot/grub/grub.cfg

Debian 8 & Ubuntu 15.04

update-grub

CentOS 7

mkdir /boot/grub
grub2-mkconfig -o /boot/grub/grub.cfg

Fedora 22 - Replace with the current kernel version

dracut /boot/initrd-4.0.5-300.fc22.x86_64.img 4.0.5-300.fc22.x86_64 
mkdir /boot/grub
grub2-mkconfig -o /boot/grub/grub.cfg

Gentoo

mkdir /boot/grub
grub2-mkconfig -o /boot/grub/grub.cfg
  • 重启到Grub2 模式

在LINODE面板选择编辑你的配置文件

Boot Settings选项的Kernel列表里选择GRUB 2

Save Changes保存,重启机子后就可以按通常方式更换发行版内核了。
启动中可能会出现以下错误,可以忽略。

error: file `/boot/grub/i386-pc/all_video.mod' not found.
Loading Linux linux ...
Loading initial ramdisk ...

Press any key to continue...
madlaxcb

View Comments

Recent Posts

解决WIN10显示器重启后分辨率变低窗口乱跳问题

  最近换了显示器,当有事离开…

2月 ago

宝塔开启堡塔防入侵会导致Chevereto的Cron运行失败

昨晚给服务器搬迁,新服务器装了…

7月 ago

chevereto V3和V4的改造

今天有空升级了cheveret…

11月 ago

win11开启bbr2

powershell: net…

1年 ago

OVH使用API安装发行版内核的系统(关于API,IPXE,RAID等)

OVH的新面板提供的系统模板比…

1年 ago