diff options
author | Anssi Hannula <anssi@mageia.org> | 2011-08-06 22:34:01 +0000 |
---|---|---|
committer | Anssi Hannula <anssi@mageia.org> | 2011-08-06 22:34:01 +0000 |
commit | adbddb6198ae7d11bf27de847dfdaf8957507a0e (patch) | |
tree | 5bcc9682110cf566a96b92a82a4a4e9191f4e90a /perl-install/partition_table.pm | |
parent | 8f766397ac06ca3c4984ff041f026eaecc830d86 (diff) | |
download | drakx-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.pm | 13 |
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); } |