Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to restore LVM configuration to a PV similar to vgcfgrestore #565

Open
spictera opened this issue Sep 16, 2020 · 1 comment
Open

how to restore LVM configuration to a PV similar to vgcfgrestore #565

spictera opened this issue Sep 16, 2020 · 1 comment
Assignees

Comments

@spictera
Copy link

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", "" as described here:
bd_extra_arg_new ()
But that is only the first step of the two, and is honestly useless as I only want to save the LVM metadata config to the PV.

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

@vojtechtrefny
Copy link
Member

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.

@vojtechtrefny vojtechtrefny removed the 3.0 label Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants