Server Replication

ak17_hk

Verified User
Joined
Nov 7, 2006
Messages
68
Hi Guys!

I wonder if there is any way that I can do a quick linux (CentOS) server replication from the existing one to the new one, so that I don't have to setup the new server and do all the fine tuning again to match with the old one. Is there any tool required? Is this possible? :confused:

Thanks for helping me out! :)

Anthony.
 
First use at your own risk. Data can be completely destroyed if you do the wrong thing.

Here is one way of doing it.

The new drive must be at least as big as the original drive. This will make a duplicate of the original drive. If you clone a 80 gig drive to a 100 gig drive 20 gig will be wasted. You can create another partition after the cloning is done if you want to.

Code:
dd if=/dev/hda of=/dev/hdc bs=1024k conv=noerror


if - input file or drive you want to clone
/dev/hda is the primary drive. Yours may be different.

of - output file or drive cloning to
/dev/hdc is the second drive. Yours may be different.

bs - block size
conv - the noerror means it will not stop if there are any read errors.

Do your own research though.

You will probably need to fix the master boot record on the second drive. You can use grub for that.

Code:
grub
device (hd1) /dev/hdc
root (hd1,0)
setup (hd1)
quit

Again assuming hdc is the second drive

Upon booting if there are any hardware differences then those will should get picked up and ask you for input. However it may not.

dd is one way of doing it. It may not be the best for you.
 
First use at your own risk. Data can be completely destroyed if you do the wrong thing.

Here is one way of doing it.

The new drive must be at least as big as the original drive. This will make a duplicate of the original drive. If you clone a 80 gig drive to a 100 gig drive 20 gig will be wasted. You can create another partition after the cloning is done if you want to.

Code:
dd if=/dev/hda of=/dev/hdc bs=1024k conv=noerror


if - input file or drive you want to clone
/dev/hda is the primary drive. Yours may be different.

of - output file or drive cloning to
/dev/hdc is the second drive. Yours may be different.

bs - block size
conv - the noerror means it will not stop if there are any read errors.

Do your own research though.

You will probably need to fix the master boot record on the second drive. You can use grub for that.

Code:
grub
device (hd1) /dev/hdc
root (hd1,0)
setup (hd1)
quit

Again assuming hdc is the second drive

Upon booting if there are any hardware differences then those will should get picked up and ask you for input. However it may not.

dd is one way of doing it. It may not be the best for you.


Thanks for the detailed explanations!!!! Highly appreciated!!! :D
Beside the method you mentioned, is there any tools or software that can do similar thing safely, particularly if it's independent server replication instead of hard drive replication? Thanks in advance! :)

Anthony.
 
particularly if it's independent server replication instead of hard drive replication?

Isn't that the same thing? In order to replicate a server you have to replicate the drives right? I don't know of any way to actually replicate the hardware, only the data on the drives.

There are plenty of other tools out there that will replicate the data on the drives. dd is free and is standard on Linux.
 
Last edited:
Back
Top