Half a Mirror Backup

Matthew Seaman m.seaman at infracaninophile.co.uk
Sun Jan 2 21:39:23 UTC 2011

On 02/01/2011 20:30, David Brodbeck wrote:
> On Sun, Jan 2, 2011 at 11:56 AM, Jason C. Wells <jcw at speakeasy.net> wrote:
>> Is using one half of a mirror as a backup a good/bad idea?
>> I was thinking of rotating drives on a periodic basis as a back up method.
>>  You'd get the backup instantly, but rebuilding the mirror with the incoming
>> drive would take a little time and leave you vulnerable to a small loss of
>> data if a disk failed while the mirror was rebuilding.
> Besides the problem you mention, you'll have a pretty sizable
> performance hit while the mirror is being rebuilt.  Also, keep in mind
> that the most likely time for a second drive to fail is during a
> rebuild, since the rebuild forces a read from every sector.  I think I
> would use rsync or dump instead, although I have to admit the rotating
> mirror idea is clever.

It's a well known and really pretty clever technique to obtain a
point-in-time image of a filesystem without needing lengthy outages.
Two points:

  1) The classic way of doing this without losing resilience is to use
     a mirror of three disks.  Typically you'ld attach a third drive
     to the existing mirror, let it synch its contents, detach it and
     then backup the third disk's content to tape at leisure.

  2) It's rendered pretty much obsolete if you have a filesystem that
     you can snapshot.  Which you can for both UFS and ZFS.  Take
     snapshots of your filesystems, mount the snapshots and back them
     up.  It's exceedingly easy with ZFS(*), and only slightly more
     involved with UFS.

In fact, snapshotting ZFS is so easy, that it is common practice to
create snapshots at regular intervals -- hourly is not unknown -- and
keep several days worth on-line as insurance against accidental
deletions and so forth.

Note: this does *not* constitute a proper backup. Without off-line
copies (or preferably off-site copies) if your computer gets destroyed
by fire, flood or whatever, then you will loose your data.



(*) Hint: ZFS snapshots automount at
/${filesystem}/.zfs/snapshot/${snapname} if you just cd to that directory.

Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
JID: matthew at infracaninophile.co.uk               Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20110102/8ca68668/signature.pgp

More information about the freebsd-questions mailing list