summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perl-install/diskdrake/interactive.pm9
-rw-r--r--perl-install/lvm.pm16
2 files changed, 16 insertions, 9 deletions
diff --git a/perl-install/diskdrake/interactive.pm b/perl-install/diskdrake/interactive.pm
index a23dcbe0c..2c306efae 100644
--- a/perl-install/diskdrake/interactive.pm
+++ b/perl-install/diskdrake/interactive.pm
@@ -872,13 +872,8 @@ sub Add2LVM {
push @$lvms, $lvm;
}
raid::make($all_hds->{raids}, $part) if isRAID($part);
- $part->{lvm} = $lvm->{VG_name};
- push @{$lvm->{disks}}, $part;
- delete $part->{mntpoint};
-
- lvm::check($in) if $::isStandalone;
- lvm::vg_add($part);
- lvm::update_size($lvm);
+ lvm::check($in->do_pkgs) if $::isStandalone;
+ lvm::add_to_VG($lvm, $part);
}
sub Unmount {
my ($_in, $_hd, $part) = @_;
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index 2c51b2768..decdfb376 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -57,9 +57,9 @@ sub lvm_cmd_or_die {
}
sub check {
- my ($in) = @_;
+ my ($do_pkgs) = @_;
- $in->do_pkgs->ensure_binary_is_installed('lvm2', 'lvm2') or return;
+ $do_pkgs->ensure_binary_is_installed('lvm2', 'lvm2') or return;
init();
1;
}
@@ -125,6 +125,7 @@ sub get_lvs {
sub vg_add {
my ($part) = @_;
my $dev = expand_symlinks(devices::make($part->{device}));
+ output($dev, '\0' x 512); #- help pvcreate
lvm_cmd_or_die('pvcreate', '-y', '-ff', $dev);
my $prog = lvm_cmd('vgs', $part->{lvm}) ? 'vgextend' : 'vgcreate';
lvm_cmd_or_die($prog, $part->{lvm}, $dev);
@@ -192,4 +193,15 @@ sub lv_resize {
$lv->{size} = get_lv_size($lv->{device}); #- the resized partition may not be the exact asked size
}
+sub add_to_VG {
+ my ($part, $lvm) = @_;
+
+ $part->{lvm} = $lvm->{VG_name};
+ push @{$lvm->{disks}}, $part;
+ delete $part->{mntpoint};
+
+ lvm::vg_add($part);
+ lvm::update_size($lvm);
+}
+
1;