summaryrefslogtreecommitdiffstats
path: root/perl-install/raid.pm
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mandriva.org>2010-03-04 07:13:46 +0000
committerThomas Backlund <tmb@mandriva.org>2010-03-04 07:13:46 +0000
commit768f4bb857c743a2f3cddf392c04351824461441 (patch)
treeebde6fe7cfaae4ff1a7e3907504b0f683304d2c1 /perl-install/raid.pm
parent8a68affd8c82a9fff3f82a5c9cf180a1e54cfeec (diff)
downloaddrakx-768f4bb857c743a2f3cddf392c04351824461441.tar
drakx-768f4bb857c743a2f3cddf392c04351824461441.tar.gz
drakx-768f4bb857c743a2f3cddf392c04351824461441.tar.bz2
drakx-768f4bb857c743a2f3cddf392c04351824461441.tar.xz
drakx-768f4bb857c743a2f3cddf392c04351824461441.zip
add mdadm raid10 support
Diffstat (limited to 'perl-install/raid.pm')
-rw-r--r--perl-install/raid.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/raid.pm b/perl-install/raid.pm
index 11284a90a..82905449e 100644
--- a/perl-install/raid.pm
+++ b/perl-install/raid.pm
@@ -91,6 +91,7 @@ sub updateSize {
elsif (/1/) { min @l }
elsif (/4|5/) { min(@l) * (@l - 1) }
elsif (/6/) { min(@l) * (@l - 2) }
+ elsif (/10/) { min(@l) * (@l / 2) }
};
}
@@ -105,6 +106,8 @@ sub module {
if (member($level, 4, 5, 6)) {
'raid456';
+ } elsif (member($level, 10)) {
+ 'raid10';
} elsif ($level =~ /^\d+$/) {
"raid$level";
} else {
@@ -157,7 +160,7 @@ sub format_part {
sub verify {
my ($raids) = @_;
foreach (@$raids) {
- my $nb = $_->{level} =~ /6/ ? 4 : $_->{level} =~ /4|5/ ? 3 : 2;
+ my $nb = $_->{level} =~ /6|10/ ? 4 : $_->{level} =~ /4|5/ ? 3 : 2;
@{$_->{disks}} >= $nb or die N("Not enough partitions for RAID level %d\n", $_->{level});
}
}