[CentOS] Cloning CentOS workstations

Fri Sep 13 20:51:02 UTC 2013
Glenn Eychaner <geychaner at mac.com>

I manage a set of CentOS operations workstations which are all clones of each
other (3 "live" and 1 "spare" kept powered down); each has a single drive with
four partitions (/boot, /, /home, swap). I've already set up cron'd rsync jobs
to copy the operations accounts between the workstations on a daily basis,
so that when one fails, it is a simple, quick process to swap in the spare,
restore the accounts from one of the others, and continue operations. This has
been successfully tested in practice on more than one occasion.

However, when I perform system updates (about once a month), I like to create
a temporary "clone" of the system to an external drive before running the
update, so that I can simply swap drives or clone back if something goes
horribly wrong. I have been using "CloneZilla" to do this, but it can take a
while since it blanks each partition before copying, and requires a system
shutdown.

Question 1: Would it be sufficient to simply use CloneZilla once to initialize
the backup drive (or do it manually, but CloneZilla makes it easy-peasy), and
then use "rsync -aHx --delete" (let me know if I missed an important rsync
option) to update the clone partitions from then on? I am assuming that the
MBR typically doesn't get rewritten during system updates, though
"/etc/grub.conf" obviously does get changed.

Suppose I want to store more than one workstation on a single drive (easy),
and be able to boot into any of the stored configurations (hard). Here's what
I thought of:
1) Create a small "master" partition which contains a bootloader (such as a
CentOS rescue disk), and a single "swap" partition.
2) Create one partition "set" per workstation (/boot, /, /home, excluding
swap). Obviously, these will all likely be logical, and each workstation must
use unique labels for mounting partitions.
3) On the "master" partition, modify the bootloader menu to allow one to
chainload the /boot partitions for each configuration. (This is the "Voila!"
step that I haven't fully figured out.)

Question 2: Is there a better way to do the above? How do I perform the
"Voila!" step, i.e. what's the right chainload command for this? Also, the
chainloaded partitions are logical; is this OK?

I also have a single off-site NAS disk which contains clones of all the
critical workstations on-site. Most of them are Macs, so I can use
sparseimages on the NAS for the clones and get easy-peasy incremental
clones. I also do this for the Linux box (backing it up incrementally to an
HFS case-sensitive sparseimage via rsync), but it's (obviously) a bit of a
kludge.

Question 3: Is there a UNIX equivalent to the Mac sparseimage that I should be
using for this? ("tar -u" can do it (duh), but then the backup file grows
without bound.)

Thanks,
-G.
--
Glenn Eychaner (geychaner at lco.cl)
Telescope Systems Programmer, Las Campanas Observatory