Hi Peter,

On Thu, 2006-11-16 at 06:15 -0800, Peter Eriksson wrote:
> If I just backup the normal "current" filesystem on this backup server
> then I can always restore that and return to some known point -
> however all the snapshots are lost so after that crash my users won't
> be able to get back old files... I could restore multiple backups from
> various dates, but that will use up a lot of disk space.

Have you looked at the incremental zfs send/receive functionality ? It
allows you to take a backup archive of just the chances to a filesystem
between any two snapshots.

You could then take a full backup at a point far back in time, then take
incremental backups after that for each snapshot. There's no automatic
way to do that at the moment, but it should be easily scriptable.

The risk though, is that if you take a full backup, then 1...n
incremental backups after that, loosing an incremental backup somewhere
in the middle of your range will make it impossible to restore the
subsequent incremental backups [ see example below ].

Does that help at all ?

        cheers,
                        tim

[1] Here's an example:

Take a file system

# zfs list extra
NAME    USED  AVAIL  REFER  MOUNTPOINT
extra    85K  9.60G  24.5K  /extra

Add some data, and take an original full backup:

# mkfile 10m file1
# zfs snapshot [EMAIL PROTECTED]
# zfs send [EMAIL PROTECTED] > /tmp/extra-original.dat
# ls -alh /tmp/extra-original.dat
-rw-r--r--   1 root     root         10M Nov 16 14:32 /tmp/extra-original.dat

Now take some incremental backups, showing that they're only containing
the differences between data:

# mkfile 1m file2
# zfs snapshot [EMAIL PROTECTED]
# zfs send -i original [EMAIL PROTECTED] > /tmp/extra-recent.dat
# ls -alh /tmp/extra-recent.dat
-rw-r--r--   1 root     root        1.0M Nov 16 14:33 /tmp/extra-recent.dat
# mkfile 2m file3
# zfs snapshot [EMAIL PROTECTED]
# zfs send -i recent [EMAIL PROTECTED] > /tmp/extra-latest.dat
# ls -alh /tmp/extra-latest.dat
-rw-r--r--   1 root     root        2.0M Nov 16 14:34 /tmp/extra-latest.dat

Now destroy the filesystem (since it's top level, this just empties it)

# zfs destroy -r extra

And then try to receive the saved datasets, out of order - simulating us
loosing the [EMAIL PROTECTED] backup.

# zfs receive extra/restore < /tmp/extra-original.dat
# zfs receive -d extra/restore < /tmp/extra-latest.dat
cannot receive: most recent snapshot does not match incremental source

Okay, restore that first, and we're okay.

# zfs receive -d extra/restore < /tmp/extra-recent.dat
# zfs receive -d extra/restore < /tmp/extra-latest.dat
#



-- 
Tim Foster, Sun Microsystems Inc, Solaris Engineering Ops
http://blogs.sun.com/timf

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to