[kwlug-disc] proactive - restore a SLES box

Paul Nijjar paul_nijjar at yahoo.ca
Wed Sep 22 16:43:20 EDT 2010


On Wed, Sep 22, 2010 at 01:42:39PM -0400, Oksana Goertzen wrote:

> I'm looking for some advice on restoring a SLES box (SLES 10).  This
> server is fairly critical to our environment and I'm wondering what
> would be the best way to make sure I have all the files I need to
> restore this box fully and what is the best way to do that?  What do
> I need to back up?

My quick and dirty solution is to create a bootable mirror of the main
drive, and then update the mirror once a day. This gives me protection
in case my main drive fails. 

I am super-lazy and usually put the mirror in the same chassis as the
main drive, which is dumb if there is lightning or theft but okay if
one drive spontaneously fails. But you could use a similar technique
for a drive mounted on a remote server somewhere. 

This does not scale well for enterprise environments, I am guessing. But 
for a standalone server with only a few hard drives it gives me 
some peace of mind. 

Below are my notes (which are a bit out of date, since they used GRUB
1. I don't know what SLES uses.)

If restoring from a day-old mirror is not good enough then you could
use this as a base solution and then restore your more-frequent
backups over this. 

Using labels for your partitions (as opposed to UUIDs) will make
booting from the new drive much easier. 

- Paul


================

Making a fully-bootable mirror: 

• Partition (and format) both drives identically
• Install grub on second drive (using chroot?) 
	○ grub-install /dev/sdb   
• Use the following rsync line to copy all the non-dynamic stuff over. (I run this as a script from cron once per day). This assumes that the backup drive gets mounted to /usr/local/mirror.  DO NOT put a period in the name of the file or it won't be executed!

#!/bin/sh

rsync --archive --hard-links --delete \
  --exclude=/proc \
  --exclude=/sys \
  --exclude=/etc/fstab \
  --exclude=/usr/local/mirror \
  --exclude=/lost+found \
  / /usr/local/mirror

• On the second drive, create the missing directories. 
	○ chroot /usr/local/backup
	○ mkdir /proc /sys
• Copy the /etc/fstab file over and change the entries so that the second drive is primary, and the primary drive gets mounted to /usr/local/backup
• Change the /etc/grub/menu.lst to add entries for the second drive




-- 
http://pnijjar.freeshell.org





More information about the kwlug-disc mailing list