# Use pvdisplay command
local $pv;
local $_;
- open(DISPLAY, "pvdisplay |");
+ open(DISPLAY, "pvdisplay 2>/dev/null |");
while(<DISPLAY>) {
s/\r|\n//g;
if (/PV\s+Name\s+(.*)/i) {
sub get_physical_volume_usage
{
local @rv;
-open(DISPLAY, "pvdisplay -m ".quotemeta($_[0]->{'device'})." |");
+open(DISPLAY, "pvdisplay -m ".quotemeta($_[0]->{'device'})." 2>/dev/null |");
local $lastlen;
while(<DISPLAY>) {
if (/Physical\s+extent\s+(\d+)\s+to\s+(\d+)/) {
else {
# Parse output of vgdisplay
local $vg;
- open(DISPLAY, "vgdisplay |");
+ open(DISPLAY, "vgdisplay 2>/dev/null |");
while(<DISPLAY>) {
s/\r|\n//g;
if (/VG\s+Name\s+(.*)/i) {
local $lv;
local $_;
local ($vg) = grep { $_->{'name'} eq $_[0] } &list_volume_groups();
- open(DISPLAY, "lvdisplay -m |");
+ open(DISPLAY, "lvdisplay -m 2>/dev/null |");
while(<DISPLAY>) {
s/\r|\n//g;
if (/LV\s+Name\s+(.*\/(\S+))/i) {
local @rv;
if (&get_lvm_version() >= 2) {
# LVdisplay has new format in version 2
- open(DISPLAY, "lvdisplay -m ".quotemeta($_[0]->{'device'})." |");
+ open(DISPLAY, "lvdisplay -m ".quotemeta($_[0]->{'device'})." 2>/dev/null |");
while(<DISPLAY>) {
if (/\s+Physical\s+volume\s+\/dev\/(\S+)/) {
push(@rv, [ $1, undef ]);
}
else {
# Old version 1 format
- open(DISPLAY, "lvdisplay -v ".quotemeta($_[0]->{'device'})." |");
+ open(DISPLAY, "lvdisplay -v ".quotemeta($_[0]->{'device'})." 2>/dev/null |");
local $started;
while(<DISPLAY>) {
if (/^\s*PV\s+Name/i) {