summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/interactive.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/diskdrake/interactive.pm')
-rw-r--r--perl-install/diskdrake/interactive.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index dfb5c59fb..c98331449 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -885,8 +885,12 @@ sub RemoveFromLVM {
my ($_in, $_hd, $part, $all_hds) = @_;
isPartOfLVM($part) or die;
my ($lvm, $other_lvms) = partition { $_->{VG_name} eq $part->{lvm} } @{$all_hds->{lvms}};
- lvm::vg_destroy($lvm->[0]);
- $all_hds->{lvms} = $other_lvms;
+ if (@{$lvm->[0]{disks}} > 1) {
+ lvm::vg_reduce($lvm->[0], $part);
+ } else {
+ lvm::vg_destroy($lvm->[0]);
+ $all_hds->{lvms} = $other_lvms;
+ }
}
sub ModifyRAID {
my ($in, $_hd, $part, $all_hds) = @_;