aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util-linux/fdisk_sun.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c
index d11c54012..e32740dea 100644
--- a/util-linux/fdisk_sun.c
+++ b/util-linux/fdisk_sun.c
@@ -498,11 +498,14 @@ add_sun_partition(int n, int sys)
else
first = read_int(scround(start), scround(stop)+1,
scround(stop), 0, mesg);
- if (display_in_cyl_units)
+ if (display_in_cyl_units) {
first *= units_per_sector;
- else
+ } else {
/* Starting sector has to be properly aligned */
- first = (first + g_heads * g_sectors - 1) / (g_heads * g_sectors);
+ first = (first + g_heads * g_sectors - 1) /
+ (g_heads * g_sectors);
+ first *= g_heads * g_sectors;
+ }
if (n == 2 && first != 0)
printf("\
It is highly recommended that the third partition covers the whole disk\n\