Opened 14 years ago

Closed 14 years ago

#415 closed defect (fixed)

analyze-my-lvm doesn't handle "unknown device" from pvscan

Reported by: Michael Shapiro Owned by: Bruno Cornec
Priority: normal Milestone:
Component: mindi Version:
Severity: major Keywords:



We have some servers running RedHat Cluster Suite and the pvscan's return an "unknown device" to stdout, not to stderr:

# pvscan 2>/dev/null
  PV /dev/emcpoweri1     VG vgbmr        lvm2 [25.29 GB / 296.00 MB free]
  PV /dev/emcpowerh1     VG vgmbr        lvm2 [505.75 GB / 505.75 GB free]
  PV /dev/cciss/c0d0p2   VG vgroot_xen   lvm2 [132.42 GB / 88.92 GB free]
  PV /dev/emcpowerc      VG xengfs       lvm2 [505.75 GB / 0    free]
  PV /dev/emcpowero      VG xengfs       lvm2 [505.75 GB / 0    free]
  PV /dev/emcpowerg      VG xengfs       lvm2 [505.75 GB / 0    free]
  PV unknown device      VG xengfs       lvm2 [505.75 GB / 0    free]
  PV /dev/emcpowera      VG xengfs       lvm2 [505.75 GB / 0    free]
  PV /dev/emcpowerd      VG xengfs       lvm2 [505.75 GB / 12.00 MB free]
  Total: 9 [3.61 TB] / in use: 9 [3.61 TB] / in no VG: 0 [0   ]

This causes analyze-my-lvm to add a device called unknown to the lvm.res file:

LVM version >= 2.0 found.
Just before you extrapolate mountlist to include RAID partitions,
extrapolate it to include the following LVM drives and partitions:-
>>>>> /dev/cciss/c0d0p2   unknown
To get started, type:-
(insmod dm-mod)
(insmod dm_mod)
# lvm vgchange -an
# echo y | lvm pvcreate -ff /dev/cciss/c0d0p2   
# echo y | lvm pvcreate -ff unknown
# lvm vgscan

I was able to fix the problem by filtering out the unknown devices in the ListAllPhysicalVolumes() function by grep'ing the output of the pvscan command and selecting only lines that don't match "unknown":

ListAllPhysicalVolumes() {
        if [ $lvmversion = 2 ]; then
                $LVMCMD pvscan 2> /dev/null | grep 'PV' | grep -v unknown | awk '{print $2}' >  $MINDI_TMP/pv.tmp
                pvscan 2> /dev/null | grep '"' | cut -d'"' -f2  >  $MINDI_TMP/pv.tmp

The attached file has the change in it. Look for the line:


Attachments (1)

analyze-my-lvm.pvscan_mod (10.9 KB ) - added by Michael Shapiro 14 years ago.

Download all attachments as: .zip

Change History (2)

by Michael Shapiro, 14 years ago

Attachment: analyze-my-lvm.pvscan_mod added

comment:1 by Bruno Cornec, 14 years ago

Resolution: fixed
Status: newclosed

Thanks again Mike for your patch. Integrated in rev [2617]. Will be in final.

Note: See TracTickets for help on using tickets.