Linux disk clone: tar vs special clone utility

clonelinux

My situation is as follows. I have installed Debian Lenny, including Apache, MySQL, etc., on a master machine. Now I would like to be able to perform the same installation over and over again.

I can see 2 solutions:

  • Create a big tar file from the master machine and un-tar it onto the slaves.
  • Use some specialized software for that matter, e.g. Clonezilla.

Are there any drawbacks on using the first method?

P.S. I would like to setup software RAID 1 on the machines. I think that Clonezilla has a hard time to replicate an image to a software RAID partition, so that means plus one point for the tar method.

Best Answer

The third option is to dump cloning and instead use a proper system configuration management tool such as Puppet or Chef. Cloning is a really bad idea for systems that you need to maintain over time, as you need to apply changes to all machines currently in the field, as well as respinning all of your clone masters. If you use a proper management tool, though, you just describe the state you wish a system to be in, and then the tool makes sure that the system is in that state -- whether it just came "factory fresh", or has been in production for several years and just needs to have a config file tweaked.

Basically, your new machine process should be:

  • Use the OS' native automated installation procedure (d-i preseeding works really well) to get a base minimum system installed that is capable of running your automation tool (and nothing else);
  • Run the automation tool to configure the system to your liking.