0

a few days back I my system would not boot up and go directly to emergency mode with no luck getting out, so I decided to reinstall centos 7. However, there are a few files that I would like to recover from my old home director which still have an inactive partition on one of the drives. This system is a server with RAID 10. Is there any way of recover this data? I had attempted to run vgchange -ay --activation partial on the inactive VG group before, however, when I reboot the system it goes directly to dracut and says that '/dev/centos00/root does not exist' and does not boot, so I had to reinstall the OS once again after failing to debug the issue.

[root@DESKTOP-3D5QPCJ /]# lsblk
NAME                MAJ:MIN RM  SIZE RO TYPE   MOUNTPOINT
sda                   8:0    0  3.5T  0 disk   
├─sda1                8:1    0  200M  0 part   
├─sda2                8:2    0    1G  0 part   
├─sda3                8:3    0  3.3T  0 part   
└─md126               9:126  0  3.3T  0 raid1  
  ├─md126p1         259:0    0  200M  0 md     /boot/efi
  ├─md126p2         259:1    0    1G  0 md     /boot
  └─md126p3         259:2    0  3.3T  0 md     
    ├─centos00-root 253:0    0   50G  0 lvm    /
    ├─centos00-swap 253:1    0    4G  0 lvm    [SWAP]
    └─centos00-home 253:2    0  3.3T  0 lvm    /home
sdb                   8:16   0  3.5T  0 disk   
└─md126               9:126  0  3.3T  0 raid1  
  ├─md126p1         259:0    0  200M  0 md     /boot/efi
  ├─md126p2         259:1    0    1G  0 md     /boot
  └─md126p3         259:2    0  3.3T  0 md     
    ├─centos00-root 253:0    0   50G  0 lvm    /
    ├─centos00-swap 253:1    0    4G  0 lvm    [SWAP]
    └─centos00-home 253:2    0  3.3T  0 lvm    /home
sdc                   8:32   0  3.5T  0 disk   
└─md124               9:124  0  6.7T  0 raid10 
  └─md124p1         259:3    0  6.7T  0 md     
sdd                   8:48   0  3.5T  0 disk   
└─md124               9:124  0  6.7T  0 raid10 
  └─md124p1         259:3    0  6.7T  0 md     
sde                   8:64   0  3.5T  0 disk   
└─md124               9:124  0  6.7T  0 raid10 
  └─md124p1         259:3    0  6.7T  0 md     
sdf                   8:80   0  3.5T  0 disk   
└─md124               9:124  0  6.7T  0 raid10 
  └─md124p1         259:3    0  6.7T  0 md     
sdg                   8:96   1 29.3G  0 disk   
├─sdg1                8:97   1  4.4G  0 part   /run/media/biosero/CentOS 7 x86_64
└─sdg2                8:98   1  8.6M  0 part   
[root@DESKTOP-3D5QPCJ /]# cat /proc/mdstat
Personalities : [raid1] [raid10] 
md124 : active (auto-read-only) raid10 sdc[3] sdd[2] sde[1] sdf[0]
      7126392832 blocks super external:/md125/0 64K chunks 2 near-copies [4/4] [UUUU]
      
md125 : inactive sdd[3](S) sdf[2](S) sdc[1](S) sde[0](S)
      20804 blocks super external:imsm
       
md126 : active raid1 sda[1] sdb[0]
      3563196416 blocks super external:/md127/0 [2/2] [UU]
      
md127 : inactive sda[1](S) sdb[0](S)
      10402 blocks super external:imsm
       
unused devices: <none>

Running: lvscan and lvmdiskscan

[root@DESKTOP-3D5QPCJ ~]# lvscan
  WARNING: Device for PV uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28 not found or rejected by a filter.
  Couldn't find device with uuid uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28.
  inactive          '/dev/centos/home' [150.00 GiB] inherit
  ACTIVE            '/dev/centos00/swap' [4.00 GiB] inherit
  ACTIVE            '/dev/centos00/home' [3.26 TiB] inherit
  ACTIVE            '/dev/centos00/root' [50.00 GiB] inherit

I also /dev/centos does not seem to exist, however as shown above, lvscan recognizes it.

[root@DESKTOP-3D5QPCJ ~]# lvmdiskscan 
  /dev/md126p1 [     200.00 MiB] 
  /dev/md126p2 [       1.00 GiB] 
  /dev/md126p3 [      <3.32 TiB] LVM physical volume
  /dev/md124p1 [      <6.64 TiB] LVM physical volume
  /dev/sde     [       3.49 TiB] 
  /dev/sdf     [       3.49 TiB] 
  /dev/sdg1    [      <4.39 GiB] 
  /dev/sdg2    [       8.59 MiB] 
  2 disks
  4 partitions
  0 LVM physical volume whole disks
  2 LVM physical volumes
[root@DESKTOP-3D5QPCJ /]# pvscan
  Couldn't find device with uuid uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28.
  WARNING: found device with duplicate /dev/sda3
  WARNING: Disabling lvmetad cache which does not support duplicate PVs.
  WARNING: Scan found duplicate PVs.
  WARNING: Not using lvmetad because cache update failed.
  WARNING: Not using device /dev/sda3 for PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA.
  WARNING: PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA prefers device /dev/md126p3 because device is used by LV.
  PV [unknown]      VG centos          lvm2 [<3.32 TiB / 3.17 TiB free]
  PV /dev/md124p1   VG centos          lvm2 [<6.64 TiB / <6.64 TiB free]
  PV /dev/md126p3   VG centos00        lvm2 [<3.32 TiB / 0    free]
  Total: 3 [13.27 TiB] / in use: 3 [13.27 TiB] / in no VG: 0 [0   ]
