QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 805|回复: 6

【求助】分区出现的问题,求教!!!

[复制链接]
发表于 2004-11-6 20:38:03 | 显示全部楼层 |阅读模式
问题是这样的:
前几天我买了一个120G的硬盘,我是用linux的fdisk来分区的,但我只分了前面的100G,后面的10G没分(本来是想留给linux的)。
现在我的c盘装了win2000,e盘装了winxp(双硬盘)。
今天我想安装FedoraCore2,于是用linux的fdisk把余下的10G分了两个区,一个是交换分区(hda3),一个是根分区(hda4),由于之前就知道安装FedoraCore2会问题多多,于是我重启电脑看看会不会有什么问题,果然不出所料,当选择winxp时,出现一个提示说是“windows root\system32\hal.dll”损坏而无法进入winxp。但进入win2000则无任何问题。
如果把两个linux的分区删除则又可进入winxp。
请问有什么办法能不删除linux的分区而又可使用winxp?总不成再重新安装一次winxp吧?

另外,如果我安装了FedoraCore2,无论我把grub安装在mbr或根分区,windows是不是都无法正常启动?(除非修改文件)
我看了论坛上的很多文章,是不是安装了FedoraCore2后会把分区表的信息也改了?
发表于 2004-11-6 20:45:47 | 显示全部楼层
这是我以前找到的解决办法,本打算自己安装时用的,但后来每装fc2,所以没派上用场。
       There is a bug in Fedora Core 2 that causes the hard disk geometry as
reported in the partition table to be altered during installation.  This
change may cause Windows boot failure.  Although this bug is severe, it is
recoverable and no data should be lost.  It is important not to panic if and
when this happens so you do not cause further problems or cause actual loss
of data in the process of recovering from the error.

Prevention:

        This bug can be avoided entirely by using some preventative steps while
installing Fedora Core 2.  Thanks go out to Cero ([email protected]) for
discovery and testing of this solution.

        To avoid the hard disk geometry to be altered you may enter it manually
during installation by using the hdN=<drive geometry> parameter (where N is
the letter representing the drive with the MBR you will use).  To discover
the current geometry before installing Fedora Core 2 you should use a
utility that can read the drive geometry as reported in the partition table.
It is important to understand that some tools may not be reporting the
actual data from this location, but, rather, some derived value, so your
surest way is to use the fdisk utility.  You can get this information by
following these steps.

Note: This example will assume you are looking at /dev/hda, which is the
master on the primary IDE interface. If your MBR is located on another
device you should use its name (eg: /dev/hde )

Download and burn the Fedora Core 2 Rescue CD.

Boot from the Rescue CD (there is no need to start networking or mount
drives)

Issue the command: fdisk -l /dev/hda   to print the current partition table
to screen in non-interactive mode.

Write down the drive geometry as reported at the beginning of the output
from fdisk. This is reported as number of Cylinders, Heads, and Sectors
(hence the name CHS).

You can now reboot the computer by simultaneously holding down the keys
Ctrl-Alt-Delete.

You can now boot the Fedora Core 2 installation CD. At the first menu prompt
you should now choose to run the installer with the known geometry.

Example: linux hda=14593,255,63

        The installer should now run normally and not alter your partition table
geometry entry.  If, for any reason, this geometry should be changed
regardless of this preventative step, please use the recovery steps to
correct the geometry of the drive as reported by the partition table.


Recovery:

        You have installed Fedora Core 2 and find that you cannot boot Windows.  
Typically the boot process will terminate with the words

        Rootnoverify(hd0,0)
        Chainloader +1

        These are the boot parameters from your Grub configuration.  The parameters
are likely to be correct, but Windows fails to boot because Fedora Core 2
altered the hard disk geometry as reported by the drives partition table.

IMPORTANT: Do not panic and do not begin using multiple tools in an attempt
to correct this error. Automated tools can be very dangerous. The actual
changes that need to be made are minor and benign.  By running 3rd party
applications to recover a bootable Windows installation may cause you to
lose your data.  You have been warned.

        For those who are technically inclined I include here a brief explanation
of what is going on.  The drive has not been damaged and your partition
table is fine.  The problem is that Windows demands a "sane" CHS table.  
This table has been altered by Fedora Cores installer and Windows hangs.  
Luckily, the actual table, in LBA format, is not  corrupted.  For those
seeing a strange partition table, take note that you are probably looking at
the table in CHS values and these values are derived from the geometry.  The
GNU/Linux operating system does not use these values and operates purely
with LBA values.  Windows should not be using CHS either, but for some
reason it at least checks this geometry and can be prevented from booting by
them being bad.  Changing the drive geometry changes the CHS partition table
because this is a virtualization of the true state of affairs on the drive
which are best described as being mystical.  Think of CHS geometry as a
compass.  If you change the geometry you have recalibrated where the
needles reference point is and you are no longer looking at true north.

        The solution to this problem is very simple, but it may confuse people
because most people will question why they are seeing strange values
reported from their partition table in CHS format.  If you do not trust this
solution or your ability to follow these steps then you should stop and seek
hard disk recovery consulting services.  The Fedora Project is in no way
liable for any data loss and this guide is offered without guarantees.  You
are taking responsibility for what happens.  Now, let us go through the
solution.

        Because only the drive geometry is altered there is no need for manual
intervention in the form of discovering and entry of partition information.  
The information in your partition table is correct.  However, you need to
alter the geometry entry and normally this would require you to re-enter the
partition table by hand using a tool like fdisk.  This is where the
application sfdisk comes to the rescue. Sfdisk can be very powerful in
non-interactive mode, it can output information that can be used as input
elsewhere, and it can accept data as input at run-time.  This makes sfdisk
ideal for this solution because you can ask it to read the partition table
and deliver the result in a way that itself can write back when you tell it
to change your drive geometry.  This makes the process fast and less prone
to human error as very few values need to be supplied.  The solution can be
summed up in a single line with two commands:

        sfdisk -d /dev/hda | sfdisk --no-reread -H255 /dev/hda

        So that the reader may better understand what is going on here, lets go
through what each section does and what the parameters mean.

sfdisk -d /dev/hda

This part runs sfdisk non-interactively and dumps the partition table in a
format that sfdisk can also use for input (as we are doing).  Try this
command by itself to see your partition table as it is very safe.  You will
want to check to check for warnings in the output.  Warnings pose a problem
because they interfere with the use of this data as input. Output containing
a warning may look like the example below:

$ sfdisk -d /dev/hda
Warning: extended partition does not start at a cylinder boundary.
DOS and Linux will interpret the contents differently.
# partition table of /dev/hda
unit: sectors

/dev/hda1 : start=       63, size= 16771797, Id= 7, bootable
/dev/hda2 : start= 16771860, size=217632555, Id= f
/dev/hda3 : start=        0, size=        0, Id= 0
/dev/hda4 : start=        0, size=        0, Id= 0
/dev/hda5 : start= 16771923, size=104856192, Id= 7
/dev/hda6 : start=121628178, size=112776237, Id= 7


For reasons unknown, using the option -- quiet does not suppress all
warnings so it becomes the task of the user to discover a way to still use
the output as input.  The simplest way is to write the output to a plain
text file, editing out the warning in that text file, and using the edited
text file as the input, thus:

sfdisk -d /dev/hda > MyPartitionTable.txt
        editing MyPartitionTable.txt to remove the warnings, saving the edited
text, and
cat MyPartitionTable.txt | sfdisk --no-reread -H255 /dev/hda

The output from "sfdisk -d /dev/hda" should begin like this (this is the
edited version of the example given before):

# partition table of /dev/hda
unit: sectors

/dev/hda1 : start=       63, size= 16771797, Id= 7, bootable
/dev/hda2 : start= 16771860, size=217632555, Id= f
/dev/hda3 : start=        0, size=        0, Id= 0
/dev/hda4 : start=        0, size=        0, Id= 0
/dev/hda5 : start= 16771923, size=104856192, Id= 7
/dev/hda6 : start=121628178, size=112776237, Id= 7

        Note that "cat MyPartitionTable.txt" takes the place of "sfdisk -d
/dev/hda" as these are now equivalent. In this case the warning portion has
been stripped, preserving the needed data used by sfdisk in step two of the
command.

sfdisk --no-reread -H255 /dev/hda

        This portion of the two-part command performs the actual change to your
hard disk.  This main operation is in -H255. This tells sfdisk to write a
head count of 255 into the drive geometry.  This command executed by itself
would ask for user input of the partition table (just like fdisk).  However,
by piping the table we just read in the first command, this is avoided and
work is saved and we know the data is correct (or, at least, unchanged).  
This is why sfdisk is used.

        The --no-reread option allows the command to run even when the disk has a
mounted partition.  Some users may find they need to further force the
operation to complete. This is done by using --force (sfdisk --no-reread
--force -H255 /dev/hda).

        In this example we are only changing the number of heads in the geometry.  
If you know the correct number of cylinders before the Fedora Core
installation changed these values you may also write back this number.   An
example with 14,593 cylinders is provided below.

sfdisk -d /dev/hda | sfdisk --no-reread -H255 -C14593 /dev/hda

        The number of reported sectors (S) should not have changed and remained as
63.

        This is the part most likely to be met with the question "if I change the
number of heads, must I not also change the the number of cylinders?"  The
answer to this question is "no."  When the geometry was changed the number
of heads changed from 255 to 16 and the number of cylinders was increased to
compensate.  As long as the values are large everything should be ok.  Only
the pedantic need worry about changing the number of cylinders manually.  If
you do not know the value from before you are best off not supplying this
number.

        By using this method there is no need, and indeed you should not, run a
program that wipes the MBR (like fdisk /mbr).  Doing so will cause you to
lose the Grub pointer installed in the MBR and you will have to use the
Recovery CD to regain access to your Fedora Core installation.

        Updating Grub after installation seems to have no effect on the drive
geometry as the problem seems strictly limited to the Fedora Core installer.
回复

使用道具 举报

发表于 2004-11-6 20:54:51 | 显示全部楼层
不知道发问的朋友有没有看过这里的精典教程中教安装Fedora Core?
一般的都会有的,只是今天第一次来这,不知道实际的情况。
回复

使用道具 举报

 楼主| 发表于 2004-11-6 20:56:00 | 显示全部楼层
大哥!我英文很菜。能不能简单的把它翻译为中文?实在是万分感谢!
我粗略看了一下,他好象是说安装了FedoraCore2后出现的问题及解决办法,但我的问题是根本就没有安装FedoraCore2,只是在分区后就出现了不能启动的现象。这篇文章好像不大合适!
回复

使用道具 举报

发表于 2004-11-6 21:12:23 | 显示全部楼层
试方式安装在扩展分区而不是主分区看看,也许又是老盖茨的阴谋。
回复

使用道具 举报

发表于 2004-11-6 22:00:39 | 显示全部楼层
[quote:fa4b6b180e="你"]试方式安装在扩展分区而不是主分区看看,也许又是老盖茨的阴谋。[/quote]

多谢!总算搞掂第一个问题,我是用pq重新分区的。现在把两个linux分区都搞到逻辑分区中。
根分区(hda11),交换分区(hda12)。
但第二个问题还弄不明白。期待linux高手的解答。
回复

使用道具 举报

发表于 2004-11-6 22:12:01 | 显示全部楼层
翻译些主要的吧

Fedora Core2存在一个BUG,可以使分区表所显示的硬盘结构在安装过程中被更改。这个变更可以使Windows加载失败。虽然这个BUG很严重,但是它依然是可以重获的,并且没有数据会丢失。如果遇到了这个BUG,你不必害怕,因为不会引起更多的问题,也不会丢失在处理错误过程中的数据。

防止:
这个BUG可以完全被避免,只要在安装Fedora Core2时使用预防性的步骤。非常感谢Cero([email protected])发现并测试了这个解决方案。

为了避免硬盘结构被更改,你可能要在安装过程中手工输入hdN(驱动结构)参数,(其中字母N表示你将要使用MBR的驱动器)。为了在安装Fedora Core2之前发现当前磁盘结构,你需要使用可以从分区表读取驱动器结构的工具。必须了解某些工具不能反映本地磁盘的真实数据,但是,却反映了一些形象化的值,因此最保险的办法是使用fdisk工具。你可以遵照以下步骤获得这些信息。

注意:这个例子是假定你是着眼于/dev/had,即主IDE接口。如果你的MBR挂载在其他的设备上,你需要使用(例如:/dev/hde)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-15 14:47 , Processed in 0.084107 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表