分页: 1 / 1

懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-06 20:41
hormos
一切都源于acronis OS selector,开机无法F6跳过,进不了系统,deactivate Acronis OS Selector选项显示只能从floopy启动,
然后悲剧开始了
我的硬盘c盘30GB,装的i是win7,D盘User,win下面的软件、游戏,音乐,文档l都在这里面,还有一个E盘
我先用光盘安装XP到e盘,利用acronis的重新安装卸载掉了acronis OS selector ,
本打算在XP下修复引导win7,可是这次装的XP才坏,上不去网,
于是我又装了kubuntu9.10,使用的是E盘的空间,XP被格式化了,联网,升级到了10.04
grub 版本1.96
我想用grub引导C盘的windows7,
sudo update-grub显示如下

代码: 全选

head: 无法打开"/boot/grub/video.lst" 读取数据: 没有那个文件或目录
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-24-generic
Found initrd image: /boot/initrd.img-2.6.32-24-generic
Found linux image: /boot/vmlinuz-2.6.31-5-generic
Found initrd image: /boot/initrd.img-2.6.31-5-generic
Found memtest86+ image: /memtest86+.bin
ls: cannot access /var/lib/os-prober/mount/Boot
boot: No such file or directory
Found Windows NT/2000/XP on /dev/sda1
done
sda1就是c盘,估计是xp的引导信息写在了c盘,而系统本身却在e盘挂掉了

开机时grub菜单选这个根本无法进系统,啥都没有,黑屏
下面的代码是boot-grub-grub.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 $prefix/grubenv ]; then
  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
}
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.32-24-generic' --class ubuntu --class gnu-linux --class gnu --class os {
	recordfail
	insmod ext2
	set root='(hd0,6)'
	search --no-floppy --fs-uuid --set 0261b26c-e580-4907-8012-99cc01e6d282
	linux	/vmlinuz-2.6.32-24-generic root=UUID=bf23de72-82f3-4b43-b83a-b7fc3a406f57 ro   quiet splash
	initrd	/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.32-24-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
	recordfail
	insmod ext2
	set root='(hd0,6)'
	search --no-floppy --fs-uuid --set 0261b26c-e580-4907-8012-99cc01e6d282
	echo	'Loading Linux 2.6.32-24-generic ...'
	linux	/vmlinuz-2.6.32-24-generic root=UUID=bf23de72-82f3-4b43-b83a-b7fc3a406f57 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.32-24-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-5-generic' --class ubuntu --class gnu-linux --class gnu --class os {
	recordfail
	insmod ext2
	set root='(hd0,6)'
	search --no-floppy --fs-uuid --set 0261b26c-e580-4907-8012-99cc01e6d282
	linux	/vmlinuz-2.6.31-5-generic root=UUID=bf23de72-82f3-4b43-b83a-b7fc3a406f57 ro   quiet splash
	initrd	/initrd.img-2.6.31-5-generic
}
menuentry 'Ubuntu, with Linux 2.6.31-5-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os {
	recordfail
	insmod ext2
	set root='(hd0,6)'
	search --no-floppy --fs-uuid --set 0261b26c-e580-4907-8012-99cc01e6d282
	echo	'Loading Linux 2.6.31-5-generic ...'
	linux	/vmlinuz-2.6.31-5-generic root=UUID=bf23de72-82f3-4b43-b83a-b7fc3a406f57 ro single 
	echo	'Loading initial ramdisk ...'
	initrd	/initrd.img-2.6.31-5-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
	insmod ext2
	set root='(hd0,6)'
	search --no-floppy --fs-uuid --set 0261b26c-e580-4907-8012-99cc01e6d282
	linux16	/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
	insmod ext2
	set root='(hd0,6)'
	search --no-floppy --fs-uuid --set 0261b26c-e580-4907-8012-99cc01e6d282
	linux16	/memtest86+.bin console=ttyS0,115200n8
}
### END /etc/grub.d/20_memtest86+ ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Windows NT/2000/XP (on /dev/sda1)" {
	insmod ntfs
	set root='(hd0,1)'
	search --no-floppy --fs-uuid --set a402e6e702e6be04
	drivemap -s (hd0) ${root}
	chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/30_otheros ###

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
menuentry "Windows Vista (loader)" {
	set root=(hd0,1)
	search --no-floppy --fs-uuid --set a402e6e702e6be04
	chainloader +1
}
### END /etc/grub.d/30_otheros ###

