gaosuu 发表于 2007-1-29 20:35

Ubuntu6.1 移到第二硬盘适配器无法启动

电脑: Thinkpad T23
配置:P3-1.333G/512M/100+40G/14'/WIFI
操作:100G主盘,装Windows2003,工作机;
40G硬盘,装WindowsXP。将40G硬盘放在主盘位置,用PQ适当分区,留最后10G左右未分配空间。用光驱引导,安装Ubuntu6.1, 安装成功. 然后恢复Windows,可实现双系统引导。

问题:将40G 硬盘放进Ultrabay2000硬盘适配器,装在Ultrabay位置,设置该硬盘为第一引导顺序。但Ubuntu无法进入系统;图形界面到滚动条位置即停止不动,硬盘无响应;Recorvery Mode到检测USB鼠标加载驱动之后就不动了,光标闪烁。但该硬盘的WindowsXP可以顺利引导。

如果将该硬盘放回主硬盘位置,又可顺利引导。

请教:各位高手,如果解决该问题。

gaosuu 发表于 2007-1-29 20:37

大致搜了一下,似乎是6.1加入了UUID技术。

但,

从何处下手?请大家指教。

syhan 发表于 2007-1-30 00:03

没事过,检查一下/etc/fstab

fishmanchina 发表于 2007-1-31 09:36

I got exactly the same problem with what you described. Anyone have some ideas?

shiyg2001 发表于 2007-1-31 21:58

我也遇到过,这样解决:
http://forum.ubuntu.org.cn/viewtopic.php?t=36813&highlight=

自然平衡 发表于 2007-1-31 22:59

硬盘在系统中的标识跟该硬盘所插的接口的位置相关,硬盘在主盘位置时在系统中的标识是/dev/hda,移到Ultrabay位置时应该变成/dev/hdc。

修改/boot/grub/device.map添加下面一行:
(hd3)        /dev/hdc

修改/boot/grub/menu.lst:
把"(hd0"替换成"(hd3";
把"root=/dev/hda"替换成"root=/dev/hdc";

/etc/fstab中应该不用修改了,6.10默认是根据分区的UUID标识来挂载相应分区的,UUID不会随硬盘的位置而改变。

gaosuu 发表于 2007-2-1 12:06

谢谢楼上的两位,我试下~

Ubuntu论坛那边真实太冷清了~

shiyg2001 发表于 2007-2-1 14:14

改成hd3不行的。

我的device.map:

                            (hd0)        /dev/hdc

我的menu.lst:(只需要把root=/dev/hda3,改成root=/dev/hdc3)
# 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 change this entry to 'saved' 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=/dev/hdc3 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

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

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(recovery mode) 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

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

## ## End Default Options ##

title                Ubuntu, kernel 2.6.15-27-686
root                (hd0,0)
kernel                /vmlinuz-2.6.15-27-686 root=/dev/hdc3 ro quiet splash
initrd                /initrd.img-2.6.15-27-686
savedefault
boot

title                Ubuntu, kernel 2.6.15-27-686 (recovery mode)
root                (hd0,0)
kernel                /vmlinuz-2.6.15-27-686 root=/dev/hdc3 ro single
initrd                /initrd.img-2.6.15-27-686
boot

title                Ubuntu, kernel 2.6.15-27-386
root                (hd0,0)
kernel                /vmlinuz-2.6.15-27-386 root=/dev/hdc3 ro quiet splash
initrd                /initrd.img-2.6.15-27-386
savedefault
boot

title                Ubuntu, kernel 2.6.15-27-386 (recovery mode)
root                (hd0,0)
kernel                /vmlinuz-2.6.15-27-386 root=/dev/hdc3 ro single
initrd                /initrd.img-2.6.15-27-386
boot

title                Ubuntu, kernel 2.6.15-26-386
root                (hd0,0)
kernel                /vmlinuz-2.6.15-26-386 root=/dev/hdc3 ro quiet splash
initrd                /initrd.img-2.6.15-26-386
savedefault
boot

title                Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root                (hd0,0)
kernel                /vmlinuz-2.6.15-26-386 root=/dev/hdc3 ro single
initrd                /initrd.img-2.6.15-26-386
boot

title                Ubuntu, memtest86+
root                (hd0,0)
kernel                /memtest86+.bin
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

我的fatab:这个也要改
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type><options>       <dump><pass>
proc            /proc         proc    defaults      0       0
/dev/hdc3       /               ext3    defaults,errors=remount-ro 0       1
/dev/hdc1       /boot         ext3    defaults      0       2
/dev/hdc5       /home         reiserfs defaults      0       2
/dev/hdc6       /media/windowsvfat    defaults,utf8,umask=000,gid=46 0       0
/dev/hdc2       none            swap    sw            0       0
#/dev/hdc      /media/cdrom0   udf,iso9660 user,noauto,iocharset=utf8   0       0
/dev/fd0      /media/floppy0auto    rw,user,noauto0       0
/dev/hda1        /media/hdc1        ntfs        defaults,nls=utf8,umask=0222,gid=46        0        0
/dev/hda5        /media/hdc5        ntfs        defaults,nls=utf8,umask=0222,gid=46        0        0
/dev/hda6        /media/hdc6        ntfs        defaults,nls=utf8,umask=0222,gid=46        0        0
//10.105.24.88/pub /home/shiyg/pub smbfs credentials=/home/shiyg/.smbcredentials 0 0

