移动硬盘里9.10升级10.4后winsows无法启动 grub如何重装到移动硬盘???

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

移动硬盘里9.10升级10.4后winsows无法启动 grub如何重装到移动硬盘???

#1

帖子 xianfengLu » 2010-05-03 10:17

新的10.4出来了,看到别人都成功升级我也试了一下,昨晚成功升级,虽然启动慢了点也还是不错,本来我的 ubuntu9.10是装在移动硬盘里的gurb也是装在移动硬盘里的,现在升级后grub自动装在了主机硬盘上,不插移动硬盘就不能用了,而且用移动硬盘启动后只能进入ubuntu10.4主机里的windows xp 却进不了用sudo update-grub 后:



root@Lulu-Linux-ubuntu9:/home/lulu# sudo update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-22-generic
Found initrd image: /boot/initrd.img-2.6.32-22-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Microsoft Windows XP Professional on /dev/sda1
done
root@Lulu-Linux-ubuntu9:/home/lulu#


也可以成功找到windows xp 但是重启选择启动windows xp时,主机硬盘灯闪两下就黒屏了只有光标在闪。
同时我移动硬盘里还装有 win pe 在ubuntu9.10下也是可以正常启动,,,现在也不可以启动,选择启动winpe项就会自动重启主机,,,,,,,


高手指教啊,,,,我想把grub重装到移动硬盘里,,要怎样做????、

如何才能正常启动windows xp  ???/???????









