Mageia Bugzilla – Attachment 594 Details for
Bug 1215
Partitioning issues with 4k drives ("advanced format")
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Quick fix to align partitions to start on 1MB boundaries
0001-partition_table-align-partitions-to-1MB-boundaries.patch (text/plain), 2.00 KB, created by
Anssi Hannula
on 2011-06-20 21:04:25 CEST
(
hide
)
Description:
Quick fix to align partitions to start on 1MB boundaries
Filename:
MIME Type:
Creator:
Anssi Hannula
Created:
2011-06-20 21:04:25 CEST
Size:
2.00 KB
patch
obsolete
>From bb7096e82504a29439a1aa43726dbe1bbf0b4303 Mon Sep 17 00:00:00 2001 >From: Anssi Hannula <anssi.hannula@iki.fi> >Date: Mon, 20 Jun 2011 21:57:52 +0300 >Subject: [PATCH] partition_table: align partitions to 1MB boundaries > >--- > perl-install/partition_table.pm | 5 +++++ > perl-install/partition_table/raw.pm | 15 ++------------- > 2 files changed, 7 insertions(+), 13 deletions(-) > >diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm >index ee801fc..1a9c351 100644 >--- a/perl-install/partition_table.pm >+++ b/perl-install/partition_table.pm >@@ -35,6 +35,11 @@ sub description { > sub adjustStartAndEnd { > my ($hd, $part) = @_; > >+ # always align to MB boundaries: >+ my $end = $part->{start} + $part->{size}; >+ $part->{start} = round_up($part->{start}, MB(1)); >+ $part->{size} = $end - $part->{start}; >+ > $hd->adjustStart($part); > $hd->adjustEnd($part); > } >diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm >index 7659a39..ed89595 100644 >--- a/perl-install/partition_table/raw.pm >+++ b/perl-install/partition_table/raw.pm >@@ -73,20 +73,9 @@ sub last_usable_sector { > sub max_partition_start { 1e99 } > sub max_partition_size { 1e99 } > >-#- default method for starting a partition, only head size or twice >-#- is allowed for starting a partition after a cylinder boundarie. >-sub adjustStart($$) { >- my ($hd, $part) = @_; >- my $end = $part->{start} + $part->{size}; >+#- default method for starting a partition >+sub adjustStart($$) {} > >- if (cylinder_size($hd)) { >- $part->{start} = round_up($part->{start}, >- $part->{start} % cylinder_size($hd) < 2 * $hd->{geom}{sectors} ? >- $hd->{geom}{sectors} : cylinder_size($hd)); >- $part->{size} = $end - $part->{start}; >- $part->{size} > 0 or die "adjustStart get a too small partition to handle correctly"; >- } >-} > #- adjusting end to match a cylinder boundary, two methods are used and must > #- match at the end, else something is wrong and nothing will be done on > #- partition table. >-- >1.7.4.4 >
From bb7096e82504a29439a1aa43726dbe1bbf0b4303 Mon Sep 17 00:00:00 2001 From: Anssi Hannula <anssi.hannula@iki.fi> Date: Mon, 20 Jun 2011 21:57:52 +0300 Subject: [PATCH] partition_table: align partitions to 1MB boundaries --- perl-install/partition_table.pm | 5 +++++ perl-install/partition_table/raw.pm | 15 ++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm index ee801fc..1a9c351 100644 --- a/perl-install/partition_table.pm +++ b/perl-install/partition_table.pm @@ -35,6 +35,11 @@ sub description { sub adjustStartAndEnd { my ($hd, $part) = @_; + # always align to MB boundaries: + my $end = $part->{start} + $part->{size}; + $part->{start} = round_up($part->{start}, MB(1)); + $part->{size} = $end - $part->{start}; + $hd->adjustStart($part); $hd->adjustEnd($part); } diff --git a/perl-install/partition_table/raw.pm b/perl-install/partition_table/raw.pm index 7659a39..ed89595 100644 --- a/perl-install/partition_table/raw.pm +++ b/perl-install/partition_table/raw.pm @@ -73,20 +73,9 @@ sub last_usable_sector { sub max_partition_start { 1e99 } sub max_partition_size { 1e99 } -#- default method for starting a partition, only head size or twice -#- is allowed for starting a partition after a cylinder boundarie. -sub adjustStart($$) { - my ($hd, $part) = @_; - my $end = $part->{start} + $part->{size}; +#- default method for starting a partition +sub adjustStart($$) {} - if (cylinder_size($hd)) { - $part->{start} = round_up($part->{start}, - $part->{start} % cylinder_size($hd) < 2 * $hd->{geom}{sectors} ? - $hd->{geom}{sectors} : cylinder_size($hd)); - $part->{size} = $end - $part->{start}; - $part->{size} > 0 or die "adjustStart get a too small partition to handle correctly"; - } -} #- adjusting end to match a cylinder boundary, two methods are used and must #- match at the end, else something is wrong and nothing will be done on #- partition table. -- 1.7.4.4
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1215
: 594 |
595