diff options
-rw-r--r-- | perl-install/raid.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/raid.pm b/perl-install/raid.pm index 83d5e7dd4..93e491e4a 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -174,11 +174,15 @@ sub inactivate_and_dirty { $part->{notFormatted} = 1; $part->{isFormatted} = 0; } +sub active_mds { + map { if_(/^(md\d+) /, $1) } cat_("/proc/mdstat"); +} + sub is_active { my ($dev) = @_; - cat_("/proc/mdstat") =~ /^$dev /m; + member($dev, active_mds()); } -sub inactivate_all() { run_program::run("raidstop", devices::make("md$_")) foreach 0..max_nb() } +sub inactivate_all() { run_program::run("raidstop", devices::make($_)) foreach active_mds() } 1; |