-->

DEVOPSZONES

  • Recent blogs

    How to recover a deleted Volume group in just 7 steps

    How to recover  a deleted Volume group

    Centos

    When you want to recover the  VG, you tried using vgcfgrestore  but the roadblocks comes with an error that "Couldn't find device with uuid". You need to below given procedure to recover the VG.

    Error:

    [root@cactiDB lvm]# vgcfgrestore cactiDB
    Couldn't find device with uuid Disk UUID.
      Cannot restore Volume Group cactiDB with 1 PVs marked as missing.
      Restore failed.
    [root@cactiDB lvm]#

    Solution:

    1. Restore PV First

    [root@cactiDB lvm]# pvcreate --uuid "Disk UUID" --restorefile /etc/lvm/archive/cactiDB_00002-188570652.vg /dev/mpath/mpath11
      Writing physical volume data to disk "/dev/mpath/mpath11"
      Physical volume "/dev/mpath/mpath11" successfully created
    [root@cactiDB lvm]#


    2. Restore VG

    [root@cactiDB lvm]# vgcfgrestore cactiDB

    /dev/sdh: read failed after 0 of 4096 at 4096: Input/output error
      Found volume group "cactiDB" using metadata type lvm2
      Found volume group "VolGroup00" using metadata type lvm2
    [root@cactiDB lvm]#

    3. Activate the VG


    [root@cactiDB lvm]# vgchange -ay cactiDB
     1 logical volume(s) in volume group "cactiDB" now active
    [root@cactiDB lvm]#



    4. Try finding out the Superblock.


    [root@cactiDB lvm]# mkfs.ext4 -n /dev/mapper/mpath11
    mke4fs 1.41.12 (17-May-2010)

    Try FSCK with given Superblock in the Preeceding command.

    [root@cactiDB lvm]# e4fsck -b 20480000 /dev/mapper/mpath11
    e4fsck 1.41.12 (17-May-2010)


    5. IF the FSCK do not work, Rewrite the Superblock (Chances of data Loss)


    [root@cactiDB lvm]# mkfs.ext4 -S /dev/mapper/mpath11
    mke4fs 1.41.12 (17-May-2010)
    Filesystem label=
    OS type: Linux
    *** journal has been re-created - filesystem is now ext3 again ***

    /dev/mapper/mpath11: ***** FILE SYSTEM WAS MODIFIED *****

           2 inodes used (0.00%)
           0 non-contiguous files (0.0%)
           0 non-contiguous directories (0.0%)

    6. Run FSCK again.

    [root@cactiDB lvm]# fsck.ext4 -vy /dev/mapper/mpath11
    e4fsck 1.41.12 (17-May-2010)
    /dev/mapper/mpath11: clean, 2/134217728 files, 8474647/536870912 blocks
    [root@cactiDB lvm]#



    7. Now mount the File System.    

    No comments