?XavierMessersmith, 2002/10/06 06:59 UTC (via web):

I had a problem in cfdisk where when creating a partition by specifying megabytes (alternative units aren't suggested as being available in the interface) it would generate a partition with the wrong number of cylinders to represent it.

Recent example, a drive defined as having 15120 sectors a cylinder. Requested partition size 34520 megabytes, resulting in an allocation of 4459 cylinders.

4459 cylinders x (15120 x 512) 1024 1024 = ~32920

Making the partition about 4.6% smaller than I asked.

I've made the realization that cfdisk is using math like

34520 megabytes x 1000 x 1000 / (15120 x 512) = ~4459

which would be accurate if the user were using harddrive manufacturer megabytes instead of real ones. I don't claim to know anyone who assumes this though and I deem this seemingly undocumented feature a bug. But what can I do about this outside of multiplying my input by 1.048576 or directly inputing cylinders (after calculating that!!)?

It should be noted that though annoying it is technically correct. Contrary to popular belief a Mega Byte is 1000 Kilo Bytes. A Mibi Byte is 1024 Kibi Bytes. But thats standards for you.