This quick approach is what I do when testing stuff on my servers. The commands are typed into a terminal (of course).
The steps needed are:
- Create a snapshot of root partition
- Install - Configure - Test - Evaluate
- Revert to snapshot (or not)
Here's how:
Create a snapshot of root partition
sudo lvcreate -s -n snap-root -L 10G lvm-vg/root
Logical volume "snap-root" createdThe snapshot is named: snap-root and is added to the list of Logical Volumes. You can check this by running: sudo lvs (It will also show how much of the 10GB snapshot have been used.)
Install - Configure - Test - Evaluate
Here's where you install and test new software.You know best what you want to test.
Run: sudo lvs to check how much of the snapshot have been used. If you exceed 100% you will not be able to revert to your initial snapshot.
Revert to snapshot (or not)
After having tested you are left with two possibilities; to keep your changes, or to revert to the state when creating the snapshot.Make sure your snapshot (snap-root) is not mounted; unmount it if it is.
To revert to snapshot:
sudo lvconvert --merge lvm-vg/snap-root
sudo reboot
To keep the changes:
-
sudo lvremove lvm-vg/snap-root
Now wasn't that simple and easy?
No comments:
Post a Comment