10.04的grub不支持“从上次启动”了么?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
猎户座
帖子: 155
注册时间: 2008-08-27 14:57
来自: ShanghHai__UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug
联系:

10.04的grub不支持“从上次启动”了么?

#1

帖子 猎户座 » 2010-05-16 22:05

9.10的时候是9.10+win7双系统,刚装完当然grub默认是ubuntu9.10了,第二次我从win7启动,第三次进grub发现win7是默认启动项,非常人性化~~~它记住了我上次启动项!

装了10.04就没有这个功能了,网上搜了下9.10的时候有个grub default=saved
但是10.04的gurb厘米那没有这个选项,咋办啊?自己写进去这句?

PS:win7被我研究winsxs搞坏了,重装了,grub依然能用,无需update,太强大了
头像
onshoestring
论坛版主
帖子: 4666
注册时间: 2009-09-06 5:53

Re: 10.04的grub不支持“从上次启动”了么?

#2

帖子 onshoestring » 2010-05-16 22:31

1、首先看下 /etc/default/grub,先从应用程序-附件里打开终端,输入
sudo gedit /etc/default/grub
用户密码
看看打开的文件可作什么修改:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=0 -------->设置默认启动项,按menuentry顺序。比如要默认从第四个菜单项启动,数字改为3,若改为 saved,则默认为上次启动项。
头像
猎户座
帖子: 155
注册时间: 2008-08-27 14:57
来自: ShanghHai__UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug
联系:

Re: 10.04的grub不支持“从上次启动”了么?

#3

帖子 猎户座 » 2010-05-17 9:10

onshoestring 写了:
1、首先看下 /etc/default/grub,先从应用程序-附件里打开终端,输入
sudo gedit /etc/default/grub
用户密码
看看打开的文件可作什么修改:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=0 -------->设置默认启动项,按menuentry顺序。比如要默认从第四个菜单项启动,数字改为3,若改为 saved,则默认为上次启动项。

无效

PS:update过了,就是不行
头像
猎户座
帖子: 155
注册时间: 2008-08-27 14:57
来自: ShanghHai__UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug
联系:

Re: 10.04的grub不支持“从上次启动”了么?

#4

帖子 猎户座 » 2010-05-18 9:31

need help!!

谁9.10的,把gurb.cfg发上来看看
头像
peteryeh64
论坛版主
帖子: 9386
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: 10.04的grub不支持“从上次启动”了么?

#5

帖子 peteryeh64 » 2010-05-18 11:10

猎户座 写了:need help!!

谁9.10的,把gurb.cfg发上来看看

代码: 全选

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

### BEGIN /etc/grub.d/00_header ###
if [ -s /boot/grub/grubenv ]; then
  have_grubenv=true
  load_env
fi
set default="0"
if [ ${prev_saved_entry} ]; then
  saved_entry=${prev_saved_entry}
  save_env saved_entry
  prev_saved_entry=
  save_env prev_saved_entry
fi
insmod ext2
set root=(hd0,7)
search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
if loadfont /usr/share/grub/unicode.pf2 ; then
  set gfxmode=640x480
  insmod gfxterm
  insmod vbe
  if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
  fi
fi
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/white
### END /etc/grub.d/05_debian_theme ###

### BEGIN /etc/grub.d/10_linux ###
menuentry "Ubuntu, Linux 2.6.31-21-generic" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-21-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-21-generic
}
menuentry "Ubuntu, Linux 2.6.31-21-generic (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-21-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro single 
	initrd	/boot/initrd.img-2.6.31-21-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-20-generic (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-20-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro single 
	initrd	/boot/initrd.img-2.6.31-20-generic
}
menuentry "Ubuntu, Linux 2.6.31-19-generic" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-19-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-19-generic (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-19-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro single 
	initrd	/boot/initrd.img-2.6.31-19-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	set quiet=1
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro   quiet splash
	initrd	/boot/initrd.img-2.6.31-14-generic
}
menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
        recordfail=1
        if [ -n ${have_grubenv} ]; then save_env recordfail; fi
	insmod ext2
	set root=(hd0,7)
	search --no-floppy --fs-uuid --set 64eb1bd2-21a4-400e-996e-443e38dd6962
	linux	/boot/vmlinuz-2.6.31-14-generic root=UUID=64eb1bd2-21a4-400e-996e-443e38dd6962 ro single 
	initrd	/boot/initrd.img-2.6.31-14-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
	linux16	/boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
	linux16	/boot/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Professional (on /dev/sda1)" {
	insmod ntfs
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set 52a01bd2a01bbc03
	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 ###
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
头像
猎户座
帖子: 155
注册时间: 2008-08-27 14:57
来自: ShanghHai__UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug
联系:

Re: 10.04的grub不支持“从上次启动”了么?

#6

帖子 猎户座 » 2010-05-18 15:01

楼上哥,把set_default=saved试试,看能不能记住上次启动?
头像
peteryeh64
论坛版主
帖子: 9386
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: 10.04的grub不支持“从上次启动”了么?

#7

帖子 peteryeh64 » 2010-05-18 18:12

猎户座 写了:楼上哥,把set_default=saved试试,看能不能记住上次启动?
DO NOT EDIT THIS FILE....這個檔案grub.cfg一開頭就說明...不要改動... :em20
附件
無法儲存
無法儲存
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
头像
peteryeh64
论坛版主
帖子: 9386
注册时间: 2008-12-20 15:43
系统: 家kubuntu20.04
来自: 心靈深處

Re: 10.04的grub不支持“从上次启动”了么?

#8

帖子 peteryeh64 » 2010-05-18 19:02

onshoestring 写了:
1、首先看下 /etc/default/grub,先从应用程序-附件里打开终端,输入
sudo gedit /etc/default/grub
用户密码
看看打开的文件可作什么修改:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
GRUB_DEFAULT=0 -------->设置默认启动项,按menuentry顺序。比如要默认从第四个菜单项启动,数字改为3,若改为 saved,则默认为上次启动项。
經本人測試,此法可行...光標會停留在上次啟動項...ok(測試環境ubuntu9.10)
附件
screenshot_002.jpeg
screenshot_003.jpeg
修改完 /etc/default/grub之後必須執行<br />sudo update-grub以完成設定
修改完 /etc/default/grub之後必須執行
sudo update-grub以完成設定
[论坛版主行为规定]+[PITIVI簡易教程]+[ubuntu裝迅雷]
[releases.ubuntu.com]+[cdimage.ubuntu.com]+[old-releases.ubuntu.com]
[學ubuntu必須拜讀懶蝸牛"笨兔兔的故事"=viewtopic.php?f=112&t=162040][Linux明日的希望在中國]
头像
猎户座
帖子: 155
注册时间: 2008-08-27 14:57
来自: ShanghHai__UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug_UIbug
联系:

Re: 10.04的grub不支持“从上次启动”了么?

#9

帖子 猎户座 » 2010-05-19 19:50

我日啊,为什么我不行啊,我之前9.10也是这样可以的,换了10.04就不行了,我日啊 :em20
回复