This post will show you how to recover LVM physical volume metadata in linux when you get an error something like “Couldnt find device with uuid”.
If you are interested in learning, Request you to go through the below recommended tutorial.
DevOps Full Course Tutorial for Beginners – DevOps Free Training Online
Docker Full Course Tutorial for Beginners – Docker Free Training Online
Kubernetes Full Course Tutorial for Beginners – Kubernetes Free Training Online
Ansible Full Course Tutorial for Beginners – Ansible Free Training Online
Openstack Full Course Tutorial for Beginners – Openstack Free Training Online
Couldnt find device with uuid – Recover LVM Metadata Linux
Couldnt find device with uuid ‘FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk’.
Couldn’t find all physical volumes for volume group vgroot.
By writing a new metadata on the new physical volume by using the existing UUID, we can recover the LVM Metadata. From the above error, we have got the UUID “FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk”.
By default, the LVM label is placed in the second 512-byte sector. The LVM label identifies the device as an LVM physical volume which contains the UUID for the physical name. It also stores the size of block devices in bytes, and LVM metadata stored on the disk. An identical copy of the metadata is maintained in every metadata area in every physical volume within the volume group.
Lets get started.
Confirm the UUID of the physical volume from the corresponding VG (vgroot) file (VolumeGroupName_xxxx.vg) under the directory /etc/lvm/archive.
[[email protected] ~]# cat /etc/lvm/archive/* | grep -i “FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk”
id = “FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk”
Restoring UUID to recover the LVM Metadata
Use the –uuid and –restorefile arguments of the pvcreate command to restore the physical volume.
[[email protected] ~]# pvcreate –uuid “FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk” –restore /etc/lvm/backup/vgroot_xxxx.vg /dev/sdd
Couldn’t find device with uuid FmGRh3-zhok-iVI8-7qTD-S5BI-MAEN-NYM5Sk.
Writing physical volume data to disk “/dev/sdd”
Physical volume “/dev/sdd” successfully created
Use vgcfgrestore command to restore the volume group’s metadata.
[[email protected] ~]# vgcfgrestore vgroot
Restored volume group vgroot
Now your physical volume metadata is recovered.
Use pvs command to ensure the UUID is replaced or not.
[[email protected]nitguide1 ~]# pvs -o pv_name,uuid
PV PV UUID
If the volume is not active, then activate the volume. Else this step is not required.
[[email protected] ~]# lvchange -ay /dev/vgroot/lvroot
Hope you have got an idea how to restore or recover the LVM metadata using UUID.
Related Content on Linux might be useful to you to improve your Linux Skills.
How to Access Linux Server from Windows Remotely
Configure SSH Passwordless Login Authentication (SSH-keygen)
How to Create LVM Partition in Linux – LVM Tutorial
Install & Configure Samba Server on Linux (RHEL7 / CentOS7)
Keep practicing and have fun. Leave your comments if any.
Support Us: Share with your friends and groups.
Stay connected with us on social networking sites, Thank you.