From 503849761ece4d878a03044318f24f77939c4a25 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 24 Mar 2005 11:34:15 +0000 Subject: after "mdadm --assemble" there can be some mds in inactivate state busying devices, stopping them --- perl-install/raid.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'perl-install/raid.pm') diff --git a/perl-install/raid.pm b/perl-install/raid.pm index 3de848ee8..273aca6ca 100644 --- a/perl-install/raid.pm +++ b/perl-install/raid.pm @@ -152,13 +152,21 @@ sub inactivate_and_dirty { } sub active_mds() { - map { if_(/^(md\d+) /, $1) } cat_("/proc/mdstat"); + map { if_(/^(md\d+)\s*:\s*active/, $1) } cat_("/proc/mdstat"); +} +sub inactive_mds() { + map { if_(/^(md\d+)\s*:\s*inactive/, $1) } cat_("/proc/mdstat"); } sub detect_during_install { my (@parts) = @_; detect_during_install_once(@parts); detect_during_install_once(@parts) if active_mds(); #- try again to detect RAID 10 + + foreach (inactive_mds()) { + log::l("$_ is an inactive md, we stop it to ensure it doesn't busy devices"); + run_program::run('mdadm', '--stop', devices::make($_)); + } } sub detect_during_install_once { -- cgit v1.2.1