分页: 1 / 1

我电脑二个硬盘,XP和U各占一个(非wubi),为什么拔掉XP的盘UBUNTU就启动不了?(解决)

发表于 : 2009-10-17 22:07
suckmyball
RT,UBUNTU是完全安装的,独占第二个硬盘,UBUNTU正常,没什么问题,问题是我拔掉XP的盘,就启动不了。连选择操作系统的GRUB都进不去。


我看了下ubuntu硬盘boot目录下有GRUP文件夹,下面是menu.lst的内容:
# 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 10

## 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=a13fd3a4-7540-464c-8dce-7475fe20846c ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=a13fd3a4-7540-464c-8dce-7475fe20846c

## 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 ##

title Ubuntu 9.04, kernel 2.6.28-15-generic
uuid a13fd3a4-7540-464c-8dce-7475fe20846c
kernel /boot/vmlinuz-2.6.28-15-generic root=UUID=a13fd3a4-7540-464c-8dce-7475fe20846c ro quiet splash
initrd /boot/initrd.img-2.6.28-15-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-15-generic (recovery mode)
uuid a13fd3a4-7540-464c-8dce-7475fe20846c
kernel /boot/vmlinuz-2.6.28-15-generic root=UUID=a13fd3a4-7540-464c-8dce-7475fe20846c ro single
initrd /boot/initrd.img-2.6.28-15-generic

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid a13fd3a4-7540-464c-8dce-7475fe20846c
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=a13fd3a4-7540-464c-8dce-7475fe20846c 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 a13fd3a4-7540-464c-8dce-7475fe20846c
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=a13fd3a4-7540-464c-8dce-7475fe20846c ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid a13fd3a4-7540-464c-8dce-7475fe20846c
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:08
suckmyball
如何解决?能不能去XP盘里把C盘下的那几个引导文件复制过来?

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:10
pityonline
wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:14
jxhow
可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
赞同

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:17
suckmyball
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:24
pityonline
suckmyball 写了:
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。
不好意思,这个我忘了,请用论坛搜索,或等高手回答。

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:45
jxhow
suckmyball 写了:
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。
如果现在就在Ubuntu下:
此时进入终端,进行以下步骤:
sudo su
grub
find /boot/grub/stage1 这时会显示(hdX,Y)
root (hdX,Y) 其实就是安装ubuntu的分区
setup (hd0) 此处的(hd0)请根据情况修改。一般如果要安装到MBR就用(hd0)。
quit
如果进不了Ubuntu 想办法进去 或者liveCD

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 22:53
suckmyball
JXHOW 写了:
suckmyball 写了:
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。
如果现在就在Ubuntu下:
此时进入终端,进行以下步骤:
sudo su
grub
find /boot/grub/stage1 这时会显示(hdX,Y)
root (hdX,Y) 其实就是安装ubuntu的分区
setup (hd0) 此处的(hd0)请根据情况修改。一般如果要安装到MBR就用(hd0)。
quit
如果进不了Ubuntu 想办法进去 或者liveCD
不行啊,
grub> find /boot/grub/stage1
(hd1,0)

grub> setup (hd1)

Error 12: Invalid device requested

grub> setup (hd1,0)

Error 12: Invalid device requested

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 23:00
pityonline
suckmyball 写了:
JXHOW 写了:
suckmyball 写了:
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。
如果现在就在Ubuntu下:
此时进入终端,进行以下步骤:
sudo su
grub
find /boot/grub/stage1 这时会显示(hdX,Y)
root (hdX,Y) 其实就是安装ubuntu的分区
setup (hd0) 此处的(hd0)请根据情况修改。一般如果要安装到MBR就用(hd0)。
quit
如果进不了Ubuntu 想办法进去 或者liveCD
不行啊,
grub> find /boot/grub/stage1
(hd1,0)

grub> setup (hd1)

Error 12: Invalid device requested

grub> setup (hd1,0)

Error 12: Invalid device requested
你现在有两个硬盘是吧?一个是XP,另一个是ubuntu,那么你应该有hd0和hd1,在grub里看到你把ubuntu装在hd1了,你应该把grub转移到hd0上。你要把两个硬盘都接上,然后把setup(hd1)改为setup(hd0),这样试试。

有点儿乱,你先用sudo fdisk -l看一下你的分区表,看看linux在哪个硬盘,就把grub装到哪个硬盘。

Re: 我电脑二个硬盘,XP和U各占一个(非wubi),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 23:22
suckmyball
看到的是这样的。
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3211 25792326 7 HPFS/NTFS
/dev/sda2 3212 8917 45833445 f W95 Ext'd (LBA)
/dev/sda5 3212 6014 22515066 7 HPFS/NTFS
/dev/sda6 6015 8817 22515066 7 HPFS/NTFS
/dev/sda7 8818 8916 795186 7 HPFS/NTFS

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7e041353

Device Boot Start End Blocks Id System
/dev/sdb1 1 9327 74919096 83 Linux
/dev/sdb2 9328 9729 3229065 f W95 Ext'd (LBA)
/dev/sdb5 9328 9729 3229033+ 82 Linux swap / Solaris
root@slingshot-desktop:/home/slingshot#

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 23:23
suckmyball
pityonline 写了:
suckmyball 写了:
JXHOW 写了:
suckmyball 写了:
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。
如果现在就在Ubuntu下:
此时进入终端,进行以下步骤:
sudo su
grub
find /boot/grub/stage1 这时会显示(hdX,Y)
root (hdX,Y) 其实就是安装ubuntu的分区
setup (hd0) 此处的(hd0)请根据情况修改。一般如果要安装到MBR就用(hd0)。
quit
如果进不了Ubuntu 想办法进去 或者liveCD
不行啊,
grub> find /boot/grub/stage1
(hd1,0)

