Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Feb 2007 19:00:43 -0500
From:      dex <djdexter@gmail.com>
To:        freebsd-doc@freebsd.org
Subject:   RE: HOWTO Restore a FreeBSD system using the fixit CD
Message-ID:  <c357d2a10702261600u21a4213foc58f4477857227ac@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
This is a response to an old email.  I wasn't able to find the actual
HOWTO other than in the mailing list archives, so I figured I'd just
post.  I have an addendum to the Step Four restore command.

A more flexible way to restore would be via network.  To backup I
usually do something like this (from a Windows host, which runs the
software for our tape library):

  > "C:\Program Files\PuTTY\plink" -batch -i
"%userprofile%/backup.ppk" backup@host.domain.local /usr/bin/nice
/sbin/dump -0Lauf - / | gzip -c > host-root-full.dump.gz

So now the dump file is on the backup hosts' HD which is also
accessible via password protected HTTP.  On the new system, boot from
FreeBSD CD 1, setup networking (under Configure, Networking,
Interfaces), partition and format your HD like you want - following
the instructions in the HOWTO, then when you get to the restore
command it would be something like this:

  # /mnt2/usr/bin/ftp -o -
http://username:password@backup.domain.local/host-root-full.dump.gz |
/bin/zcat | /mnt2/sbin/restore -ruvyf -

Most of the documentation I've seen involves using dump/restore with a
tape drive or from some sort of mount.  For me and possibly others,
this method is much more flexible.

If you need better security, it's also possible to initiate the
restore from the backup server so it doesn't have to listen to any
outside requests and therefore can't be cracked as easy.   Use SSH
instead of HTTP, assuming your network transport is insecure.  That
would look something like this:


===============
  -The system you are restoring to should have a base install
(minimal) of FreeBSD near the same version of the one you are
restoring.  The closer the better, since that will reduce the chance
of the root fs not restoring properly since some required stuff for
ssh is under both that and /usr.

  -Make sure you restore all other mount points before /.  With recent
versions (>6.1), it's best to also transfer the root dump file over to
/var/tmp so you have it available for restore if sshd breaks because
of the /usr restore (get errors about 'Binary file not executable').

  -Make a backup of /etc/fstab if the destination FS's and device
names aren't the same as the original server, then restore it before
you reboot the server.  For example, after restoring /var put a copy
of /etc/fstab in /var/tmp, restore /, then 'cp /var/tmp/fstab /etc'.

  -kill non-vital services except sshd, so you don't have daemons
going crazy while fs structures change out from under them.

  -Don't worry if you see a "cannot open /dev/tty: Device not
configured" error, it's just cd complaining.

  -You will probably have to do a 'cd /; chflags -R noschg *' on the
destination server before restoring /usr and /.

  -If using cygwin the command would look something like this:
bash -c "zcat host-usrhome-full.dump.gz | ssh root@host.domain.local
'cd /usr/home; /sbin/restore -ruvyf -'"

  -If using putty/plink it would look something like this:
zcat host-usrhome-full.dump.gz | "C:\Program Files\PuTTY\plink" -i
"%userprofile%/backup.ppk" root@host.domain.local cd /usr/home;
/sbin/restore -ruvyf -
===============



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