Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just did a fresh install of centos and spent ages adding all my standard libraries. Is there a way I can easily take a copy of this build and deploy to another new server?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can use any disk cloning tool like clonezilla. It supports many file systems including ext3 and ext4 (the most common in Linux environment).

share|improve this answer
    
I dont really want to have to setup a server to do this...any good alternative? –  DD. Apr 30 '12 at 13:57
    
Yeah, use the live disk –  MDMarra Apr 30 '12 at 14:15

from the machine you want to copy to (boot from a live disk or network boot, format the hdds, and mount them somewhere. cd to that location (root of the hdd to be copied)) then run the following (copies everything perfectly over and securely)

ssh perfectlymademachine find -xdev / /boot \| cpio -o -H crc \| gzip -c | gzip -d | cpio -id --no-absolute-filenames

This will take quite a while (depending on network speeds). Now all that is left is installing your bootloader (if you're using grub, simply grub-install /dev/yourhdd_andPartition

reboot (and if you installed your bootloader correctly), everything should boot up and be exactly the same as your previous machine.

EDIT: Breakdown of that command:

ssh perfectlymademachine - ssh to machine (sets up secure transfer)

find -xdev / /boot - finds all the files in / and /boot and stays on their device (doesn't stray into network mounts). If you need to add /home (ie on a separate partition) then do so.

cpio -o -H crc \| gzip -c - streams the files and compresses them on the remote machine

gzip -c | cpio -id --no-absolute-filenames - uncompresses and writes stream to actual fiels on disk

NOTE: find -xdev / /boot \| cpio -o -H crc \| gzip -c is run on the remote machine, while the rest is run on the local machine.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.