New pvmove syntax in LVM 2
authorJamie Cameron <jcameron@webmin.com>
Sun, 3 Feb 2008 01:58:24 +0000 (01:58 +0000)
committerJamie Cameron <jcameron@webmin.com>
Sun, 3 Feb 2008 01:58:24 +0000 (01:58 +0000)
lvm/lvm-lib.pl

index e51aa38..57b074a 100644 (file)
@@ -124,7 +124,13 @@ return $? ? $out : undef;
 sub delete_physical_volume
 {
 if ($_[0]->{'pe_alloc'}) {
-       local $cmd = "pvmove -f '$_[0]->{'device'}'";
+       local $cmd;
+       if (&get_lvm_version() >= 2) {
+               $cmd = "yes | pvmove '$_[0]->{'device'}'";
+               }
+       else {
+               $cmd = "pvmove -f '$_[0]->{'device'}'";
+               }
        local $out = &backquote_logged("$cmd 2>&1");
        return $out if ($? && $out !~ /\-\-\s+f/);
        }