]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: (dos) calculation of total size based on CHS in check function
authorThorsten Wilmer <wilmer.thorsten@gmail.com>
Tue, 24 Jun 2014 07:38:30 +0000 (09:38 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Jun 2014 07:40:06 +0000 (09:40 +0200)
commit9bb8caff87c2ae1ea22068176d3375c1cc2cb76d
tree9df2241729c98a66983bcb353a2b72f144dec144
parentb1f03df7983975919b2d2f6eaa3175212ce61bee
libfdisk: (dos) calculation of total size based on CHS in check function

Many people report a problem with the message if (cylinders <= 1024 &&
start != total) fprintf(stderr, _("Partition %d: previous sectors %d
disagrees with " "total %d\n"), n, start, total);

This message comes from the fact that the previous code caluclates the
total number of sectors in the wrong way.

The formula should be total = (real_c * heads + h) * sectors + real_s;

As a Cylinder consists of some heads * sectors A Head consists of some
sectors and finally sectors are the smallest unit

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c