diff --git a/lvm/edit_lv.cgi b/lvm/edit_lv.cgi
index d75480059..bd51b8bb3 100755
--- a/lvm/edit_lv.cgi
+++ b/lvm/edit_lv.cgi
@@ -176,7 +176,12 @@ elsif (!$lv->{'is_snap'}) {
# Show current striping
print &ui_table_row($text{'lv_stripe'},
$lv->{'stripes'} > 1 ? &text('lv_stripes', $lv->{'stripes'})
- : $text{'lv_nostripe'}, 3);
+ : $text{'lv_nostripe'});
+
+ if ($lv->{'stripes'} && $lv->{'stripesize'}) {
+ print &ui_table_row($text{'lv_stripesize'},
+ &nice_size($lv->{'stripesize'}*1024));
+ }
}
# Show free disk space
diff --git a/lvm/edit_pv.cgi b/lvm/edit_pv.cgi
index d77fc7c5b..45c73be2b 100755
--- a/lvm/edit_pv.cgi
+++ b/lvm/edit_pv.cgi
@@ -56,7 +56,7 @@ if ($in{'pv'}) {
@lvs = &list_logical_volumes($in{'vg'});
foreach $l (@lvinfo) {
($lv) = grep { $_->{'name'} eq $l->[0] } @lvs;
- push(@lvlist, "{'name'}'>$lv->{'name'} ".&nice_size($l->[2]*$pv->{'pe_size'}*1024));
+ push(@lvlist, "{'name'}'>$lv->{'name'} ".&nice_size($l->[1]*$pv->{'pe_size'}*1024));
}
print &ui_table_row($text{'pv_lvs'}, join(" , ", @lvlist), 3);
}
diff --git a/lvm/lvm-lib.pl b/lvm/lvm-lib.pl
index d589bb2cd..303ded86d 100755
--- a/lvm/lvm-lib.pl
+++ b/lvm/lvm-lib.pl
@@ -64,6 +64,9 @@ else {
elsif (/PE\s+Size\s+\(\S+\)\s+(\S+)/i) {
$pv->{'pe_size'} = $1;
}
+ elsif (/PE\s+Size\s+(\S+)\s+(\S+)/i) {
+ $pv->{'pe_size'} = &mult_units($1, $2);
+ }
elsif (/Total\s+PE\s+(\S+)/i) {
$pv->{'pe_total'} = $1;
}
@@ -85,17 +88,14 @@ return @rv;
sub get_physical_volume_usage
{
local @rv;
-open(DISPLAY, "pvdisplay -v ".quotemeta($_[0]->{'device'})." |");
-local $started;
+open(DISPLAY, "pvdisplay -m ".quotemeta($_[0]->{'device'})." |");
+local $lastlen;
while() {
- if (/^\s*LV\s+Name/i) {
- $started = 1;
+ if (/Physical\s+extent\s+(\d+)\s+to\s+(\d+)/) {
+ $lastlen = $2 - $1 + 1;
}
- elsif ($started && /^\s*\/dev\/\S+\/(\S+)\s+(\d+)\s+(\d+)/) {
- push(@rv, [ $1, $2, $3 ]);
- }
- elsif ($started) {
- last;
+ elsif (/Logical\s+volume\s+\/dev\/(\S+)\/(\S+)/) {
+ push(@rv, [ $2, $lastlen ]);
}
}
close(DISPLAY);
@@ -293,7 +293,7 @@ else {
local $lv;
local $_;
local ($vg) = grep { $_->{'name'} eq $_[0] } &list_volume_groups();
- open(DISPLAY, "lvdisplay |");
+ open(DISPLAY, "lvdisplay -m |");
while() {
s/\r|\n//g;
if (/LV\s+Name\s+(.*\/(\S+))/i) {
@@ -331,6 +331,9 @@ else {
elsif (/Stripes\s+(\d+)/) {
$lv->{'stripes'} = $1;
}
+ elsif (/Stripe\s+size\s+(\S+)\s+(\S+)/) {
+ $lv->{'stripesize'} = &mult_units($1, $2);
+ }
elsif (/Allocated\s+to\s+snapshot\s+([0-9\.]+)%/i) {
$lv->{'snapusage'} = $1;
}