[linux-lvm] PV marked "NOT available" ondisk only!

Stuart D. Gathman stuart at bmsi.com
Mon Mar 5 20:26:03 UTC 2007

I'm beginning to find my way around the internals of LVM1.  But I am still 
mystified by this situation.  PV3 (/dev/md3) is active and running 
according to /proc

  [root at cmslax lvm]# cat /proc/lvm/VGs/rootvg/PVs/md3
  name:         /dev/md3
  size:         35374848
  status:       1
  number:       3
  allocatable:  2
  LV current:   0
  PE size:      32768
  PE total:     538
  PE allocated: 57
  device:       09:03
  uuid:         YfvI-pix3-CgxK-rRj1-T2Gu-tzu1-tpsl-8t01

I can read md3 just fine.  So can vgck:

  [root at cmslax lvm]# vgck -v
  vgck -- locking logical volume manager
  vgck -- finding all volume group(s)
  vgck -- checking volume group name "rootvg"
  vgck -- checking existence of volume group "rootvg"
  vgck -- reading volume group data for "rootvg" from lvmtab
  vgck -- checking volume group consistency  of "rootvg" in lvmtab
  vgck -- VGDA of "rootvg" in lvmtab is consistent
  vgck -- reading volume group data for "rootvg" from physical volume(s)
  vgck -- checking volume group consistency  of "rootvg" on physical volumes
  vgck -- VGDA of "rootvg" on physical volumes is consistent
  vgck -- unlocking logical volume manager

So can vgdisplay -D.  Here is a diff of vgdisplay -v  with/without -D:

< VG Status             NOT available/resizable
> VG Status             available/resizable
< Open LV               0
> Open LV               9
< # open                 0
> # open                 1
< PV Status             NOT available / allocatable
> PV Status             available / allocatable

Why does the ondisk metadata for md3 get set to NOT available?  If
LVM was able to write the flag to md3, how could it not be
available?  Where is the flag?  Can I patch it by hand?  Why does
vgck not complain about the NOT available PV?  (Perhaps because it
is reading from lvmtab.d to enumerate PVs?)  vgscan *does* complain,
and truncates lvmtab.d/rootvg.

	      Stuart D. Gathman <stuart at bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

More information about the linux-lvm mailing list