summaryrefslogtreecommitdiffstats
path: root/perl-install/lvm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r--perl-install/lvm.pm16
1 files changed, 14 insertions, 2 deletions
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;