summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/raid.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl-install/raid.pm b/perl-install/raid.pm
index e42c5c340..3a251439e 100644
--- a/perl-install/raid.pm
+++ b/perl-install/raid.pm
@@ -118,11 +118,13 @@ sub make {
whereis_binary('mdadm') or die 'mdadm not installed';
my $dev = devices::make($part->{device});
+ my $nb = @{$part->{disks}};
run_program::run_or_die('mdadm', '--create', '--run', $dev,
+ if_($nb == 1, '--force'),
'--chunk=' . $part->{'chunk-size'},
"--level=$part->{level}",
- '--raid-devices=' . int(@{$part->{disks}}),
+ "--raid-devices=$nb",
map { devices::make($_->{device}) } @{$part->{disks}});
if (my $raw_part = get_md_info($dev)) {