[CentOS] How to copy a system?

Thu May 5 11:24:01 UTC 2011
Robert Heller <heller at deepsoft.com>

At Thu, 05 May 2011 12:13:18 +0100 CentOS mailing list <centos at centos.org> wrote:

> 
> Is there a standard way of copying a working system
> from one machine to another with different partitions?
> 
> I have two CentOS-5.6 machines, say A and B,
> and I thought I would copy / on sdb10 on machine A
> to an unused partition sda7 on machine B with rsync.
> I made the appropriate changes to /etc/fstab and grub.conf ,
> as well as /etc/sysconfig/network-scripts ,
> but found that there were innumerable errors
> when I booted machine B into the new system,
> mostly to do with creating dev's.
> Also the ethernet connection, which had been eth1 on A,
> was now eth0 on B, and this did not work.

It sounds like you have problems *other* the 'copy' part.

After copying the system, you will likely need to remake the initrd on
the target system.  Oh, you will need to edit /etc/modprobe.conf:
different SATA driver, different ethernet driver, etc.

> 
> This was only a kind of experiment.
> There is a problem with the partition table on machine A,
> and I thought it would be useful to have a backup machine
> with exactly the same setup.
> 
> Is this a hopeless enterprise, or can it be done easily?

It is easy enough to do.  There are just a few more things involved
besides copying the data and diddling with grub.conf, /etc/fatab, and
/etc/sysconfig/network-scripts. You just forgot about /etc/modprobe.conf
and forgot to remake the the initrd.

>  

-- 
Robert Heller             -- 978-544-6933 / heller at deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments