How to repair my LVM volume which fails with "device not found"?

16,551

vgreduce --removemissing --force centos

(in my case the centos was the VG name replace with your respective VG name)

Share:
16,551

Related videos on Youtube

Guillaume Deshors
Author by

Guillaume Deshors

Updated on September 18, 2022

Comments

  • Guillaume Deshors
    Guillaume Deshors over 1 year

    On the next boot after an fairly standard upgrade on my arch linux box, the system failed to boot and stopped in maintenance mode ; I found out that if I commented out in /etc/fstab the lvm partition that I have on a secondary disk (my root and home are not in LVM) it accepted to boot.

    Now it runs OK but I can't access the data on this partition, and the necessary device doesn't get created. The various scan commands of LVM tell me that : "WARNING: Device for PV WbbZgi-PEpk-mWNz-faCX-IT1n-Vrsd-wFoGOP not found or rejected by a filter." I haven't changed any configuration and I don't have any filter in /etc/lvm/lvm.conf. Here are some infos I think are relevant :

    [root@bureau64 ~]# cat /etc/fstab
    # /dev/sdb3
    UUID=a2b6fa8e-1255-4563-b126-153c5a9178b5   /           btrfs       rw,noatime,ssd,space_cache,subvolid=5,subvol=/  0 0
    # /dev/sdb4
    UUID=a8c42099-3ec2-4bb9-b0ea-a126167523ef   /home       btrfs       rw,noatime,ssd,space_cache,subvolid=5,subvol=/  0 0
    # /dev/sdb1
    UUID=bc6e027d-ae37-419e-b394-02d4674e693f   /boot       ext2        rw,relatime,block_validity,barrier,user_xattr,acl   0 2
    # /dev/sdb2
    UUID=839a15de-bd4d-47a1-9727-6a9d394d741a   none        swap        defaults    0 0
    ## THE ONE I HAD TO COMMENT :
    #/dev/VGroupe0/data             /data       ext4        rw,data=ordered 0 2
    
    [root@bureau64 ~]# ls /dev/VGroupe0
    ls: impossible d'accéder à '/dev/VGroupe0': Aucun fichier ou dossier de ce type
    
    [root@bureau64 ~]# pvscan 
      WARNING: Device for PV WbbZgi-PEpk-mWNz-faCX-IT1n-Vrsd-wFoGOP not found or rejected by a filter.
      PV /dev/sda4   VG VGroupe0        lvm2 [217,46 GiB / 168,00 MiB free]
      PV [unknown]   VG VGroupe0        lvm2 [107,57 GiB / 77,57 GiB free]
      Total: 2 [<325,04 GiB] / in use: 2 [<325,04 GiB] / in no VG: 0 [0   ]
    
    [root@bureau64 ~]# lvscan 
      WARNING: Device for PV WbbZgi-PEpk-mWNz-faCX-IT1n-Vrsd-wFoGOP not found or rejected by a filter.
      inactive          '/dev/VGroupe0/root' [25,00 GiB] inherit
      inactive          '/dev/VGroupe0/home' [5,00 GiB] inherit
      inactive          '/dev/VGroupe0/data' [<217,30 GiB] inherit
    
    [root@bureau64 ~]# blkid 
    /dev/sda1: UUID="0C60E75260E740D6" TYPE="ntfs" PARTUUID="c169c169-01"
    /dev/sda2: UUID="395e11a4-6841-455c-b2f6-ff84d8d73f49" TYPE="ext2" PARTUUID="c169c169-02"
    /dev/sda3: LABEL="swap" UUID="bf964fa7-8690-4111-89d1-7cbbc0a1df43" TYPE="swap" PARTUUID="c169c169-03"
    /dev/sda4: UUID="CF3ZqC-JNaF-BMlE-uCT8-Mv0E-dfPm-a2vmea" TYPE="LVM2_member" PARTUUID="c169c169-04"
    /dev/sdb1: UUID="bc6e027d-ae37-419e-b394-02d4674e693f" TYPE="ext2" PARTUUID="a294f4fa-01"
    /dev/sdb2: UUID="839a15de-bd4d-47a1-9727-6a9d394d741a" TYPE="swap" PARTUUID="a294f4fa-02"
    /dev/sdb3: UUID="a2b6fa8e-1255-4563-b126-153c5a9178b5" UUID_SUB="22f83bf4-0c48-44ad-b016-7edf820c365e" TYPE="btrfs" PARTUUID="a294f4fa-03"
    /dev/sdb4: UUID="a8c42099-3ec2-4bb9-b0ea-a126167523ef" UUID_SUB="ae03aa3d-8823-47ea-83b2-53f584e03e59" TYPE="btrfs" PARTUUID="a294f4fa-04"
    

    I don't exactly remember the configuration of my LVM partitions, the volumes 'root' and 'home' were from a previous install and I don't care about them, but I care quite a lot about 'data'. How can I fix this issue and mount my partition again ?

    • Ignacio Vazquez-Abrams
      Ignacio Vazquez-Abrams over 6 years
      Does your system only have two hard drives?
    • Guillaume Deshors
      Guillaume Deshors over 6 years
      Yes : one HD and one SSD that I installed later, hence the old root and home in the LVM volume.
  • Anders Kreinøe
    Anders Kreinøe about 4 years
    Run this with care, as vgreduce with --force can be potential dangerous and cause data loss in some situations.
  • Brain2000
    Brain2000 almost 4 years
    This doesn't help if the vg doesn't exist, and just pv does.