我的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
}
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 226c7d07-e01c-449d-9c73-0b62f59713c7
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
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 226c7d07-e01c-449d-9c73-0b62f59713c7
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,Linux 2.6.32-22-generic' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 226c7d07-e01c-449d-9c73-0b62f59713c7
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=226c7d07-e01c-449d-9c73-0b62f59713c7 ro quiet splash
initrd /boot/initrd.img-2.6.32-22-generic
}
menuentry 'Ubuntu,Linux 2.6.32-22-generic (恢复模式)' --class ubuntu --class gnu-linux --class gnu --class os {
recordfail
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 226c7d07-e01c-449d-9c73-0b62f59713c7
echo '载入 Linux ...'
linux /boot/vmlinuz-2.6.32-22-generic root=UUID=226c7d07-e01c-449d-9c73-0b62f59713c7 ro single
echo '载入引导虚拟磁盘 ...'
initrd /boot/initrd.img-2.6.32-22-generic
}
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_memtest86+ ###
menuentry "Memory test (memtest86+)" {
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 226c7d07-e01c-449d-9c73-0b62f59713c7
linux16 /boot/memtest86+.bin
}
menuentry "Memory test (memtest86+, serial console 115200)" {
insmod ext2
set root='(hd1,3)'
search --no-floppy --fs-uuid --set 226c7d07-e01c-449d-9c73-0b62f59713c7
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 72287c71287c35e7
drivemap -s (hd0) ${root}
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###

menuentry "Windows PE (loader) (on /dev/sdb1)" {
insmod fat
set root=(hd1,1)
search --no-floppy --fs-uuid --set 004E-DC0A
chainloader +1
}
# 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 ###



-------------------------------------------------------------------------------------------------------------------




我的 40_custom

--------------------------------------------

#!/bin/sh
exec tail -n +3 $0

menuentry "Windows PE (loader) (on /dev/sdb1)" {
insmod fat
set root=(hd1,1)
search --no-floppy --fs-uuid --set 004E-DC0A
chainloader +1
}
# 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.

----------------------------------------------------

30_os-prober
-----------------------------
#! /bin/sh -e

# grub-mkconfig helper script.
# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GRUB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GRUB. If not, see <http://www.gnu.org/licenses/>.

prefix=/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

. ${libdir}/grub/grub-mkconfig_lib

found_other_os=

adjust_timeout () {
if [ "x${found_other_os}" = "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then
if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
verbose=
else
verbose=" --verbose"
fi

if [ "x${GRUB_HIDDEN_TIMEOUT}" = "x0" ] ; then
cat <<EOF
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
fi
EOF
else
cat << EOF
if [ \${timeout} != -1 ]; then
if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
set timeout=0
fi
fi
EOF
fi
fi
fi
}

if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then
adjust_timeout
exit 0
fi

if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then
# missing os-prober and/or linux-boot-prober
adjust_timeout
exit 0
fi

OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`"
if [ -z "${OSPROBED}" ] ; then
# empty os-prober output, nothing doing
adjust_timeout
exit 0
fi

osx_entry() {
cat << EOF
menuentry "${LONGNAME} (${2}-bit) (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
cat << EOF
insmod ${GRUB_VIDEO_BACKEND}
set do_resume=0
if [ /var/vm/sleepimage -nt10 / ]; then
if xnu_resume /var/vm/sleepimage; then
set do_resume=1
fi
fi
if [ \$do_resume == 0 ]; then
xnu_uuid ${OSXUUID} uuid
if [ -f /Extra/DSDT.aml ]; then
acpi -e /Extra/DSDT.aml
fi
$1 /mach_kernel boot-uuid=\${uuid} rd=*uuid
if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then
xnu_mkext /System/Library/Extensions.mkext
else
xnu_kextdir /System/Library/Extensions
fi
if [ -f /Extra/Extensions.mkext ]; then
xnu_mkext /Extra/Extensions.mkext
fi
if [ -d /Extra/Extensions ]; then
xnu_kextdir /Extra/Extensions
fi
if [ -f /Extra/devprop.bin ]; then
xnu_devprop_load /Extra/devprop.bin
fi
if [ -f /Extra/splash.jpg ]; then
insmod jpeg
xnu_splash /Extra/splash.jpg
fi
if [ -f /Extra/splash.png ]; then
insmod png
xnu_splash /Extra/splash.png
fi
if [ -f /Extra/splash.tga ]; then
insmod tga
xnu_splash /Extra/splash.tga
fi
fi
}
EOF
}

for OS in ${OSPROBED} ; do
DEVICE="`echo ${OS} | cut -d ':' -f 1`"
LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`"
LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`"
BOOT="`echo ${OS} | cut -d ':' -f 4`"

if [ -z "${LONGNAME}" ] ; then
LONGNAME="${LABEL}"
fi

echo "Found ${LONGNAME} on ${DEVICE}" >&2
found_other_os=1

case ${BOOT} in
chain)

cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"

case ${LONGNAME} in
Windows\ Vista*|Windows\ 7*)
;;
*)
cat << EOF
drivemap -s (hd0) \${root}
EOF
;;
esac

cat <<EOF
chainloader +1
}
EOF
;;
linux)
LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`"
prepare_boot_cache=

for LINUX in ${LINUXPROBED} ; do
LROOT="`echo ${LINUX} | cut -d ':' -f 1`"
LBOOT="`echo ${LINUX} | cut -d ':' -f 2`"
LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`"
LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`"
LINITRD="`echo ${LINUX} | cut -d ':' -f 5`"
LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`"

if [ -z "${LLABEL}" ] ; then
LLABEL="${LONGNAME}"
fi

if [ "${LROOT}" != "${LBOOT}" ]; then
LKERNEL="${LKERNEL#/boot}"
LINITRD="${LINITRD#/boot}"
fi

cat << EOF
menuentry "${LLABEL} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
if [ -z "${prepare_boot_cache}" ]; then
prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | sed -e "s/^/\t/")"
fi
printf '%s\n' "${prepare_boot_cache}"
cat << EOF
linux ${LKERNEL} ${LPARAMS}
EOF
if [ -n "${LINITRD}" ] ; then
cat << EOF
initrd ${LINITRD}
EOF
fi
cat << EOF
}
EOF
done
;;
macosx)
OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`"
osx_entry xnu_kernel 32
osx_entry xnu_kernel64 64
;;
hurd)
cat << EOF
menuentry "${LONGNAME} (on ${DEVICE})" {
EOF
save_default_entry | sed -e "s/^/\t/"
prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/"
grub_device="`${grub_probe} --device ${DEVICE} --target=drive`"
mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`"
grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`"
case "${grub_fs}" in
*fs) hurd_fs="${grub_fs}" ;;
*) hurd_fs="${grub_fs}fs" ;;
esac
cat << EOF
multiboot /boot/gnumach.gz root=device:${mach_device}
module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\
--multiboot-command-line='\${kernel-command-line}' \\
--host-priv-port='\${host-port}' \\
--device-master-port='\${device-port}' \\
--exec-server-task='\${exec-task}' -T typed '\${root}' \\
'\$(task-create)' '\$(task-resume)'
module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)'
}
EOF
;;
*)
echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2
;;
esac
done

adjust_timeout :em20
---------------------------------------------






总计 0
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 004E-DC0A -> ../../sdb1
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 00942D4A942D438E -> ../../sda6
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 226c7d07-e01c-449d-9c73-0b62f59713c7 -> ../../sdb3
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 363C74483C740561 -> ../../sdb2
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 72287C71287C35E7 -> ../../sda1
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 C2702CAF702CAC5B -> ../../sda3
lrwxrwxrwx 1 root root 10 2010-05-03 08:49 D0A0E3EEA0E3D8CC -> ../../sda5
root@Lulu-Linux-ubuntu9:/home/lulu#
回复