On Thu, 27 Feb 2020 08:54:02 +1100 Keith Bainbridge <keithr...@gmail.com> wrote:
> > > I'm having trouble understanding how LVM snapshots works on / if it > is outside the LVM. > I don't think anyone has picked this up. Yes, you do need additional space. I've only done it a few times. It basically involves leaving enough unallocated space to accommodate whatever you want to do with the snapshot. What I used it for was on-line system backup. You can generally get away with just copying a Linux system while it is running, if not much is going on at the time, particularly if you temporarily stop SQL servers and the like. Various volatile files won't be consistent, being copied at different times, but if they are general housekeeping files which are constantly being re-written, then the contents won't matter much after a restore and reboot. Yes, some inconsistencies can be critical, and restoring it in full over your working system is a bit risky. Using it to restore individual files is generally safe, for most people a full restore from backup would be a last resort (OK, second last, just before reinstalling). But I've booted an online copy on another machine on several occasions without (as far as I know) any issues. If you want an absolutely consistent backup (e.g. copying to a bigger hard drive), you either shut down and take it with an external tool, or you can use LVM. When you enable the snapshot, the region of interest is frozen, further disc writes are basically done to a journal, not to the frozen region, and the journal is reconciled with its parent region when you close the snapshot. In the meantime, you can take a backup where no disc files will change while you're doing it. You need enough space for the snapshot to store everything that may written until you terminate the snapshot, but with modern discs you can generally allocate as much space as the largest region you want to back up, which is the safe option. Performance will be a bit reduced during the snapshot period, but that depends on what the system is being used for, how much writing is going on, and in any case a system backup itself will slow things down a lot. Windows Server partitions with Volume Shadow enabled do something like this continuously, managing daily snapshots and deleting old ones up to the limit of allocated space. Read the current docs for exact details of how to do this. -- Joe