ubuntu 10.04 grub2 启动菜单问题

哈尔滨理工大学软件工程专业08-7李万鹏原创作品,转载请标明出处

http://blog.csdn.net/woshixingaaa/archive/2010/06/05/5649990.aspx


首先是启动菜单被隐藏,需要修改三个地方 这三处的timeout改为同一值

1.sudo gedit /boot/grub.cfg

下面有一段 默认 timeout为0改为大于0

### BEGIN /etc/grub.d/30_os-prober ###
if [ ${timeout} != -1 ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
### END /etc/grub.d/30_os-prober ###

2.sudo gedit /etc/default/grub
GRUB_HIDDEN_TIMEOUT=0 把这里改成大于0

3.sudo gedit /etc/grub.d/30_os-prober

找到这一段 timeout默认是0 改为大于0

if [ /${timeout} != -1 ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep$verbose --interruptible 3 ; then
      set timeout=0
    fi
  fi


然后是如果先装ubuntu在装xp,会出现启动菜单没有xp,无法进入xp只能进入ubuntu的现象

解决方法:修改grub.cfg 增加这么一段

menuentry "Windows XP (on /dev/sda2)" {
insmod ntfs
set root=(hd0,2)
search --no-floppy --fs-uuid --set B2CC3F5FCC3F1CD3  ##这一段是UUID
chainloader +1
}


set root=(hd0,2) 是根据你分区的实际情况定 使用命令 ls -al /dev/disk/by-uuid 查看分区uuid


root@hacker:~# ls -al /dev/disk/by-uuid
总计 0
drwxr-xr-x 2 root root 200 2010-09-05 13:55 .
drwxr-xr-x 6 root root 120 2010-09-05 13:55 ..
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 0f2db613-5cb3-470e-b5c2-b3d606fa6f9d -> ../../sda1
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 2310-19D9 -> ../../sdb4
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 4C844B34844B2036 -> ../../sda2
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 569C428E9C426897 -> ../../sdc1
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 7A48AE6148AE1BBF -> ../../sdc4
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 C82C96682C965174 -> ../../sdc3
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 E22884D02884A55F -> ../../sdc2
lrwxrwxrwx 1 root root  10 2010-09-05 13:55 E4F8247EF824515A -> ../../sda3


我的xp在sd2分区 所以使用sd2的uuid 保存重启就可以了



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值