summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/raid.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/raid.pm b/perl-install/raid.pm
index 273aca6ca..d52956935 100644
--- a/perl-install/raid.pm
+++ b/perl-install/raid.pm
@@ -25,7 +25,7 @@ sub new {
my $md_part = { %opts };
add2hash_($md_part, { 'chunk-size' => '64', disks => [],
fs_type => 'ext3',
- device => 'md' . int(@$raids),
+ device => first(free_mds($raids)),
notFormatted => 1, level => 1 });
push @$raids, $md_part;
foreach (@{$md_part->{disks}}) {
@@ -158,6 +158,11 @@ sub inactive_mds() {
map { if_(/^(md\d+)\s*:\s*inactive/, $1) } cat_("/proc/mdstat");
}
+sub free_mds {
+ my ($raids) = @_;
+ difference2([ map { "md$_" } 0 .. raid::max_nb() ], [ map { $_->{device} } @$raids ]);
+}
+
sub detect_during_install {
my (@parts) = @_;
detect_during_install_once(@parts);