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

Michael Tautschnig mt at alioth.debian.org
Fri Dec 17 14:18:17 UTC 2010


Author: mt
Date: 2010-12-17 14:18:15 +0000 (Fri, 17 Dec 2010)
New Revision: 6244

Modified:
   trunk/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: trunk/lib/setup-storage/Commands.pm
===================================================================
--- trunk/lib/setup-storage/Commands.pm	2010-12-17 14:16:37 UTC (rev 6243)
+++ trunk/lib/setup-storage/Commands.pm	2010-12-17 14:18:15 UTC (rev 6244)
@@ -403,7 +403,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";
@@ -447,7 +447,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";
   }
@@ -654,13 +654,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