Copying Linux to a New Server

I had the need to copy my current Linux server to another one for getting fault tolerance back in the environment.

I originally used Ghost and ghosted the current server to a USB stick. This past weekend, I went to Paris and attempted to Ghost the server there. However, big problems started to occur because the servers have the same hard drive, but different motherboards. When I rebooted the server, a Grub Error 12 occurred. I was dead and couldn't go anywhere from there and had to bring it back to the main location to get going.

Last night I used a different program called Paragon Disk Backup. It took a considerable amount of time longer to create the image through Paragon. But, I put the image on the Paris server, rebooted – and then I got Grub Error 12. I followed some instructions online about updating the /boot/grub/menu.lst and /etc/fstab. The UUID of the hard drive was indeed different than what was in these files. I updated the UUID of the new hard drive in these two files, rebooted, and it still showed Grub Error 12.

I decided after spending enough time with this, that it would be best to simply create a tar file of the full Linux installation. On the new server, Ubuntu was installed from scratch off of the CD. After the installation was completed, I used the Ubuntu Live CD to delete all materials on the hard drive except the two files listed above (backed those up to the desktop). I untarred the linux installation onto the hard drive, put the two files back, rebooted, and I was in business!

A few things did have to be changed, however. I had to get the ethernet card updated as it was showing as eth1 instead of eth0. I updated a file with the MAC address of the new card, rebooted, and it was then fixed.

The next step will be to get the replication all setup between the two. I found a program called Unison. Unison is a bidirectional synchronization application that will sync two replicas. One line through a automated job will sync the two replicas up together. It will delete files on one that were deleted on the other, create files on one that was made on the other, and update files between them. Unison uses an algorithm like Rsync to only replicate the bits of data that have changed since the last update. Therefore, if a very large file is updated, it will only replicate the bits of data from that file to the other replica – therefore saving precious bandwidth.