diff --git a/lvm/lvm-lib.pl b/lvm/lvm-lib.pl index 6fade3dd4..e289f0e96 100755 --- a/lvm/lvm-lib.pl +++ b/lvm/lvm-lib.pl @@ -297,12 +297,15 @@ else { open(DISPLAY, "lvdisplay -m 2>/dev/null |"); while() { s/\r|\n//g; - if (/LV\s+Name\s+(.*\/(\S+))/i) { - $lv = { 'name' => $2, - 'device' => $1, + if (/LV\s+(Name|Path)\s+(.*\/(\S+))/i) { + $lv = { 'name' => $3, + 'device' => $2, 'number' => scalar(@rv) }; push(@rv, $lv); } + elsif (/LV\s+Name\s+[^\/]/) { + # Ignore this, as we got the name from LV Path line + } elsif (/VG\s+Name\s+(.*)/) { $lv->{'vg'} = $1; }