求教:安装玩ubuntu10.10后,原第一分区xp由grub启动不了

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
xrj_2001
帖子: 5
注册时间: 2008-12-12 21:56
送出感谢: 0
接收感谢: 0

求教:安装玩ubuntu10.10后,原第一分区xp由grub启动不了

#1

帖子 xrj_2001 » 2011-01-25 12:51

前几天在原xp系统之外又安装了ubutun10.10,利用的是空闲分区,装好后发现ubuntu正常登录,xp登录不了了,网上找了很多方法,试过没什么用。请大家帮忙看看,谢谢!
menu.lst在c盘,内容如下:
title Ubuntu

root (hd0,5)

kernel /vmlinuz-2.6.35-22-generic root=/dev/sda6 ro quiet splash

initrd /initrd.img-2.6.35-22-generic

quiet



### END DEBIAN AUTOMAGIC KERNELS LIST 引导xp

title Ubuntu 10.10

root (hd0,5)

kernel /boot/vmlinuz-2.6.35-22-generic root=UUID=a9b8e510-fbf7-4b32-95e4-42f816738ad3 ro quiet splash

initrd /boot/initrd.img-2.6.35-22-generic



### END DEBIAN AUTOMAGIC KERNELS LIST 引导xp

title Other operating systems:

root

title Microsoft Windows XP Professional

root (hd0,0)

savedefault

chainloader +1

/boot/grub/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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
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-24-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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
linux /boot/vmlinuz-2.6.35-24-generic root=UUID=5a9cb6fb-e888-469f-bac7-884dd4ee8f2a ro quiet splash
initrd /boot/initrd.img-2.6.35-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.35-24-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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
echo 'Loading Linux 2.6.35-24-generic ...'
linux /boot/vmlinuz-2.6.35-24-generic root=UUID=5a9cb6fb-e888-469f-bac7-884dd4ee8f2a ro single
echo 'Loading initial ramdisk ...'
initrd /boot/initrd.img-2.6.35-24-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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=5a9cb6fb-e888-469f-bac7-884dd4ee8f2a 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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
echo 'Loading Linux 2.6.35-22-generic ...'
linux /boot/vmlinuz-2.6.35-22-generic root=UUID=5a9cb6fb-e888-469f-bac7-884dd4ee8f2a 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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
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 5a9cb6fb-e888-469f-bac7-884dd4ee8f2a
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 part_msdos
insmod ntfs
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 860c58060c57efa3
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 ###
头像
onshoestring
论坛版主
帖子: 4666
注册时间: 2009-09-06 5:53
送出感谢: 0
接收感谢: 108 次

Re: 求教:安装玩ubuntu10.10后,原第一分区xp由grub启动不了

#2

帖子 onshoestring » 2011-01-25 12:58

sudo gedit /etc/grub.d/40_custom加入如下内容:
menuentry "Grub for Dos" {
search --set -f /grub.exe
linux /grub.exe
}

代码: 全选

sudo update-grub
下载grub4dos, http://nufans.net/grub4dos/current_release/grub4dos-0.4.4-2009-10-16.zip,把grub4dos文件grub.exe复制一份到c:\

c:\建立一menu.lst文件(原来的menu.lst没用,删除)内容如下。
default 0
timeout 0
title Windows
chainloader /ntldr
boot
xrj_2001
帖子: 5
注册时间: 2008-12-12 21:56
送出感谢: 0
接收感谢: 0

Re: 求教:安装玩ubuntu10.10后,原第一分区xp由grub启动不了

#3

帖子 xrj_2001 » 2011-01-26 14:31

多谢楼上这位仁兄,可以了,先前是怎么回事呢?我是按照网上的教程做的啊?
头像
onshoestring
论坛版主
帖子: 4666
注册时间: 2009-09-06 5:53
送出感谢: 0
接收感谢: 108 次

Re: 求教:安装玩ubuntu10.10后,原第一分区xp由grub启动不了

#4

帖子 onshoestring » 2011-01-26 14:44

grub2错装到xp分区引导扇区(sda1第一扇区)。
想彻底修正,做:
1.

代码: 全选

sudo grub-install /dev/sda
2.用xp安装光盘启动,在恢复控制台,Fixboot。
或者win7光盘 \boot\bootsect /nt52
或者 bootice(无忧启动论坛)
xrj_2001
帖子: 5
注册时间: 2008-12-12 21:56
送出感谢: 0
接收感谢: 0

Re: 求教:安装玩ubuntu10.10后,原第一分区xp由grub启动不了

#5

帖子 xrj_2001 » 2011-01-27 16:09

哦,谢谢指教!
回复

回到 “启动和引导”