[Fai-commit] r6250 - branches/stable/3.4/lib/setup-storage

Michael Prokop mika at alioth.debian.org
Thu Dec 23 12:45:56 UTC 2010


Author: mika
Date: 2010-12-23 12:45:55 +0000 (Thu, 23 Dec 2010)
New Revision: 6250

Modified:
   branches/stable/3.4/lib/setup-storage/Commands.pm
Log:
setup-storage/Commands.pm: Always run vgchange -a -n, even if no prior LVM
was detected; run pvcreate with -ff -y.

Closes: #606485
Thanks: Mathieu Alorent <malorent at echo.fr>

Modified: branches/stable/3.4/lib/setup-storage/Commands.pm
===================================================================
--- branches/stable/3.4/lib/setup-storage/Commands.pm	2010-12-23 12:45:49 UTC (rev 6249)
+++ branches/stable/3.4/lib/setup-storage/Commands.pm	2010-12-23 12:45:55 UTC (rev 6250)
@@ -402,7 +402,7 @@
       my $type_pre = "";
       $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
 
-      &FAI::push_command( "pvcreate $pv_create_options $dev",
+      &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
         "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
       $devs .= " $dev";
       $pre_dev .= ",pv_done_$dev";
@@ -446,7 +446,7 @@
     my $type_pre = "";
     $type_pre .= ",type_lvm_$dev" if (&FAI::set_partition_type_on_phys_dev($dev, "lvm"));
 
-    &FAI::push_command( "pvcreate $pv_create_options $dev",
+    &FAI::push_command( "pvcreate -ff -y $pv_create_options $dev",
       "all_pv_sigs_removed,exist_$dev$type_pre", "pv_done_$dev");
     $pre_dev .= ",pv_done_$dev";
   }
@@ -653,13 +653,12 @@
 sub build_lvm_commands {
 
   # disable volumes if there are pre-existing ones
-  my $all_vg_pre = "";
+  &FAI::push_command("vgchange -a n", "", "vgchange_a_n");
+  my $all_vg_pre = "vgchange_a_n";
   if (scalar(keys %FAI::current_lvm_config)) {
-    &FAI::push_command("vgchange -a n", "", "vgchange_a_n");
     foreach my $vg (keys %FAI::current_lvm_config) {
       $all_vg_pre .= ",pv_sigs_removed_$vg" if (&FAI::cleanup_vg($vg));
     }
-    $all_vg_pre =~ s/^,//;
   }
   &FAI::push_command("true", "$all_vg_pre", "all_pv_sigs_removed");
 




More information about the Fai-commit mailing list