Best way to "revert" to LVM snapshot?



Hi all,

I'm using LVM for all the partitions on my main hard drive (boot partition
excepted) for the ability to take "snapshots" of the partitions at a
particular point in time.

Anyway, while I have figured out perfectly how to take snapshots, mount
them, and read/write to/from them, I have yet to find a good way to *revert*
volumes (in particular, my root volume) to the state they were as of the
snapshots. Currently, what I am doing to "revert" my root volume is:

1. Reboot from a separate volume with the Debian base system installed
2. lvcreate a new volume with the same size as my root volume
3. cp /dev/debian/snapshot /dev/debian/new_volume
4. lvrename /dev/debian/root /dev/debian/something_else
5. lvrename /dev/debian/new_volume /dev/debian/root

This works fine. However, it is - of course - quite tedious, as it requires
copying some 10GB worth of data. Does anyone know of a better way?
Possibly using rsync? I may want to do this quite often in the future, as I
plan on testing all sorts of somewhat-hairy things on this system and want
to be able to easily revert to a snapshot.

Tim


Relevant Pages

  • Re: 5.1-R-p11 unable to "sync disks" when shutting down
    ... > is partitions larger than 30G or so) partitions with more than one ... I don't use snapshots any more. ... I did use snapshots via bgfsck, ... I've mailed to -current about the above-mentioned panics and the message ...
    (freebsd-current)
  • Re: [9fans] Corrupted file entry on QEMU - how to recover?
    ... I'm trying to get function definitions off of the plan9 file so I can rebuild my profile. ... The disk data structures are all described in /sys/doc/fossil.ps. ... If you were using snapshots, then you might be able to ... hopefully not corrupt, root. ...
    (comp.os.plan9)
  • Re: [9fans] Corrupted file entry on QEMU - how to recover?
    ... I decided to take a peek at the corrupted entry. ... This causes the sourceAlloc() function to fail, and thus I can't get a source without the program crashing. ... If you were using snapshots, then you might be able to ... hopefully not corrupt, root. ...
    (comp.os.plan9)
  • Re: [9fans] Corrupted file entry on QEMU - how to recover?
    ... Until then, I managed to free up a lot of space, so this time I'll put up a new 4GB QEMU fossil+venti Plan 9 and save the old disk until I can fix it. ... If you were using snapshots, then you might be able to ... could rewrite the super block to point at an older, ... hopefully not corrupt, root. ...
    (comp.os.plan9)
  • Re: [9fans] Corrupted file entry on QEMU - how to recover?
    ... The disk data structures are all described in /sys/doc/fossil.ps. ... If you were using snapshots, then you might be able to ... hopefully not corrupt, root. ...
    (comp.os.plan9)