2. 2 / 5
LVM's Archive Feature
This feature can be of great help administrator in
situation that he mess up with LVM disk.
● How does archive feature work?
– LVM can keep archived copies of volume group
metadata. If the archive option is set to 1 in
/etc/lvm/lvm.conf.
– These archives can be found in /etc/lvm/archive.
3. 3 / 5
LVM's Archive
● Display all LVM archive
– /etc/lvm/archive
– vgcfgrestore -l <vgname> “command”
● Vgcfgrestore shows the sequence of recent actions
performed on the volume group.
● Some details
– Description: Created *before* executing
– Description: Created *after* executing
4. 4 / 5
Undo an LVM Change
● To undo an LVM change, make sure that the logical
volume is not currently in use (unmount logical
volume)
● vgcfgrestore -f <archive_file> + vg.
– Archive_file : from vgcfgrestore -l vg.
● Deactivate and then Reactivate the logical volume
to committed the change in memory
– lvchange -an “lvm”
– lvchange -ay “lvm”
5. 5 / 5
Lab Reverting LVM Changes
Junior admin has be asked to create LVM disk
/dev/vg1/app_data with size +512M. He created
LVM filesystem type xfs. After two weeks senior
discovered that junior doesn’t follow the rule of
fileystsem type. He asked him again to create new
LVM with filesystem type ext4 and move the data
from old LVM to know LVM. By mistake deleted the
wrong LVM which has the data .Then he came to
you to help him.
How are you going to solve this issue?
6. 5 / 5
Lab Reverting LVM Changes
Junior admin has be asked to create LVM disk
/dev/vg1/app_data with size +512M. He created
LVM filesystem type xfs. After two weeks senior
discovered that junior doesn’t follow the rule of
fileystsem type. He asked him again to create new
LVM with filesystem type ext4 and move the data
from old LVM to know LVM. By mistake deleted the
wrong LVM which has the data .Then he came to
you to help him.
How are you going to solve this issue?