[root@DESKTOP-3D5QPCJ /]# vgscan
  Couldn't find device with uuid uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28.
  WARNING: found device with duplicate /dev/sda3
  WARNING: Disabling lvmetad cache which does not support duplicate PVs.
  WARNING: Scan found duplicate PVs.
  WARNING: Not using lvmetad because cache update failed.
  Reading all physical volumes.  This may take a while...
  WARNING: Not using device /dev/sda3 for PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA.
  WARNING: PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA prefers device /dev/md126p3 because of previous preference.
  Found volume group "centos" using metadata type lvm2
  Found volume group "centos00" using metadata type lvm2
[root@DESKTOP-3D5QPCJ /]# vgs -a -o +devices -P
  PARTIAL MODE. Incomplete logical volumes will be processed.
  WARNING: Not using lvmetad because duplicate PVs were found.
  WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
  WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
  WARNING: Not using device /dev/sda3 for PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA.
  WARNING: PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA prefers device /dev/md126p3 because device is used by LV.
  Couldn't find device with uuid uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28.
  VG       #PV #LV #SN Attr   VSize  VFree  Devices             
  centos     2   1   0 wz-pn-  9.95t <9.81t [unknown](830240)   
  centos00   1   3   0 wz--n- <3.32t     0  /dev/md126p3(0)     
  centos00   1   3   0 wz--n- <3.32t     0  /dev/md126p3(1024)  
  centos00   1   3   0 wz--n- <3.32t     0  /dev/md126p3(856814)
[root@DESKTOP-3D5QPCJ /]# lvs -P -a -o +devices
  PARTIAL MODE. Incomplete logical volumes will be processed.
  WARNING: Not using lvmetad because duplicate PVs were found.
  WARNING: Use multipath or vgimportclone to resolve duplicate PVs?
  WARNING: After duplicates are resolved, run "pvscan --cache" to enable lvmetad.
  WARNING: Not using device /dev/sda3 for PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA.
  WARNING: PV RbI6tp-pVf8-y32z-3aGJ-N0a9-GiCW-GlwrfA prefers device /dev/md126p3 because device is used by LV.
  Couldn't find device with uuid uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28.
  LV   VG       Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices             
  home centos   -wi-----p- 150.00g                                                     [unknown](830240)   
  home centos00 -wi-ao----   3.26t                                                     /dev/md126p3(1024)  
  root centos00 -wi-ao----  50.00g                                                     /dev/md126p3(856814)
  swap centos00 -wi-ao----   4.00g                                                     /dev/md126p3(0) 

In /etc/lvm/archive I have a file centos_00000-1647888590.vg with the following content

[root@DESKTOP-3D5QPCJ archive]# cat centos_00000-1647888590.vg 
# Generated by LVM2 version 2.02.187(2)-RHEL7 (2020-03-24): Mon May  3 17:46:13 2021

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing 'vgscan'"

creation_host = "DESKTOP-3D5QPCJ.localdomain"   # Linux DESKTOP-3D5QPCJ.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
creation_time = 1620078373  # Mon May  3 17:46:13 2021

centos {
    id = "oBLx8X-BuMf-m5ga-8cPm-A7EF-KKqH-Tm8Ef7"
    seqno = 6
    format = "lvm2"         # informational
    status = ["RESIZEABLE", "READ", "WRITE"]
    flags = []
    extent_size = 8192      # 4 Megabytes
    max_lv = 0
    max_pv = 0
    metadata_copies = 0

    physical_volumes {

        pv0 {
            id = "uFlcEe-aeFd-NLbh-BGgN-cnNP-XTpo-BBjs28"
            device = "[unknown]"    # Hint only

            status = ["ALLOCATABLE"]
            flags = ["MISSING"]
            dev_size = 7124289536   # 3.31751 Terabytes
            pe_start = 2048
            pe_count = 869664   # 3.3175 Terabytes
        }

        pv1 {
            id = "KWgy30-A4wC-Cciu-wxe1-8QDg-fy8s-Jy16z2"
            device = "/dev/md124p1" # Hint only

            status = ["ALLOCATABLE"]
            flags = []
            dev_size = 14252781568  # 6.63697 Terabytes
            pe_start = 2048
            pe_count = 1739841  # 6.63697 Terabytes
        }
    }

    logical_volumes {

        home {
            id = "fCNIEf-wal2-Xejs-M3nc-dnXR-HB0Q-yIXoVi"
            status = ["READ", "WRITE", "VISIBLE"]
            flags = []
            creation_time = 1586910049  # 2020-04-14 20:20:49 -0400
            creation_host = "localhost"
            segment_count = 1

            segment1 {
                start_extent = 0
                extent_count = 38400    # 150 Gigabytes

                type = "striped"
                stripe_count = 1    # linear

                stripes = [
                    "pv0", 830240
                ]
            }
        }
    }

}
   

Thank you in advanced for anyone willing to give some input on this issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.