how to restore LVM configuration to a PV similar to vgcfgrestore
Hi,
In classic commercial HP-UX, one can restore the LVM metadata using
vgcfgrestore /etc/lvm/backup/vg.cnf /dev/c0t0d0
Similar features exists in Linux version of LVM, but requires two steps.
pvcreate -u <uid nr> /dev/sda
vgcfgrestore <your vg> /etc/lvm/backup/vg.cnf
I am trying to find a way to use the libblockdev api to recreate the LVM metadata to a disk
But could not find a way how to do this.
I assume the bd_lvm_pvcreate() can be used in combination with an extra argument to create the PV using "-u", "
Do you have any good idea of how this can be done? Or do you have any plans to create such features or vgcfgrestore feature ?
Looking forward to here your opinion of this.
Regards Tomas
We currently don't support vgcfgrestore, but we can definitely add this to the LVM plugin. I've checked lvmdbusd which we use to interact with LVM and it also doesn't support the VG restore operation, but it can also be added, I did it in the past for some functions.