Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Is it possible to clone an Ubuntu system and if any changes are made to original system, those should be replicated to the one cloned? I need to have backup support if original one gets down. In my case, Ubuntu is a cloud server.

Please guide me step by step.

share|improve this question

6 Answers 6

Please refer to https://help.ubuntu.com/community/BackupYourSystem/SimpleBackupSuite and https://help.ubuntu.com/community/BackupYourSystem , also http://askubuntu.com/questions/2596/comparison-of-ubuntu-backup-tools .

If you want to only save the changes in packages installed, etc, you can use dpkg --get-selections > installed_packages, and restore those with apt-get update && dpkg --set-selections < installed_packages && apt-get upgrade.

To backup your user files, it is sufficient to copy the /home directory to the remote server, refer to the second link.

share|improve this answer
1  
It's good for backing up files & directories. I'm thinking to clone ubuntu cloud server. –  user3215 Oct 13 '10 at 10:30
    
You probably don't want to be using a synchronisation solution for backup, since any problems with the original system will be mirrored in the backup. Using the solution proposed by Evgeny Martynov above would be the safest way to backup your system. –  Chris Wilson Oct 13 '10 at 10:49
    
I think it's possible to sync the directory '/' with new ubuntu installation after copying all the packages(dpkg --set-selections < installed_packages) –  user3215 Oct 13 '10 at 11:16
1  
It is, however that will not copy your /home stuff and any files that do not belong to a package but are in /. –  evgeny Oct 13 '10 at 11:18
1  
My major requirement is, if one system is down then I could immediately get up the other with all the packages, files and directories. –  user3215 Oct 13 '10 at 11:21

You probably want to use something like drbd. Probably combined with something like Heartbeat. More info about that on the Linux High Availability site.

I suppose some cloud or cluster solutions come with similar functionality built-in or available as extensions, you might want to dig into their documentation.

share|improve this answer
    
I couldn't understand how using drbd, Is it good for server. –  user3215 Oct 15 '10 at 9:35
    
Yes, it's mostly used for servers. That's what the Linux-HA site is about: automatic failover to another server in case the first one crashes or whatever. And 'drbd' is the kernel driver & tools that take care of replicating all changes to the other computer automaticly (it works a bit like RAID 1, except the mirror disks are in another computer). –  JanC Oct 15 '10 at 10:32
    
I realized drbd will suit well for my requirement as you said. –  user3215 Oct 22 '10 at 7:19

The data itself will need to be backed up by other means but for repeatable configurations I would really look at tools like preseed and puppet. With puppet and preseed you also get the benefit of some level of self documentation on the configurations as well.

share|improve this answer

Check out remastersys. Remastersys is a tool that can be used to do 2 things with an existing Debian, Ubuntu or derivative installation.

  1. It can make a full system backup including personal data to a live cd or dvd that you can use anywhere and install.
  2. It can make a distributable copy you can share with friends. This will not have any of your personal user data in it.

http://www.geekconnection.org/remastersys/index.html

share|improve this answer
1  
I think it's good for desktop edition. –  user3215 Oct 15 '10 at 5:02

You should use virtualisation. Software like KVM or Xen allow You to create a virtual machines, which are like normal machines, but You can clone them and copy to another physical machine.

I cannot guide You step by stem because every situation is different. I recommend read a documentation on these sites and ask when You encounter a specific problem.

share|improve this answer

I would use rsync with SSH keys over the network and set it to run frequently with cron. This way, only the changes need to be transmitted.

Format taken from how do I do mass installs?

#!/bin/bash
rsync -avx --exclude=/proc --exclude=/dev --exclude=/tmp --exclude=/sys --delete-after root@${host}:/ /

On the machine that will serve as a backup, make a file named /etc/cron.daily/backup-pull then make it executable sudo chmod +x /etc/cron.daily/backup-pull. Replace ${host} with the IP of the original system.

You'll have daily syncs of the original server to this one. You could also do cron.hourly instead of cron.daily if you're really paranoid.

share|improve this answer
    
I have done that in the past with Debian and Ubuntu systems, and it's quite a painless method -- works really well! –  Jay Oct 16 '10 at 17:40
    
It's very clear hear. I'll definetly try this after cloning the server and get back again. –  user3215 Oct 17 '10 at 9:03
    
Any best tool for cloning ubuntu server over network. How about "netcat"? –  user3215 Oct 18 '10 at 3:50

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.