[linux-lvm] Using LVM snapshots for hourly backups
anthony at overnetdata.com
Tue Oct 10 20:00:57 UTC 2006
I'm trying to work out if there's a way to use LVM snapshots to create
hourly backups of my data. I realise that this doesn't protect me
against disk/machine failure, but it would really handy in cases where I
want easy access to historical files, e.g where I accidentally
change/delete a file or I want to compare historical files/directories
to the current versions to see what's been changed.
I thought a really simple and ingeneous approach would be to use LVM
snapshots so that each hour I make a snapshot, and remove the snapshot
from 24 hours ago, thus having a rolling hourly backup. However when I
tried this I ended up with 24 snapshots of the original volume which
means a single change to the original volume causes each snapshot to do
a Copy on Write of the changed block, so if I change one block on the
original volume the snapshots create 24 copies of the original volume
which isn't very good for disk performance or disk usage!!
What I'd really want is to daisy-chain the snapshots so that
snapshot-3hours is a snapshot of snapshot-2hours, which is a snapshot of
snapshot-1hour, which is a snapshot of the original volume, thus if a
block in the original volume changes only snapshot-1hour is changed and
once a snapshot is older than an hour it cannot change any more.
I notice that you can't make snapshots of snapshots, so I suspect what
I'm looking for isn't possible, but I thought I check and if it isn't
possible suggest it as a really useful feature for the future. Your
thoughts/comments would be welcome.
More information about the linux-lvm