if (fdisk_use_cylinders(cxt))
first *= fdisk_get_units_per_sector(cxt);
+ if (!fdisk_use_cylinders(cxt)) {
+ /* Starting sector has to be properly aligned */
+ int cs = cxt->geom.heads * cxt->geom.sectors;
+ int x = first % cs;
+
+ if (x) {
+ fdisk_info(cxt, _("Aligning the first sector from %u to %u "
+ "to be on cylinder boundary."),
+ first, first + cs - x);
+ first += cs - x;
+ }
+ }
+
/* ewt asks to add: "don't start a partition at cyl 0"
However, edmundo@rano.demon.co.uk writes:
"In addition to having a Sun partition table, to be able to
}
}
-
- if (!fdisk_use_cylinders(cxt)) {
- /* Starting sector has to be properly aligned */
- int cs = cxt->geom.heads * cxt->geom.sectors;
- int x = first % cs;
-
- if (x) {
- fdisk_info(cxt, _("Aligning the first sector from %u to %u "
- "to be on cylinder boundary."),
- first, first + cs - x);
- first += cs - x;
- }
- }
-
stop = cxt->geom.cylinders * cxt->geom.heads * cxt->geom.sectors; /* ancient */
stop2 = stop;
for (i = 0; i < cxt->label->nparts_max; i++) {