|From:||"Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>|
|Date:||Wed, 7 Mar 2007 10:33:32 +0100|
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.)
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.
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.
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.
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.
I don't understand why he doesn't simply use the unit values in the partition table.
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.
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.
-- 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 / \
Description: This is a digitally signed message part