Installer: no option to set geometry/corrupts partition table

Simon 'corecode' Schubert corecode at fs.ei.tum.de
Wed Mar 7 01:41:42 PST 2007


[your email address is broken]

On 06.03.2007, at 15:48, randux at noreply.org wrote:
We'll work on a fictitious 120GB drive, which is really not 120GB but 
rather 120x10**9 bytes in size. I note that Linux fdisk seems to 
fiddle with the actual size a bit to get round numbers. (During the 
process of working this example out I see that BSD does similarly but 
not identically. The main thing to be aware of is that some rounding 
occurs for convenience, and will affect the actual space available in 
the last cylinder as it will not really be x bytes in size.)
I doubt any fdisk does rounding to get nice human numbers.

When DragonFly calculates the partion cylinder ranges based on his 
view of the geometry, he will almost certainly never find that the LBA 
value which should be the end of an integral cylinder boundary is the 
one that the partition table says is the end of his slice. Therefore, 
he automagically (and I'll say improperly) adjusts the LBA up or down 
(this part can only speculate- he makes an adjustment according to the 
message posted but it could be that he only increases or decreases, I 
don't know what he does) to be on an integral boundary from his view 
of the cylinder size.
So you're actually destroying the slice and then re-creating it?  This 
is important information.  Until now I was under the impression that 
the installer changes the slice table without being asked to change 
slices.

What is certain is that he does adjust the partition range to 
correspond with his view of a cylinder containing 516,096 bytes. I'll 
guess that he rounds up, which is quite a bit worse; if he rounded 
down it would be wasteful and unnecessary but wouldn't expose the data 
on the mext partition to loss/corruption.
So the slice table shouldn't be changed at all, I guess.

I should have given a better explanation at the start, I apologize for 
anything that was unclear. The main idea here is that regardless of 
how data is being addressed, it's being allocated by every OS in terms 
of his view of how big a cylinder is. And if all OS on the drive don't 
share the same view, and therefore agree on the start/end addresses of 
partitions, there can certainly be loss of data.
Actually the OS do not use any CHS view.  It is *only* fdisk we're 
talking here about.  After having set up the slice table, nobody cares 
about CHS.

This is why it seems to be essential to provide a way to change 
DragonFly's view of the disk geometry as necessary to match the 
geometry the partition table is already using.
fdisk can already do this, so this is "simply" a matter of adding this 
to the installer.  However, I disagree that this feature should be 
exposed to common users.   Setting up CHS values is a rather advanced 
topic, so I simply suggest doing a manual install instead, where you 
have everything under control.  A clean user interface is an important 
thing.  Maybe it could be integrated into expert mode, however.

Yet, I suggest not to care about CHS at all.  Simply ONLY care about 
LBA.  Don't care to put slices on cylinder boundaries.  Where is the 
point in this anyways?

I don't understand why he doesn't simply use the unit values in the 
partition table.
Yah.  It shouldn't even re-create the slice.

I would be delighted to help but alas, I'm not expert in any of the 
areas one would need to be knowledgeable in to do anything about this 
other than to recognize the problem and ask for help.
Well, nobody really is for the BSDinstaller.  That's part of the reason 
that we still are not using the new installer.

I was hoping when I posted the question in the user list that someone 
would say "yeah, you simply do such and such a thing in fdisk and this 
problem won't happen" but since I didn't get such a reply, I decided 
to post here.
"yea, you simply update the installer to 2.0 and then we'll check 
again" :)

cheers
  simon
--
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
Attachment:
PGP.sig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00003.pgp
Type: application/octet-stream
Size: 186 bytes
Desc: "Description: This is a digitally signed message part"
URL: <http://lists.dragonflybsd.org/pipermail/bugs/attachments/20070307/d9c83860/attachment-0022.obj>


More information about the Bugs mailing list