Forum Moderators: bakedjake
i've just got my first rsync script running by cron and i can't believe i've never used something like this before - a great utility!
my question, not really understanding that much about the linux OS, is whether i can completely mirror my redhat box to a separate location, and in the event of a complete hard drive failure, simply 'roll back' by copying the entire contents of my backup to a new disk, reboot and carry on as normal?
or would i have to configure apache, php, sendmail, etc... before copying back over?
many thanks :-)
My understanding is that you've got server1 and backup1. Backup1 has its own system drive (/) and the hot spare for server1 mounted on /hotspare. For the sake of simplicity, everything is on one partition.
You're going to rsync server1:/ to backup1:/hotspare such that if you removed /hotspare it would have identical file contents to server1.
The problem occurs when you fail server1. Shut down both machines. Toss server1's disk, replace with backup1's hot spare or a copy thereof.
When you boot, there is no boot sector on server1 because it's not a file that rsync can see, it is a few bytes outside of the filesystem.
What you have to do is apply the boot sector to the hotspare drive (or copy) while it is in backup1. I would also suggest using grub because with LILO, you'd have to rebuild the boot sector on both drives every time you upgraded your kernel. Grub just reads grub.conf to find out which kernel to boot, so as long as the files are the same, you can find the kernel.
You're also going to run into some fun because the drive numbering changes when it goes from backup1 to server1, and grub might look in the wrong place if you didn't configure it properly. You'll want to practice this a few times before going into production to make sure it works smoothly. Luckily, as long as it can find the boot sector, you should be able to get into a grub shell, which can then be used to boot the new kernel by hand.
A low tech way of getting around this is to boot from a boot floppy ;)
Hope this makes sense.
Sean