家里ubuntu和windows共用,ubuntu每次更新都会多两个grub选项,能不能把过去的给删了?

为当前最终发行版之前的所有版本提供支持
回复
lidong
帖子: 2
注册时间: 2011-01-01 11:45
送出感谢: 0
接收感谢: 0

家里ubuntu和windows共用,ubuntu每次更新都会多两个grub选项,能不能把过去的给删了?

#1

帖子 lidong » 2011-03-05 9:45

下面是grub.cfg里的东西(我想问问红色的部分是不是可以删了):

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
if [ -s $prefix/grubenv ]; then
set have_grubenv=true
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi

function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}

function recordfail {
set recordfail=1
if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
}

function load_video {
insmod vbe
insmod vga
}

insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode=640x480
load_video
insmod gfxterm
fi
terminal_output gfxterm
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
set locale_dir=($root)/boot/grub/locale
set lang=zh
insmod gettext
if [ "${recordfail}" = 1 ]; then
set timeout=-1
else
set timeout=10
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/05_debian_theme ###
set menu_color_normal=white/black
set menu_color_highlight=black/light-gray
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Ubuntu, with Linux 2.6.35-27-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=416fc806-b17c-484e-bc09-fc59fc2af667 ro quiet splash
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-27-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
echo 'Loading Linux 2.6.35-27-generic ...'
linux /boot/vmlinuz-2.6.35-27-generic root=UUID=416fc806-b17c-484e-bc09-fc59fc2af667 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-27-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-25-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=416fc806-b17c-484e-bc09-fc59fc2af667 ro quiet splash
initrd /boot/initrd.img-2.6.35-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-25-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
echo 'Loading Linux 2.6.35-25-generic ...'
linux /boot/vmlinuz-2.6.35-25-generic root=UUID=416fc806-b17c-484e-bc09-fc59fc2af667 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-25-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=416fc806-b17c-484e-bc09-fc59fc2af667 ro quiet splash
initrd /boot/initrd.img-2.6.35-22-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-22-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=416fc806-b17c-484e-bc09-fc59fc2af667 ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-22-generic
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod part_msdos
insmod ext2
set root='(hd0,msdos7)'
search --no-floppy --fs-uuid --set 416fc806-b17c-484e-bc09-fc59fc2af667
linux16 /boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
insmod part_msdos
insmod fat
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 8021-d3f7
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
hukof10th
帖子: 83
注册时间: 2011-01-21 10:42
送出感谢: 0
接收感谢: 0

Re: 家里ubuntu和windows共用,ubuntu每次更新都会多两个grub选项,能不能把过去的给删了?

#2

帖子 hukof10th » 2011-03-05 10:12

我记得有个命令是可以清除旧内核的,你可以上wiki看看
天使ッ翼
帖子: 679
注册时间: 2010-06-19 11:44
送出感谢: 2 次
接收感谢: 0

Re: 家里ubuntu和windows共用,ubuntu每次更新都会多两个grub选项,能不能把过去的给删了?

#3

帖子 天使ッ翼 » 2011-03-05 10:37

不用删,你在menuentry前加上#注释掉就可以了
我的就是保留了两个引导项而已,并且改名为Linux和windows
默认选择windows
头像
edwardsli
帖子: 115
注册时间: 2009-09-02 11:49
送出感谢: 1 次
接收感谢: 0

Re: 家里ubuntu和windows共用,ubuntu每次更新都会多两个grub选项,能不能把过去的给删了?

#4

帖子 edwardsli » 2011-03-05 10:47

新立得里面把旧的内核删除一个,自动更新启动选项的。
回复

回到 “老旧版本支持”