-2

读取内核时,我想在发生错误时读取另一个内核。因为内核编译中的 ssh 远程。grub 选项有可能吗?

title CentOS (3.13.6)
        root (hd0,0)
        kernel /vmlinuz-3.13.6 ro root=/dev/mapper/vg_sizone-lv_root rd_NO_LUKS rd 
_LVM_LV=vg_sizone/lv_root rd_NO_MD crashkernel=auto LANG=ko_KR.UTF-8  KEYBOARDTYPE 
=pc KEYTABLE=ko rd_LVM_LV=vg_sizone/lv_swap rd_NO_DM rhgb quiet
        initrd /initramfs-3.13.6.img
title CentOS (2.6.32-642.6.1.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-642.6.1.el6.x86_64 ro root=/dev/mapper/vg_sizone-lv 
_root rd_NO_LUKS rd_LVM_LV=vg_sizone/lv_root rd_NO_MD crashkernel=auto LANG=ko_KR. 
UTF-8  KEYBOARDTYPE=pc KEYTABLE=ko rd_LVM_LV=vg_sizone/lv_swap rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-642.6.1.el6.x86_64.img

如果 3.13.6 内核崩溃。我要启动 2.6.32

4

3 回答 3

1

This cannot be achieved in all the scenarios; However, if you want to test a new kernel for your server and fall back to old if not working, you can get.

I assume you are booted with your old kernel right now and want to test your newly compiled kernel.
once you have created a menu entry for your new kernel, make sure, You add 'panic=N' to kernel command line parameter; This will ensure a reboot after N seconds (if N is greater than zero) of kernel panic.

Then,

Set currently booted kernel as default:

# grub-set-default <current kernel menuentry number>
# grub-reboot <new kernel menuentry number>

Note here that the menu entry number starts from 0. Then, reboot the system.

# reboot

This will boot into the newly compiled kernel and reboot to old kernel in case there is a kernel panic.

于 2017-10-18T10:26:21.920 回答
-1

总而言之,如果你想启动一个新的 linux,需要注意内核映像、ramdisk 和 linux 驱动程序。

我在您的 grub 配置中没有发现任何问题,您为什么不尝试一下?

于 2017-10-18T02:10:21.147 回答
-2

在前面添加一行:</p>

默认=1


如果 default=0 ,则启动 3.13.6

于 2017-10-18T02:15:29.373 回答