From adbddb6198ae7d11bf27de847dfdaf8957507a0e Mon Sep 17 00:00:00 2001 From: Anssi Hannula Date: Sat, 6 Aug 2011 22:34:01 +0000 Subject: partition_table: align partitions to 1MB boundaries to avoid performance issues with drives with 4k physical sectors (mga#1215) --- perl-install/partition_table.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'perl-install/partition_table.pm') 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); } -- cgit v1.2.1