LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 933|回复: 5

多内核启动菜单问题 [已解决]

[复制链接]
发表于 2006-3-24 10:01:01 | 显示全部楼层 |阅读模式
大家好,我用的是sles 9 默认内核是2.6.5-7,我现在新装了一个rpm包的新内核,直接用rpm -ivh 新内核进行安装,安装后只能进入新内核,我想问的是,sles装新内核的时候能不能实现和redhat linux那样的多个内核启动可选菜单?怎样实现?thanks~
 楼主| 发表于 2006-3-24 11:31:56 | 显示全部楼层
up,大家帮帮忙呀
我现在只能进入新的内核,无法进入原来的内核系统
menu.list内容如下:n04:~ # cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Thu Feb 23 14:39:13 2006


color white/blue black/light-gray
default 0
timeout 3
gfxmenu (hd0,1)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title Linux
    kernel (hd0,1)/boot/vmlinuz root=/dev/sda2 selinux=0 splash=silent resume=/dev/sda1 elevator=cfq showopts
    initrd (hd0,1)/boot/initrd

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    root (fd0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe
    kernel (hd0,1)/boot/vmlinuz root=/dev/sda2 showopts ide=nodma apm=off acpi=off vga=normal noresume selinux=0 barrier=off nosmp noapic maxcpus=0  3
    initrd (hd0,1)/boot/initrd
grub.conf内容如下:n04:~ # cat /etc/grub.conf
root (hd0,1)
install --stage2=/boot/grub/stage2 /boot/grub/stage1 d (hd0) /boot/grub/stage2 0x8000 (hd0,1)/boot/grub/menu.lst
quit
新内核版本如下:n04:~ # uname -a
Linux n04 2.6.5-7.244_lustre.1.4.6bigsmp #1 SMP Sun Feb 19 00:02:24 EST 2006 i686 i686 i386 GNU/Linux


请问该如何修改?
回复 支持 反对

使用道具 举报

发表于 2006-3-24 12:27:59 | 显示全部楼层
直接替换肯定不能进入原内核
原来内核/boot下的文件被替换了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-24 13:28:57 | 显示全部楼层
在/boot下,原来的内核的vmlinuz和initrd文件都还在,我将/boot/grub/menu.lst
文件中这部分
###Don't change this comment - YaST2 identifier: Original name: linux###
title Linux
    kernel (hd0,1)/boot/vmlinuz root=/dev/sda2 selinux=0 splash=0 resume=/dev/sda1 elevator=cfq showopts
    initrd (hd0,1)/boot/initrd

改成了原来内核的initrd和vmlinuz,可以进入原来的内核了,但是如果想切换内核,每次都要修改/boot/grub/menu.lst文件太麻烦了,能不能弄成像redhat linux那样的多重内核选择菜单,想进入哪个内核就选择就行了,不知道能不能实现,哪位朋友做过?
回复 支持 反对

使用道具 举报

发表于 2006-3-24 14:53:05 | 显示全部楼层
那你在menu.lst加个title不就行了?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-3-24 15:19:11 | 显示全部楼层
谢谢楼上的朋友,问题已解决,需在/boot/grub/menu.lst中新加入一个title ,然后指定新内核的initrd和vmlinuz文件即可,以下是我的menu.lst内容:
n04:~ # cat /boot/grub/menu.lst
# Modified by YaST2. Last modification on Thu Feb 23 14:39:13 2006


color white/blue black/light-gray
default 0
timeout 3
gfxmenu (hd0,1)/boot/message

###Don't change this comment - YaST2 identifier: Original name: linux###
title Linux-2.6.5-7.97-smp
    kernel (hd0,1)/boot/vmlinuz-2.6.5-7.97-smp root=/dev/sda2 selinux=0 splash=silent resume=/dev/sda1 elevator=cfq showopts
    initrd (hd0,1)/boot/initrd-2.6.5-7.97-smp

title Linux-2.6.5-7.244_lustre.1.4.6bigsmp
    kernel (hd0,1)/boot/vmlinuz-2.6.5-7.244_lustre.1.4.6bigsmp root=/dev/sda2 selinux=0 splash=silent resume=/dev/sda1 elevator=cfq showopts
    initrd (hd0,1)/boot/initrd-2.6.5-7.244_lustre.1.4.6bigsmp

###Don't change this comment - YaST2 identifier: Original name: floppy###
title Floppy
    root (fd0)
    chainloader +1

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe
    kernel (hd0,1)/boot/vmlinuz root=/dev/sda2 showopts ide=nodma apm=off acpi=off vga=normal noresume selinux=0 barrier=off nosmp noapic maxcpus=0  3
    initrd (hd0,1)/boot/initrd
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表