View Single Post
  #7   (View Single Post)  
Old 2nd February 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 696
Default

Quote:
Originally Posted by TerryP View Post
Yes, if you install rsync & whatnot as necessary for the operation. The built in dump and restore programs should also be usable for that purpose.
This is how we do our restores, now that all our servers are being backed-up to a central server via rsync. The restore process is now (taken from our internal wiki):
Code:
Complete System Restore - FreeBSD

    * Boot replacement server off a FreeBSD LiveCD (Frenzy/FreeSBIE/etc)
    * Enable modifying of drives while the system is running

          sysctl -w kern.geom.debugflags=16 

    * Slice the drive into one large slice using the auto feature of fdisk/sade/sysinstall (whichever is available)
    * Partition the slice as needed (see fstab in the source server's etc directory)
          bsdlabel -e /dev/ad4s1 

          o You can specify partition sizes using "10g" format, put "unused" for the filesystem, and put "*" in for all the other fields to have it automatically fill in the blanks
 
    * Format the partitions as needed
          newfs -U /dev/ad4s1a 
          newfs -U /dev/ad4s1d 
          and so on 

    * Mount the partitions under /mnt
          mount /dev/ad4s1a /mnt 
          mkdir /mnt/usr /mnt/var /mnt/home 
          mount /dev/ad4s1d /mnt/usr 
          mount /dev/ad4s1e /mnt/var 
          mount /dev/ad4s1f /mnt/home 

    * cd to /mnt (not needed, but a good safety-net, just in case)

    * Run rsync to copy everything from Megadrive to the server

          Note 1: --numerical-ids is *very* important, do not forget this option, or things will fail in spectacular ways! 

          Note 2: -H is needed to restore hardlinks to various files. Without this, the restore will be huge, and will fail. FreeBSD uses hardlinks a lot! 

          rsync -vaH --partial --stats --numeric-ids --rsh=ssh --rsync-path="sudo rsync" username@source:/ /mnt/

    * Grab a coffee as it does the transfer. Takes about 20 minutes for a firewall image.

    * Install the standard boot blocks into the boot sector of the drive
          fdisk -B /dev/ad4 

    * Reboot the server to make sure everything comes up correctly.
I use Frenzy 1.1 for this. Works nicely, especially since it includes rsync.

Note: for the above to work, you need to have a user on the server that can run "sudo rsync", and that has SSH access to the source server.

Quote:
If the disks are the same size, I would probably use a live cd, dd, ssh, and gzip out of laziness; and skip the install disk all together.
See above. It's an almost painless process, and goes a lot quicker than doing a minimal install of FreeBSD. We're down to about 30 minutes to restore a server from backups, depending on how much data is on the server.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote