grub修复的问题

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

grub修复的问题

#1

帖子 hsklyh » 2009-07-28 19:42

机子160G的硬盘,删掉了一个分区e盘来安装新氧ubuntu,从硬盘安装的,直接安到了e盘里,安好后grub只引导ubuntu了,用光盘进到xp里看了下,原来的f g盘变e f盘了,搞得原来迅雷下的东西都找不到路径了,这我先不管了,因为我光盘是番茄花园的,没有修复功能,只有引导进xp的功能,想安个一键ghost奥运版修复下mbr 可是重启还是只引导进ubuntu,连一键ghost的面都见不到,具体情况具体分析,我该怎么修复到即能引导xp,又不影响ubuntu,本人比较菜,希望详细点,谢谢了,给个详细点的链接也行,呵呵
头像
smallapple
论坛版主
帖子: 7868
注册时间: 2009-03-28 15:12

Re: grub修复的问题

#2

帖子 smallapple » 2009-07-28 20:21

billbear
帖子: 3681
注册时间: 2008-05-03 23:42

Re: grub修复的问题

#3

帖子 billbear » 2009-07-28 20:27

硬盘安装时把 iso 放在了 c 盘会使 安装程序 把 c 盘认作光驱,从而不会自动为 c 盘里的操作系统添加启动项。下次要避免把 iso 放在 c 盘,可以放在 d 盘或其他非启动分区。
现在手动添加启动项:
进入 ubuntu,打开终端输入
sudo -i
输入密码回车,(输入不会回显),接着
echo title windows >> /boot/grub/menu.lst
echo "chainloader (hd0,0)+1" >> /boot/grub/menu.lst
sed -i "s/^hiddenmenu/#hiddenmenu/" /boot/grub/menu.lst
重启。
hsklyh
帖子: 63
注册时间: 2008-07-13 10:27

Re: grub修复的问题

#4

帖子 hsklyh » 2009-07-29 9:17

我晕了,我在ubuntu下把grub覆盖了(在xp的c盘根目录下),然后用光盘进了xp,让他下点东西,设置的定时关机,今天起来一看,又进不了ubuntu了,用grub引导(原来用于安装ubuntu的),试图进ubuntu,出错了,错误提示忘了记下来了,等下再进去看看是什么提示
hsklyh
帖子: 63
注册时间: 2008-07-13 10:27

Re: grub修复的问题

#5

帖子 hsklyh » 2009-07-29 14:25

按照2楼发的链接,的确能解决拉
可是我想让xp默认为第一位的启动顺序(不是我一个人用的电脑,别人还要用,别到时候又说怎么进不了xp),该怎么设置?是把他加到最前面么?

uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
splashimage=/boot/grub/splash.xpm.gz

title Windows XP
root (hd0,0)
makeactive
chainloader +1

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=45374ba8-fcde-4f5b-b772-be89ad20454b ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=45374ba8-fcde-4f5b-b772-be89ad20454b ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
kernel /boot/memtest86+.bin
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: grub修复的问题

#6

帖子 leeaman » 2009-07-29 14:29

最好是改default x=你的xp的数字
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
hsklyh
帖子: 63
注册时间: 2008-07-13 10:27

Re: grub修复的问题

#7

帖子 hsklyh » 2009-07-29 14:49

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=45374ba8-fcde-4f5b-b772-be89ad20454b ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=45374ba8-fcde-4f5b-b772-be89ad20454b

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
splashimage=/boot/grub/splash.xpm.gz

title Windows XP
root (hd0,0)
makeactive
chainloader +1

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=45374ba8-fcde-4f5b-b772-be89ad20454b ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=45374ba8-fcde-4f5b-b772-be89ad20454b ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid 45374ba8-fcde-4f5b-b772-be89ad20454b
kernel /boot/memtest86+.bin
quiet



### END DEBIAN AUTOMAGIC KERNELS LIST







这是我的menu.lst
该改哪里,谢谢
我暂时把title Windows XP
root (hd0,0)
makeactive
chainloader +1
放到了前面
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: grub修复的问题

#8

帖子 leeaman » 2009-07-29 14:51

现在应该不用改就可以了吧
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
hsklyh
帖子: 63
注册时间: 2008-07-13 10:27

Re: grub修复的问题

#9

帖子 hsklyh » 2009-07-29 14:55

可以拉么,我怕到时候又两个系统都进不了阿
又要用光盘修复,很麻烦的,一次性解决它
头像
leeaman
帖子: 30702
注册时间: 2007-02-02 18:14
系统: debian sid

Re: grub修复的问题

#10

帖子 leeaman » 2009-07-29 14:56

只是修改menu.lst改错也不用重装啊
醉了星星,醉月亮●●●●●The Long Way To Go(*^_^*)
hsklyh
帖子: 63
注册时间: 2008-07-13 10:27

Re: grub修复的问题

#11

帖子 hsklyh » 2009-07-29 14:58

不是重装阿,我是怕引导又出问题,又要修复引导
hsklyh
帖子: 63
注册时间: 2008-07-13 10:27

Re: grub修复的问题

#12

帖子 hsklyh » 2009-07-29 15:04

OK搞定! :em06
回复