HOWTO Restore a FreeBSD system using the fixit CD

dex djdexter at gmail.com
Tue Feb 27 00:26:45 UTC 2007


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 at 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 at 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 at host.domain.local cd /usr/home;
/sbin/restore -ruvyf -
===============



More information about the freebsd-doc mailing list