Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to recover a deleted LVM volume but can't see to get the syntax right.

Running the following command gives me a list of backed up LVM volumes:

root@usaxen02:[~]$ vgcfgrestore -l fluidVG_125094317679

------- snip ---------

File:
/etc/lvm/archive/fluidVG_125094317679_00126-1479850541.vg VG name:
fluidVG_125094317679 Description: Created before executing 'lvremove /dev/fluidVG_125094317679/mars.x.com_root_125152080771' Backup Time: Tue Aug 2 17:40:44 2011

File: /etc/lvm/backup/fluidVG_125094317679 VG name:
fluidVG_125094317679 Description: Created after executing 'lvremove /dev/fluidVG_125094317679/mars.x.com_root_125152080771' Backup Time: Tue Aug 2 17:40:44 2011

So I want to recover mars.x.com_root_125152080771 and issue the following command:

root@usaxen02:[~]$ vgcfgrestore -f fluidVG_125094317679 mars.x.com_root_125152080771 fluidVG_125094317679: stat failed: No such file or directory Couldn't read volume group metadata. Restore failed.

root@usaxen02:[~]$ vgcfgrestore -f fluidVG_125094317679 Please specify a single volume group to restore.

root@usaxen02:[~]$ vgcfgrestore -f mars.x.com_root_125152080771 Please specify a single volume group to restore.

All different attempts, which apparently should work according to some google search results I've found but doesn't.

Another attempt:

root@usaxen02:[~]$ vgcfgrestore -vvt /etc/lvm/archive/fluidVG_125094317679_00126-1479850541.vg fluidVG_125094317679 Test mode: Metadata will NOT be updated. Setting global/locking_type to 1 global/wait_for_locks not found in config: defaulting to 1 File-based locking selected. Setting global/locking_dir to /var/lock/lvm Please specify a single volume group to restore. Test mode: Wiping internal cache Wiping internal VG cache

Does anyone know what the correct syntax should be on CentOS 5.5?

share|improve this question

1 Answer 1

Looking at the manpage, it seems that you need to do something like

vgcfgrestore -f /etc/lvm/archive/fluidVG_125094317679_00126-1479850541.vg fluidVG_125094317679

So you are restoring a volume group named fluidVG_125094317679 using the information from the file from before it was deleted. Without -f, it uses the most recent file (which according to your list output was after it was deleted), with -f, you still have to specify the vg name.

share|improve this answer
    
Thank you that helped –  SoftDux-Rudi Oct 24 '11 at 7:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.