[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: a (late) question concerning the CHS disaster ...

From: Andrew Clausen
Subject: Re: a (late) question concerning the CHS disaster ...
Date: Sat, 4 Dec 2004 08:35:18 +1100
User-agent: Mutt/1.5.6+20040722i

On Fri, Dec 03, 2004 at 12:19:43PM +0100, Sven Luther wrote:
> Not that i care all that much myself, because i use a sane partition
> table format :), but i wonder why we didn't use the method of getting
> the CHS data from the previously written partition table, which
> supposedly worked before ? 

Firstly, Parted has always attempted to infer CHS geometry from the
partition table if the geometry it got from the kernel was wrong.
It just wasn't very sophisticated about it, and situation (2) below caused
it to fail.

There are several problems that you need to deal with when you try
to infer CHS geometry from the partition table:
 (1) Sometimes, partition tables are inconsistent.  That is, some
partitions were created with one particular CHS geometry in mind,
while others were created with a different CHS geometry.

 (2) If partitions go past 1022 cylinders, then there is not enough CHS
information to deduce the CHS geometry used to write partition.  A
complicating factor is that Norton Ghost doesn't write the partition
tables properly, so this case is hard to tell.  (We are currently
using heuristics that could get false negatives - i.e. some weird
Norton partitions might cause an error message, but these should be
very rare).

 (3) As Patrick said, it doesn't work for blank disks.

Parted also looks inside file systems to try to figure out the
geometry.  However, Parted mostly takes a local view of geometry:
even though there is One True Geometry (namely, what the BIOS says),
because Parted can't reliably access this information, it takes
a subjective view, and treats each partition as having a separate
geometry.  If it can't get the geometry out of the partition table,
it will look inside the partition's file system.

This caused a lot of debate: both me and Patrick believe that this
approach is bizarre, because geometry need not be subjective.  Parted
should be able to confidently say "this geometry is wrong, and I will
fix it".  The subjective approach certainly requires a lot more code!

To be honest, I don't think there is any good reason to not use EDD, and
scrap the whole subjective approach thing.  Clearly, my view is
different to Szaka's and the linux-kernel people.  Most people prefer
minimalist changes to partition tables rather than correct changes.  I
implemented the change to live in harmony with this view - not for any
technically sound (IMHO) reason.

There is no reason why we couldn't supplement the subjective approach
with EDD, however.  There are some minor issues though: EDD often isn't
loaded, so Parted might have to ask users to load it.  Also,
if there are multiple disks, it is difficult to match up the BIOS
drives with the physical drives.  That is what Matt Domsch's patch
was about.

Summary: I agree with Patrick, but follow the herd.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]