grub> setup (hd1)

Error 12: Invalid device requested

grub> setup (hd1,0)

Error 12: Invalid device requested
你现在有两个硬盘是吧?一个是XP,另一个是ubuntu,那么你应该有hd0和hd1,在grub里看到你把ubuntu装在hd1了,你应该把grub转移到hd0上。你要把两个硬盘都接上,然后把setup(hd1)改为setup(hd0),这样试试。

有点儿乱,你先用sudo fdisk -l看一下你的分区表,看看linux在哪个硬盘,就把grub装到哪个硬盘。
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3211 25792326 7 HPFS/NTFS
/dev/sda2 3212 8917 45833445 f W95 Ext'd (LBA)
/dev/sda5 3212 6014 22515066 7 HPFS/NTFS
/dev/sda6 6015 8817 22515066 7 HPFS/NTFS
/dev/sda7 8818 8916 795186 7 HPFS/NTFS

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7e041353

Device Boot Start End Blocks Id System
/dev/sdb1 1 9327 74919096 83 Linux
/dev/sdb2 9328 9729 3229065 f W95 Ext'd (LBA)
/dev/sdb5 9328 9729 3229033+ 82 Linux swap / Solaris
root@slingshot-desktop:/home/slingshot#


我觉得我的UBUNTU已装了GRUB了。

Re: 我电脑二个硬盘,XP和U各占一个(非wubi),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 23:25
wangdu2002
用grub4dos也行的。。。grldr会自已找menu.lst。只接一块硬盘时要改Menu.lst,或用UUID来识别分区。
viewtopic.php?f=139&t=150541#grub4dos简介和使用方法
http://download.gna.org/grub4dos/#下载gru ... 版本0.4.4正式版

sudo ./bootlace.com /dev/sda --no-backup-mbr#把grub4dos的迷你引导代码写入第一块硬盘sda的命令。dos下,bootlace.com 0x80的作用一样,第二块硬盘用0x81。

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-17 23:36
pityonline
suckmyball 写了:
pityonline 写了:
suckmyball 写了:
JXHOW 写了:
suckmyball 写了:
pityonline 写了:wubi安装的与硬盘安装的不清楚,如果是光盘安装的,可能是把grub安装到了xp所在的硬盘了,只要在ubuntu下把grub安装到ubuntu所在的硬盘就可以了。
能详细点说明怎么装GRUB吗?谢谢。
如果现在就在Ubuntu下:
此时进入终端,进行以下步骤:
sudo su
grub
find /boot/grub/stage1 这时会显示(hdX,Y)
root (hdX,Y) 其实就是安装ubuntu的分区
setup (hd0) 此处的(hd0)请根据情况修改。一般如果要安装到MBR就用(hd0)。
quit
如果进不了Ubuntu 想办法进去 或者liveCD
不行啊,
grub> find /boot/grub/stage1
(hd1,0)

grub> setup (hd1)

Error 12: Invalid device requested

grub> setup (hd1,0)

Error 12: Invalid device requested
你现在有两个硬盘是吧?一个是XP,另一个是ubuntu,那么你应该有hd0和hd1,在grub里看到你把ubuntu装在hd1了,你应该把grub转移到hd0上。你要把两个硬盘都接上,然后把setup(hd1)改为setup(hd0),这样试试。

有点儿乱,你先用sudo fdisk -l看一下你的分区表,看看linux在哪个硬盘,就把grub装到哪个硬盘。
Device Boot Start End Blocks Id System
/dev/sda1 * 1 3211 25792326 7 HPFS/NTFS
/dev/sda2 3212 8917 45833445 f W95 Ext'd (LBA)
/dev/sda5 3212 6014 22515066 7 HPFS/NTFS
/dev/sda6 6015 8817 22515066 7 HPFS/NTFS
/dev/sda7 8818 8916 795186 7 HPFS/NTFS

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7e041353

Device Boot Start End Blocks Id System
/dev/sdb1 1 9327 74919096 83 Linux
/dev/sdb2 9328 9729 3229065 f W95 Ext'd (LBA)
/dev/sdb5 9328 9729 3229033+ 82 Linux swap / Solaris
root@slingshot-desktop:/home/slingshot#


我觉得我的UBUNTU已装了GRUB了。
你的ubuntu当然已经装了grub了,只是安装位置的问题。
按照这个做试试:

代码: 全选

sudo su 
grub 
find /boot/grub/stage1         
root (hd1,0)                      
setup (hd1)                      
quit

Re: 我电脑二个硬盘,XP和U各占一个(XP是先装的),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-18 0:40
suckmyball
我觉得我的UBUNTU已装了GRUB了。[/quote]
你的ubuntu当然已经装了grub了,只是安装位置的问题。
按照这个做试试:

代码: 全选

sudo su 
grub 
find /boot/grub/stage1         
root (hd1,0)                      
setup (hd1)                      
quit
[/quote]


多谢兄台,解决了,
是不是因为我装UBUNTU的时候把GRUB装到另一个硬盘去了>?

Re: 我电脑二个硬盘,XP和U各占一个(非wubi),为什么拔掉XP的盘UBUNTU就启动不了?

发表于 : 2009-10-18 1:04
linsfly
wangdu2002 写了:用grub4dos也行的。。。grldr会自已找menu.lst。只接一块硬盘时要改Menu.lst,或用UUID来识别分区。
viewtopic.php?f=139&t=150541#grub4dos简介和使用方法
http://download.gna.org/grub4dos/#下载gru ... 版本0.4.4正式版

sudo ./bootlace.com /dev/sda --no-backup-mbr#把grub4dos的迷你引导代码写入第一块硬盘sda的命令。dos下,bootlace.com 0x80的作用一样,第二块硬盘用0x81。
学习了。