vgcfgrestore + pvcreate using liblockdev api in C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi

Is there an api available today or an example how to perform the below OS commands in C using a function or api instead of system calls?

1. create an unique uid on the server, and store it on the PV disk

# pvcreatue -u <generated uid> <your device>

2. create the LVM metadata backup content (as /etc/lvm/backup/...)
- add PV uid generated above as there is no parameter to save the data to a device
- add unique VG
- add exactly 1 contiguous LV

3. save LVM metadata to the PV disk as the OS command does

# vgcfgrestore VG

Can this be done by instead of using system() calls, instead using native C commands either via an API or other methods?

the examples for bd_lvm_pvcreate() in libblockdevapi for example does not say how to add -u flag
and I couldn’t find any vgcfgrestore there too?

besides this, I found it strange why pvcreate -u is needed at all? would be better to have a <dev> parameter directly to the vgcfgrestore command instead

looking forward to hearing from you soon again 

regards Tomas

Sent from my iPhone


_______________________________________________
linux-lvm mailing list
linux-lvm@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux