Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 1999 22:17:34 -0500 (EST)
From:      "Crist J. Clark" <cjc@cc942873-a.ewndsr1.nj.home.com>
To:        mwlucas@blackhelicopters.org (Michael Lucas)
Cc:        questions@FreeBSD.ORG
Subject:   Re: backup to live system?
Message-ID:  <199912040317.WAA32773@cc942873-a.ewndsr1.nj.home.com>
In-Reply-To: <199912022227.RAA38934@blackhelicopters.org> from Michael Lucas at "Dec 2, 1999 05:27:40 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Michael Lucas wrote,
> Hello,
> 
> A client has a 3-stable machine on the exposed Internet that is
> providing vital services for his company.  It's a private T1, private
> Ethernet, but moderately visible.  We have tape backups, but it would
> still take a while to rebuild this machine.  There would be fairly
> heavy costs associated with downtime.  The OS is rock-stable, but it's
> still fair-to-middlin x86 hardware.
> 
> We're considering having this machine back itself up every night to
> another machine on the same network, essentially making a
> cold-swappable backup.  We'd copy /home to /home, /etc to /etc2, and so
> on for all the vital system files.
> 
> This way, if machine 1 starts smoking we move /etc/rc, reboot, and boom!
> we're back up.
> 
> Would anyone out there care to share their experiences and methods of
> doing this?  I can think of a couple methods off the top of my head,
> but I'd prefer to learn from others' mistakes.  ;)

I have been trying to devise something similar for a mailserver and a
backup.  What I originally did was just run nightly job on the backup
machine that sucked up specific files that are required for proper
operation and that change fairly often. Then, I had a script that
would put all of these files in the right place and start (or restart)
all of the processes the machine needed to take the place of the
server.

I have since grown disastisfied. Making the list of files is tedious
and you always wonder if you missed something important. The script to
transform the box is way complicated, and I'd worry so much something
didn't go right, I'd probably reboot after it put the files in place
anyway.

However, I have a new idea that I like much better. The backup machine
has a barebones installation of FreeBSD on one partition. In addition,
there are partitions that mirror the primary server. The backup
machine does something like,

for FS in / /usr /var; do
   cd ${FS}.bak
   ssh $SERVER dump -$LEVEL $FS -f - | restore -xf -
done

With some regularity. Where /.bak, /usr.bak, and /var.bak will be the
mirrors of the servers filesytems on the local machine (this is
simplified and I personally wouldn't like a mounted FS named /.bak
;).

Now, you should create the backup partitions so the device names on
the backup are the same as their counterpart on the server (or
otherwise handle /.bak/etc/fstab). Have the backup machine default to
booting off of its independent minimal FreeBSD install, but if you
ever need to convert it to the server, reboot and manually boot from
the backed up root partition.

A convenient way to do that would be to put your minimal install in
one slice and then put the backup partitions in another slice (you
have to have them live in the same slice as the server or otherwise
handle fstab again), and then all you would need to do is pick F1 or
F2 to boot it as the backup or as the replacement server!

Anyway, I've got this partially working on a machine of mine, but for
various reasons it is not completely validated. The hardware is
different enought to make trouble, I need to boot from floppy, there
are specific files I do _NOT_ want to backup and the nodump flag does
not seem to work as I would expect, and I just have not had the time
to work on it lately... but I think it will be k00l. :)
-- 
Crist J. Clark                           cjclark@home.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199912040317.WAA32773>