summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorAnssi Hannula <anssi@mageia.org>2011-08-06 22:34:01 +0000
committerAnssi Hannula <anssi@mageia.org>2011-08-06 22:34:01 +0000
commitadbddb6198ae7d11bf27de847dfdaf8957507a0e (patch)
tree5bcc9682110cf566a96b92a82a4a4e9191f4e90a /perl-install/partition_table.pm
parent8f766397ac06ca3c4984ff041f026eaecc830d86 (diff)
downloaddrakx-adbddb6198ae7d11bf27de847dfdaf8957507a0e.tar
drakx-adbddb6198ae7d11bf27de847dfdaf8957507a0e.tar.gz
drakx-adbddb6198ae7d11bf27de847dfdaf8957507a0e.tar.bz2
drakx-adbddb6198ae7d11bf27de847dfdaf8957507a0e.tar.xz
drakx-adbddb6198ae7d11bf27de847dfdaf8957507a0e.zip
partition_table: align partitions to 1MB boundaries to avoid
performance issues with drives with 4k physical sectors (mga#1215)
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index ee801fc79..1e594ddf5 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -32,9 +32,22 @@ sub description {
$hd->{info}, $hd->{mntpoint}, $hd->{fs_type});
}
+#- align partition start to the next MB boundary
+sub align_to_MB_boundaries {
+ my ($part) = @_;
+
+ my $end = $part->{start} + $part->{size};
+ $part->{start} = round_up($part->{start}, MB(1));
+ $part->{size} = $end - $part->{start};
+}
+
sub adjustStartAndEnd {
my ($hd, $part) = @_;
+ # always align partition start to MB boundaries
+ # (this accounts for devices with non-512 physical sector sizes):
+ align_to_MB_boundaries($part);
+
$hd->adjustStart($part);
$hd->adjustEnd($part);
}