### 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 ###
我想用grub引导c盘中的windows7,可我不知道怎样写grub.cfg,有关C盘和其他分区的信息都在下面的图片中,请请懂的帮忙写一个,
哎,若我当初不是装XP而是直接装kubuntu也就不会这么麻烦了,可是我估计这样那个acronis OS selector 就没法卸载了吧
HELP ME PLEASE

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-06 21:32
jxhow
我用menu.lst的 这个grub.cfg不熟悉

1、自己看Grub2基础教程、慢慢摸索在http://forum.ubuntu.org.cn/viewtopic.php?f=139&t=229387

2、等人贴出那些代码

3、找win7的启动盘 修复引导,在修复ubuntu的引导 绕圈子啊 :em06


不知道XP有没有改C盘下的东西

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-06 22:05
slax
我电脑上的:

代码: 全选

menuentry "Windows Seven" {
	insmod ntfs
	set root='(hd0,4)'
	chainloader +1
}
祝你好运!!

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-07 6:35
billbear
装 xp 的时候 c 盘的引导扇区被改成 xp 的了
xp 的引导扇区寻找 ntldr
win7 的引导扇区寻找 bootmgr
你可以把 c 盘下的 ntldr 删掉,然后把 bootmgr 改名为 ntldr 以欺骗 xp 的引导扇区
如果可以进 win7,再重写 c 盘的引导扇区为 win7 格式,并把假的 ntldr 改回 bootmgr

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-07 9:58
hormos
谢谢 4 楼 billbear的方法 我成功使用Windows NT/2000/XP on /dev/sda1的方法进入了windows7,系统自动修复之后就成功进入win7系统了

问题1.现在我想知道怎么
重写 c 盘的引导扇区为 win7 格式,并把假的 ntldr 改回 bootmgr
需要把ntldr删除吗还是改名字 ?
现在机器启动时用的还是ubuntu的grub1.96,我的两个系统(win7+kubuntu9.10)都可以正常使用

问题2,如果我想使用windows7的启动管理器来作为主引导该怎么实现?
还能不能检测到kubuntu呢?

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-07 14:27
billbear
1. 你可以维持现状不改,如果要改的话:
你需要 win7 安装盘里的 bootsect.exe 来重写引导扇区,它好像在光盘的 boot 目录下

代码: 全选

bootsect /nt60 c:
然后把 ntldr 改回 bootmgr

2.

代码: 全选

bootsect /mbr
可以恢复 win7 的 mbr
然后看这个
viewtopic.php?f=139&t=245472&start=0

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-07 20:48
hormos
6 楼 billbear 我能找得到bootsect.exe这个文件
我该怎么用它呢 ?直接在命令提示符里面出入命令吗?出现的提示好像是失败啊
我重启之后还是grub引导的,进入kubuntu之后sudo update-grub显示

代码: 全选

head: 无法打开"/boot/grub/video.lst" 读取数据: 没有那个文件或目录
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-24-generic
Found initrd image: /boot/initrd.img-2.6.32-24-generic
Found linux image: /boot/vmlinuz-2.6.31-5-generic
Found initrd image: /boot/initrd.img-2.6.31-5-generic
Found memtest86+ image: /memtest86+.bin
ls: cannot access /media/Windows/Boot
boot: No such file or directory
Found Windows NT/2000/XP on /dev/sda1
done
按照4楼地方法选择Windows NT/2000/XP on /dev/sda1可以进入windows7
希望详细点,thx

Re: 懂的进来,如何用grub引导另一块分区中的windows7 ?Troublesome

发表于 : 2010-08-08 13:25
Firedrake
提权,windows 7要用管理员权限运行cmd。