summaryrefslogtreecommitdiffstats
path: root/perl-install/raid.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-04-25 12:26:16 +0000
commit126777bc019a54afb4ec51299f2cf9d2841698aa (patch)
tree97f76e571902ead55ba138f1156a4b4f00b9b779 /perl-install/raid.pm
parentf1f67448efc714873378dfeb8279fae68054a90a (diff)
downloaddrakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.gz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.bz2
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.tar.xz
drakx-126777bc019a54afb4ec51299f2cf9d2841698aa.zip
re-sync after the big svn loss
Diffstat (limited to 'perl-install/raid.pm')
-rw-r--r--perl-install/raid.pm12
1 files changed, 7 insertions, 5 deletions
diff --git a/perl-install/raid.pm b/perl-install/raid.pm
index 3a251439e..135218344 100644
--- a/perl-install/raid.pm
+++ b/perl-install/raid.pm
@@ -85,9 +85,10 @@ sub updateSize {
my @l = map { $_->{size} } @{$part->{disks}};
$part->{size} = do {
- if (/0|linear/) { sum @l }
- elsif (/1/) { min @l }
- elsif (/4|5/) { min(@l) * $#l }
+ if (/0|linear/) { sum @l }
+ elsif (/1/) { min @l }
+ elsif (/4|5/) { min(@l) * (@l - 1) }
+ elsif (/6/) { min(@l) * (@l - 2) }
};
}
@@ -145,7 +146,8 @@ sub format_part {
sub verify {
my ($raids) = @_;
foreach (@$raids) {
- @{$_->{disks}} >= ($_->{level} =~ /4|5/ ? 3 : 2) or die N("Not enough partitions for RAID level %d\n", $_->{level});
+ my $nb = $_->{level} =~ /6/ ? 4 : $_->{level} =~ /4|5/ ? 3 : 2;
+ @{$_->{disks}} >= $nb or die N("Not enough partitions for RAID level %d\n", $_->{level});
}
}
@@ -198,7 +200,7 @@ sub get_existing {
foreach my $md (active_mds()) {
my $raw_part = get_md_info(devices::make($md)) or next;
- $raw_part->{level} =~ s/raid//; #- { linear | raid0 | raid1 | raid5 } -> { linear | 0 | 1 | 5 }
+ $raw_part->{level} =~ s/raid//; #- { linear | raid0 | raid1 | raid5 | raid6 } -> { linear | 0 | 1 | 5 | 6 }
my @mdparts =
map {