[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Filesystem snapshots
On Sat, Apr 16, 2016 at 10:42:40AM +0100, John wrote:
> In order to archive data when constant updating takes place, even
> just an email INBOX or a SQL database, the data has to stop
> changing. The frozen unchanging data is the source for the archive
> and an overspill area, called - very misleadingly - a snapshot, can
> accumulate written blocks of fresh data. When the archive is
> finished, the snapshot can be merged back into the original files
> and deleted.
I've never used LVM, but this sounds suspicious to me. Shouldn't you be
making the backup from a read-only copy of your filesystem? I don't
understand why there is anything that needs to be merged.
> My X system has remained up but logged off throughout this nightly
> crontab root script, and that's kept files open and updating on
> /home. The merge has only been queued by the lvconvert command and
> will only take effect when /home is unmounted and then mounted
> again. I need to automate closing X, unmounting and remounting /home
> and starting X again and I can't think how to do that neatly within
> the crontab root script.
Hmm. This page about LVM:
http://www.tldp.org/HOWTO/LVM-HOWTO/snapshots_backup.html
doesn't include any merging. It's simply:
1. create a snapshot (with a note that LVM1 defaults to read-only, while
LVM2 defaults to read/write. I suggest using read-only snapshots)
2. mount the snapshot
3. do the backup
4. unmount and lvremove the snapshot
... thinking through this a bit more, are you storing your tarsnap cache
directory on the partition which is being backed up? That would be a
plausible reason for wanting it to be read/write, but my first thought is that
it would be to use read-only snapshots and put the cache on another partition.
Hope this helps!
- Graham