Subject: Re: sysinst partitioning
To: Phil Nelson <phil@steelhead.cs.wwu.edu>
From: Frank van der Linden <frank@wins.uva.nl>
List: tech-install
Date: 03/31/1999 10:45:41
[moved to tech-install]
On Tue, Mar 30, 1999 at 07:01:27PM -0800, Phil Nelson wrote:
> 
> So how are you planning on doing disk partitioning?  This was
> a major problem with the 1.2 and earlier install procedures.
> Now that you can get the BIOS geometry from the bootblocks,
> it should be even much easier to do the partitioning correctly.
> I think this is a change that should be reversed unless you
> are putting in the code directly into sysinst to do the 
> partitioning (which would be a duplication of code.)

I hope you didn't think I was going to leave sysinst unable to partition..
It can do MBR partitioning just fine now.

fdisk was used for 3 things in sysinst:

	1) get the BIOS geometry
	2) read the MBR
	3) write the MBR

1) was based on a heuristic that failed often, and didn't work at all
if you didn't have a partition already installed. Furthermore, on
the i386, there is a much better way available now. I put some
code in there to do that heuristic still for ports that want to
do that; the i386 port only uses that as a last resort if it
can't find the information in another way. Which should rarely
happen. And even then, it's only used as a hint to the user.
The heuristic failing was the source of the most common i386
install problem, so I'm glad that it's gone.

2) isn't hard to do: you read in one sector and convert some
fields to the native data format (an MBR is all in LE).

3) see above, but reversed.

For 2) and 3), using fdisk was only cumbersome, and error-prone.
I.e. for writing, it called fdisk for every single partition to set
it. It's not exactly hard and a lot of code to just write it.

In other words, there is hardly any code duplication. Only the
geometry heuristic code is duplicated, but I only left it there
to provide a hint. Also, I do intend to also rewrite fdisk.

- Frank