From 4f0114a06bc551c9460b81a65341d3944da64cd3 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Sat, 15 Jun 2024 22:44:52 +0100 Subject: [PATCH] Looks like heads per cylinder needs - 1 --- parted.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parted.c b/parted.c index dd809e7..2bcd18d 100644 --- a/parted.c +++ b/parted.c @@ -513,7 +513,7 @@ int main (int argc, char **argv) { write781_to_byte_array (footer.data_size, flen - sizeof (footer), 0); write721_to_byte_array (footer.disk_geom.cylinders, cylinders, 0); - footer.disk_geom.heads_per_cyl = heads_per_cylinder; + footer.disk_geom.heads_per_cyl = heads_per_cylinder - 1; footer.disk_geom.secs_per_track = sectors_per_track; get_random_bytes (footer.identifier, sizeof (footer.identifier)); -- 2.34.1