summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-02-20 09:11:05 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-02-20 09:11:05 +0000
commit08bc489e2137d23bd0a285ca7e61091d4798285a (patch)
tree23fe43be7a9a690eca30161eea6050f7ddf1a462
parent1667ad08a1224ea78c1100a99bba4087401540a2 (diff)
downloaddrakx-backup-do-not-use-08bc489e2137d23bd0a285ca7e61091d4798285a.tar
drakx-backup-do-not-use-08bc489e2137d23bd0a285ca7e61091d4798285a.tar.gz
drakx-backup-do-not-use-08bc489e2137d23bd0a285ca7e61091d4798285a.tar.bz2
drakx-backup-do-not-use-08bc489e2137d23bd0a285ca7e61091d4798285a.tar.xz
drakx-backup-do-not-use-08bc489e2137d23bd0a285ca7e61091d4798285a.zip
use --force when creating a md with only one device (bugzilla #21214)
-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)) {