On Tue, 15 Nov 2022 09:27:05 -0500 rhkra...@gmail.com wrote: > I'm not really clear on the concept of a snapshot (for backup) -- > I've done a little googling but haven't found an explanation that > "satisfies" me. > > In this email I want to hyptothesize on what a snapshot might be in > the hope that others can correct / amplify it when I go wrong. > > Starting from a beginning, I suppose I could copy the entire contents > of whatever I wanted to make a snapshot of (by any of a variety of > tools -- dd, cp, ...) and call that a snapshot, although the more > common name for it would be a "full backup". > > Later, I could copy any files (as files) that have changed since the > date I made the full backup and call that a snapshot. (I might use > find to identify the files that have changed, and then any of a > variety of tools to actually copy them somewhere (and call that a > shapshot).) > > I suppose it wouild be possible to do something like this at a block > level, that is copying only blocks of a file which have changed. > (Not sure which commands might help me do that, but I don't think I'd > really be interested in doing that.) > > I also hear (i.e., read) statements from which I infer that some > snapshots included only the metadata of the files (or blocks???), but > I'm not sure of the value of either of those to me -- how can you > reconstruct a possibly missing file (or block) from the metadata? > > Thanks! >
LVM can be used to make a snapshot, which can then be copied to make a consistent backup. Here's one tutorial, there are others: https://devconnected.com/lvm-snapshots-backup-and-restore-on-linux/ It's obviously easier if you already use LVM for your filesystems. You need unallocated space, preferably as large as the entity you are copying, though on a quiet system you can get away with less. If you run out of space during the snapshot, it is worthless, and you need to start again. You can create an LVM volume on an external drive. Here are a couple of explanations of LVM snaphots, which is somewhat similar to how the Shadow Copy function of Windows works: https://www.thomas-krenn.com/en/wiki/LVM_Snapshots_Information https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-lvm-snapshots.html -- Joe