Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I want to start making snapshots of my system LV once every two weeks, so that I can roll back quickly if I mess up my system configuration somehow. I can make a snapshot by following the instructions in the manual pages, but I am unclear on one point: do I have to create a new snapshot each time (i.e., after deleting the old one) or is there some command to make a existing snapshot "forget" its original state and start tracking changes again from a fresh point?
Well with the way that a snapshot works I would suggest that it's not like that in the first place. You have a fixed amount of space assigned to the snapshots, say 20% of the partiton. So once the live state has been changed to the extent of having to use the spare 20% of the disk space, there is no longer any space to keep the old snapshot in one piece, and as such it is invalid. If you make 2 snapshots, one after half that 20% has been used up, then the first 10% is only relevant to the first snapshot, then 2nd 10% that makes up the first snapshots 20% is also common to the 2nd snapshot. There is no cost to making as many snapshots as you wish, and it's not like you could create a snapshot, create a large file, delete that file and then have LVM magically know that the two filesystems (live and snapshot) are actually identical, it doesn't (afaik) track anything intelligently like that at all, no undo's etc, so the changes are completely linear - thus 10 snapshots still use up the "same amount of resources" as the very oldest one in that list.
Or at least, that's the way *I* understand it. If you understand me...
And so for your question, it doesn't matter about the old one either way. Delete it proactively if you wish, but it won't have any implications for any other snapshots.
I haven't had my first cup of coffee yet, so you lost me there Chris...
I recently tested btrfs snapshot on Fedora - taking auto snapshots on yum updates (think "emerge world"). Nice idea similar to what the OP is thinking of. Snapshots are a "point in time" copy. End of discussion.
They are "lightweight" (supposedly) because they are a cow (copy-on-write) implementation. Problem I found was that because I took them just before each update, the snap effectively became the size of the update. I hadn't bothered to implement a deletion regime (because they are "lightweight" remember - d'oh) and quickly burned 20 Gig of my root partition. That resulted in a full filesystem till I figured out what had happened.
Short answer - delete the old(est) snaps, and enjoy the convenience - same concepts apply to both LVM and btrfs for this AFAIK.
so comparing that with lvm, the about is in reserved space in the partition, which is fixed, so you can never gave them cause you to run out of space, they just become invalid if the size if the changed data is larger then the reserved snapshot space.