但是,很奇怪:必须把主硬盘拔下才可以顺利地用slim硬盘启动ubuntu6.0.6,可是,我原先刚修改后都可以同时插上主硬盘和slim硬盘,再用slim硬盘启动的,现在不行了。我估计是bios里boot设备的顺序问题,但怎么也没有搞好。

3133233 发表于 2007-2-1 15:28

装6.06的时候碰到过类似问题,后来吧XP放在SLIM上了。

gaosuu 发表于 2007-2-1 19:58

原帖由 shiyg2001 于 2007-2-1 14:14 发表
改成hd3不行的。

我的device.map:

                            (hd0)        /dev/hdc

我的menu.lst:(只需要把root=/dev/hda3,改成root=/dev/hdc3)
# menu.lst - See: grub(8), info grub, update-grub(8) ...

谢谢。
改了看看能不能行。

Linux的东西是有些麻烦。FreeBSD也是这样的情况啊。郁闷ing。

gaosuu 发表于 2007-2-3 10:25

按8楼的改了。

系统崩溃。2003也进不去了。

gaosuu 发表于 2007-2-5 11:58

问题最终解决:
在Ultrabay2000的硬盘里硬盘安装Ubuntu,此类安装说明文件不胜枚举。但要注意一点:
引导文件对应相应的光盘ISO。

我用的是桌面版ISO,与Lice CD相同,在桌面点击Install即可。
另外还需注意的是:
最后一布(6/6),Grub安装位置,要改为HDC。否则主硬盘和第二硬盘作为一个整体被GRUB接管,如果拿开第二硬盘,则无法启动主硬盘的Windows系统。需要重新修复主硬盘的MBR。 用DOS引导盘启动到DOS,Fdisk /mbr即可修复。

附我的文件,大家遇此问题可酌情修改:

我的device.map:
(hd0)      /dev/hdc

我的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 change this entry to 'saved' 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=637ab1bc-abf0-43eb-840b-1bb3c55eaeac ro
# kopt_2_6=root=/dev/hdc5 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,4)

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

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

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

## ## End Default Options ##

title                Ubuntu, kernel 2.6.17-10-generic
root                (hd0,4)
kernel                /boot/vmlinuz-2.6.17-10-generic root=/dev/hdc5 ro quiet splash
initrd                /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title                Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root                (hd0,4)
kernel                /boot/vmlinuz-2.6.17-10-generic root=/dev/hdc5 ro single
initrd                /boot/initrd.img-2.6.17-10-generic
boot

title                Ubuntu, memtest86+
root                (hd0,4)
kernel                /boot/memtest86+.bin
quiet
boot

### 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/hdc1
title                Windows NT/2000/XP
root                (hd0,0)
savedefault
makeactive
chainloader      +1

thinkpad_x40 发表于 2007-2-5 14:25

是的,grub要安装到hdc而非hda。
因为这个case里面,linux在hdc,boot区也在hdc。

而grub的stage_1在hda的0面0道1扇区,它将引导start.S(0面0道2扇区).
然后这个512字节的start.S再去引导stage_1.5,这玩意被放在0面0道3扇区及其以后的大概10k多扇区里。
这个stage_1.5是用来支撑文件系统的,执行之后grub才能认识所谓的分区格式(ext2,ext3,fat...etc)
至于stage_2,就可以作为文件放在文件系统里,位置可以随意了,只要stage_1.5能找到它。

问题是如果把hdc拔除掉,那么也许连stage2都无法找到了,更不用说menu.lst了(这个要是找不到,至少stage_2这个mini OS还能提供一个简单的shell接口,不会彻底down掉).

所以,并不是如gao版所说:“主硬盘和第二硬盘作为一个整体被GRUB接管”,而是grub的stage_1.5没法找到hdc上的stage_2(/boot/grub/),自然连windows都进不去了。


这就是一些grub的简单内幕。如果了解一点的话,就不会在安装时发昏了。

[ 本帖最后由 thinkpad_x40 于 2007-2-5 14:30 编辑 ]

wolf2 发表于 2007-2-7 02:01

楼上解释的相当精彩。。。收藏了。

yourfrishen 发表于 2007-2-7 13:04

13楼高手,继续学习了

dnastar 发表于 2007-3-4 10:55

很奇怪,我的menu.lst只要修改Kernel那一行就可以了。参见我原来的问题:

http://www.linuxsir.org/bbs/showthread.php?t=293920

当然我装的是纯ubuntu,没其他的系统。

gulch 发表于 2007-3-5 01:57

这些技巧比较高深,慢慢学习一下

kiff 发表于 2007-3-14 15:31

我的T40也碰到这样的问题啊~!~~回家研究一下啊~

夜雨灯 发表于 2007-6-21 22:33

T4也可以么?
页: [1]
查看完整版本: Ubuntu6.1 移到第二硬盘适配器无法启动