mirror of
https://github.com/webmin/webmin.git
synced 2026-02-03 06:03:28 +00:00
Show real PVs for raid LVs
This commit is contained in:
@@ -391,9 +391,10 @@ sub get_logical_volume_usage
|
||||
{
|
||||
local ($lv) = @_;
|
||||
local @rv;
|
||||
local @raids;
|
||||
if (&get_lvm_version() >= 2) {
|
||||
# LVdisplay has new format in version 2
|
||||
open(DISPLAY, "lvdisplay -m ".quotemeta($lv->{'device'})." 2>/dev/null |");
|
||||
open(DISPLAY, "lvdisplay -a -m ".quotemeta($lv->{'device'})." 2>/dev/null |");
|
||||
while(<DISPLAY>) {
|
||||
if (/\s+Physical\s+volume\s+\/dev\/(\S+)/) {
|
||||
push(@rv, [ $1, undef ]);
|
||||
@@ -401,8 +402,21 @@ if (&get_lvm_version() >= 2) {
|
||||
elsif (/\s+Physical\s+extents\s+(\d+)\s+to\s+(\d+)/ && @rv) {
|
||||
$rv[$#rv]->[1] = $2-$1+1;
|
||||
}
|
||||
elsif (/\s+Logical\s+volume\s+([a-z0-9\_]+)/i) {
|
||||
push(@raids, [ $1, undef ]);
|
||||
}
|
||||
elsif (/\s+Logical\s+extents\s+(\d+)\s+to\s+(\d+)/ && @rv) {
|
||||
$raids[$#raid]->[1] = $2-$1+1;
|
||||
}
|
||||
}
|
||||
close(DISPLAY);
|
||||
|
||||
# Lookup actual PVs for raid logical volumes
|
||||
foreach my $r (@raids) {
|
||||
my $rlv = { 'device' => '/dev/'.$lv->{'vg'}.'/'.$r->[0] };
|
||||
my @pvs = &get_logical_volume_usage($rlv);
|
||||
push(@rv, @pvs);
|
||||
}
|
||||
}
|
||||
else {
|
||||
# Old version 1 format
|
||||
|
||||
Reference in New Issue
Block a user