0

I created a snapshot with

lvcreate -n snap01.vm01 -L 5G -s vg0/vm01.eclabs.de

now I did some stuff on my disk i don't want to keep and want to revert it to the snapshot point.

How do I restore the snapshot?

I tried to copy the snapshot with dd like:

dd if=/dev/vg0/snap01.vm01 | pv | dd of=/dev/vg0/vm01.eclabs.de-restore

but although the file is only 5GB the dd process continues to copy things for hours. Is this sthe correct way?

0

You can restore an LVM snapshot with

lvconvert --merge <snapshot path>

In the example above: To revert back to snap0.vm01 snapshot, which was taken for vg0/vm01.eclabs.de :

umount  /dev/vg0/vm01.eclabs.de
lvconvert --merge /dev/vg0/snap01.vm01

see http://www.switchroot.com/how-to-rollback-a-lvm-volume-to-its-snapshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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