[Fai-commit] r6710 - trunk/lib/setup-storage

Michael Tautschnig mt at alioth.debian.org
Sat Oct 22 12:52:16 UTC 2011


Author: mt
Date: 2011-10-22 12:52:16 +0000 (Sat, 22 Oct 2011)
New Revision: 6710

Modified:
   trunk/lib/setup-storage/Commands.pm
Log:
setup-storage/Commands.pm: stop RAID arrays before re-assembling.

Thanks: David Dreezer


Modified: trunk/lib/setup-storage/Commands.pm
===================================================================
--- trunk/lib/setup-storage/Commands.pm	2011-10-22 12:51:29 UTC (rev 6709)
+++ trunk/lib/setup-storage/Commands.pm	2011-10-22 12:52:16 UTC (rev 6710)
@@ -292,8 +292,12 @@
 sub build_raid_commands {
 
   # check RAID arrays if there are pre-existing ones
-  &FAI::push_command("mdadm --assemble --scan --config=$FAI::DATADIR/mdadm-from-examine.conf",
-    "", "mdadm_startall_examined") if (scalar(keys %FAI::current_raid_config));
+  if (scalar(keys %FAI::current_raid_config))
+  {
+    &FAI::push_command("mdadm --stop --scan", "", "stop_for_assemble");
+    &FAI::push_command("mdadm --assemble --scan --config=$FAI::DATADIR/mdadm-from-examine.conf",
+      "stop_for_assemble", "mdadm_startall_examined");
+  }
   foreach my $id (keys %FAI::current_raid_config) {
     my $md = "/dev/md$id";
     my $pre_deps_cl = "mdadm_startall_examined";




More information about the Fai-commit mailing list