backups using rsync

CyberLeo Kitsana cyberleo at
Mon Mar 4 21:37:22 UTC 2013

On 03/04/2013 05:35 AM, Ronald F. Guilmette wrote:
> As a result of this past Black Friday weekend, I now enjoy a true abundance
> of disk space, for the first time in my life.
> I wanna make a full backup, on a weekly basis, of my main system's shiny
> new 1TB drive onto another 1TB drive that I also picked up cheap back on
> Black Friday.
> I've been planning to set this up for some long time now, but I've only
> gotten 'round to working on it now.
> Now, unfortunately, I have just been bitten by the evil... and apparently
> widely known (except to me)... ``You can't use dump(8) to dump a journaled
> filesystem with soft updates'' bug-a-boo.

You can use dump(8) to dump a SU-journaled filesystem; you just cannot
create a snapshot. This implies that dump(8) will be run against the
live and possibly changing filesystem, which can lead to issues with the
consistency of the contents of files thus dumped; but not necessarily
with the consistency of the dump itself. Any tool that backs up a live
filesystem, such as rsync or tar, will have these issues.

> Sigh.  The best laid plans of mice and men...
> I _had_ planned on using dump/restore and making backups from live mounted
> filesystems while the system was running.  But I really don't want to have
> to take the system down to single-user mode every week for a few hours while
> I'm making my disk-to-disk backup.  So now I'm looking at doing the backups
> using rsync.

I've used rsync to back up Linux and FreeBSD machines daily for years,
and I've never had a problem with the backups nor subsequent
restorations. Especially for restorations of the laptop that ate SSDs.

Having a decent snapshot capability on the backup target filesystem can
help a lot if you want to maintain multiple sparse backup revisions;
otherwise, you're stuck using creative scripting around rsync's
--link-dest option.

> I see that rsync can nowadays properly cope with all sorts of oddities,
> like fer instance device files, hard-linked files, ACLs, file attributes,
> and all sorts of other unusual but important filesystem thingies.  That's
> good news, but I still have to ask the obvious question:
> If I use all of the following rsync options...  -a,-H,-A, -X, and -S ....
> when trying to make my backups, and if I do whatever additional fiddling
> is necessary to insure that I separately copy over the MBR and boot loader
> also to my backup drive, then is there any reason that, in the event of
> a sudden meteor shower that takes out my primary disk drive while leaving
> my backup drive intact, I can't just unplug my old primary drive, plug in
> my (rsync-created) backup drive, reboot and be back in the sadddle again,
> almost immediately, and with -zero- problems?

There will /always/ be problems. The best you can do is become familiar
with the tools and procedures so you can tackle them when they happen.

My suggestion for something that you can use as a warm standby is to
create it as a warm standby: go through the entire installation
procedure again for the backup drive, and then use rsync or suchlike to
periodically synchronize the second filesystem with the first. When you
update the boot code on one, do so on the other.

Be extremely careful if you decide to do this with both disks attached
to the same machine: if you use geom labels (gpt, ufs, glabel, et alia)
or dynamically numbered storage devices, you can easily run into a
situation where a reboot with both devices attached suddenly starts
using your backup instead without you realizing it, or flips back and forth.

> P.S.  My apologies if I've already asked this exact same question here
> before.  I'm getting a sense of deja vu... or else a feeling that I am
> often running around in circles, chasing my own tail.
> P.P.S.  Before anyone asks, no I really _do not_ want to just use RAID
> as my one and only backup strategy.  RAID is swell if your only problem
> is hardware failures.  As far as I know however it will not save your
> bacon in the event of a fumble fingers "rm -rf *" moment.  Only frequent
> and routine actual backups can do that.

Fuzzy love,
Furry Peace! -

More information about the freebsd-questions mailing list