Why are my LVM volumes missing, status shown as "unknown", after creating a partition table?

Solution Verified - Updated -

Issue

  • Why are my LVM volumes missing after creating a partition table?
  • My LVM Physical Volumes (PVs), Volume Groups (VGs), and Logical Volumes (LVs) cannot be found.
  • One physical volume /dev/sdX is listed as "unknown device" even though it appears in /proc/partions:

    # lvs -a -o +devices
      Couldn't find device with uuid aaaaaa-bbbb-cccc-dddd-eeee-ffff-gggggg.
      LV                 VG        Attr   LSize  Origin Snap%  Move Log Copy%  Convert Devices             
      lv_root            localvg00 -wi-ao  4.00G                                       /dev/sda2(512)      
      lv_data            localvg00 -wi-ao 40.00G                                       unknown device(0)    <----
    
    # grep sdX /proc/partitions 
       8    16   49283072 sdX
       8    17   49283040 sdX1
    
  • I get the following error when trying to restore LVM metadata on a Physical Volume:

    Can't open /dev/sdX exclusively. Mounted filesystem?
    

Environment

  • Red Hat Enterprise Linux (RHEL)
  • LVM2 Logical Volume Manager (PV is located on whole physical device)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content