SI/lvm.pm
changeset 13 2e3ad71484ea
parent 12 a1aee1136609
child 15 4e3753b998a9
--- a/SI/lvm.pm	Mon Jan 18 20:35:27 2010 +0100
+++ b/SI/lvm.pm	Sun Jan 17 13:54:10 2010 +0100
@@ -16,8 +16,8 @@
 
     my $devs = shift;
 
-    # find the physical volumes we already recognised as „non-removable“
-    my @pvs = grep { $_ ~~ $devs->{disk} } map { s/\s*//; (split /:/)[0] } `pvdisplay -c`;
+    # find the physical volumes we've already recognised as „non-removable“
+    my @pvs = grep { $_ ~~ $devs->{known} } map { s/\s*//; (split /:/)[0] } `pvdisplay -c`;
     return @volumegroups = map { (split /:/)[1] } `pvdisplay -c @pvs 2>/dev/null`;
 }
 
@@ -32,15 +32,9 @@
 	      map { s/^\s*//; (split /:/)[0] } 
 	      grep { (split /:/)[1] ~~ @vgs } `lvdisplay -c`;
 
-    foreach (keys %{$devs->{volume}}) {
-	warn "---> $_\n";
-	$devs->{volume}{$_} = {
-	    vol_type => ($_ ~~ @lvs) ? "lv" : "",
-	}
+    foreach (@lvs) {
+	$devs->{volume}{$_} = { origin => "lvm" };
     }
-### $devs
-    #@{$devs->{volume}}{@lvs} = map { { vol_type => "lv"  } } @lvs;
-
 }
 
 sub vgcfgbackup($\%) {
@@ -52,7 +46,7 @@
     {
 	verbose("saving vg $_\n");
         my $file = sprintf $file, $_;
-        run("vgcfgbackup -f $file $_ >/dev/null");
+        run("vgcfgbackup -f '$file' '$_' >/dev/null");
     }
 
     # for testing let's save it all