summaryrefslogtreecommitdiffstats
path: root/perl-install/lvm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-15 14:15:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-15 14:15:22 +0000
commit07587b513a59080c7280cd520ac345010657bf58 (patch)
treeb79ee5a86f4ca01089a5364c7e22f4e63d5bc2d2 /perl-install/lvm.pm
parent972b8ebc1edbaeb2e83250306aa2f4436b193e25 (diff)
downloaddrakx-07587b513a59080c7280cd520ac345010657bf58.tar
drakx-07587b513a59080c7280cd520ac345010657bf58.tar.gz
drakx-07587b513a59080c7280cd520ac345010657bf58.tar.bz2
drakx-07587b513a59080c7280cd520ac345010657bf58.tar.xz
drakx-07587b513a59080c7280cd520ac345010657bf58.zip
adaptation/simplification for new lvm2 (thanks to Luca Berra)
Diffstat (limited to 'perl-install/lvm.pm')
-rw-r--r--perl-install/lvm.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/perl-install/lvm.pm b/perl-install/lvm.pm
index f4a94179c..2a7c1721f 100644
--- a/perl-install/lvm.pm
+++ b/perl-install/lvm.pm
@@ -64,19 +64,17 @@ sub check {
sub get_vg {
my ($part) = @_;
my $dev = expand_symlinks(devices::make($part->{device}));
- (split(':', run_program::get_stdout('lvm2', 'pvdisplay', '-c', $dev)))[1];
+ chomp_(run_program::get_stdout('lvm2', 'pvs', '--noheadings', '-o', 'vg_name', $dev));
}
sub update_size {
my ($lvm) = @_;
- my @l = split(':', run_program::get_stdout('lvm2', 'vgdisplay', '-c', '-D', $lvm->{VG_name}));
- $lvm->{totalsectors} = ($lvm->{PE_size} = $l[12]) * $l[13];
+ $lvm->{totalsectors} = chomp_(run_program::get_stdout('lvm2', 'vgs', '--noheadings', '--nosuffix', '--units', 's', '-o', 'vg_size', $lvm->{VG_name}));
}
sub get_lv_size {
my ($lvm_device) = @_;
- my $info = run_program::get_stdout('lvm2', 'lvdisplay', '-D', '-c', "/dev/$lvm_device");
- (split(':', $info))[6];
+ chomp_(run_program::get_stdout('lvm2', 'lvs', '--noheadings', '--nosuffix', '--units', 's', '-o', 'lv_size', "/dev/$lvm_device"));
}
sub get_lvs {