--- a/SI/lvm.pm Tue Jan 19 14:49:43 2010 +0100
+++ b/SI/lvm.pm Tue Jan 19 23:45:54 2010 +0100
@@ -17,10 +17,13 @@
my $devs = shift;
+ # find the physical volumes we've already recognised as „non-removable“
+ my @known = keys %{$devs->{volume}}, keys %{$devs->{disk}};
- # 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`;
+ my @pvs = grep { $_ ~~ @known } map { s/\s*//; (split /:/)[0] } `pvdisplay -c`;
+ @volumegroups = map { (split /:/)[1] } `pvdisplay -c @pvs 2>/dev/null`;
+ run("vgchange -ay @volumegroups 2>&1 >/dev/null");
+ return @volumegroups;
}
sub volumes(\%) {
@@ -30,8 +33,6 @@
# physical devices known to lvm, not just the non-removable
my @vgs = _vgs(%$devs);
- run("vgchange -ay @vgs 2>/dev/null");
-
my @lvs =
map { abs_path ((dirname $_) . "/" . readlink) }
map { s/^\s*//; (split /:/)[0] }