bug-parted
[Top][All Lists]
Advanced

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

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


From: Patrick J. LoPresti
Subject: Re: a (late) question concerning the CHS disaster ...
Date: 03 Dec 2004 16:07:42 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Sven Luther <address@hidden> writes:

> > If you later install Windows, you will encounter problems.  This is
> > why I took an interest in this stuff in the first place (see
> > http://unattended.sourceforge.net/).
> 
> Bah, ...

Yeah, "it's Windows's fault".  But Microsoft is not exactly responsive
to bug reports, and some of us have to live with their products, doing
what we can to ease the pain.

> >   1) Move disk between machines
> > 
> >   2) parted /dev/hda
> > 
> >   3) mklabel msdos
> 
> You erased the whole disk, so anything you have done in the previous
> machine is forgotten and you don't need to care about it.

Right, the problem is that the new machine's BIOS might use a
different geometry than the old machine.

> >   4) mkpart ...
> > 
> > What geometry will/should Parted use?
> 
> Anything parted thinks is sane. Preferably something windows will be
> happy with, if we can find such a geometry, but as such a geometry
> seems to be non-deterministic in general ...

Actually, it is completely deterministic and rather straightforward.
The geometry returned by the legacy INT13/AH=08 BIOS interface always
works for booting Windows.

The only hard part is accessing that geometry from a protected mode
OS.  The Linux EDD module makes it accessible, but you have to figure
out which BIOS drive number corresponds to the disk you are
partitioning.  This is easy in the common case of one or two drives,
but it gets tricky fast with many drives on many interfaces.

> > My code is in Perl, invoking the parted binary with the "-s" switch.
> > I read /sys/firmware/edd/int13_dev80/legacy_* to figure out the
> > geometry to use.  I write to /proc/ide/hda/settings to convince the
> > kernel to return that geometry for HDIO_GETGEO.  I wipe the partition
> > table in a separate step so that Parted will actually use that
> > geometry instead of guessing.
> 
> I don't understand, there is this nice libparted library, so why in
> hell are you calling the parted binary directly?

Because my code is in Perl?

> I believe there is even a perl binding for libparted.

Interesting.  If it is current for Parted 1.6.19 and reasonably
well-maintained, I will consider it...

> > And it works.  But it is so messy...  And the Linux folks are
> > threatening to remove HDIO_GETGEO.
> 
> Yeah, well, nothing i can do about this ...

I apologize if I sounded like I was yelling at you.

 - Pat




reply via email to

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