copying entire systems

Kernels & Hardware, configuring network, installing services

copying entire systems

Postby viniosity » 2004-09-20 02:08

I have two Debian testing systems on the same LAN (let's call them A and B). I'd like to take the entire contents of computer A and move it to computer B. That includes my websites, installed packages, etc. (everything except the kernel and IP info). Is there a pretty straight forward way to do that? The goal is to set aside computer B and keep it as an emergency spare in case computer A fails)

TIA
User avatar
viniosity
 
Posts: 46
Joined: 2004-09-15 04:39
Location: DC

Postby lacek » 2004-09-20 09:40

It is simple: grab the HDD of B, put it into A, copy everything except /proc (for which you need to create an empty dir).
Before that, umount all mounted directories (network shares, for example), and after it is finished, you have a bootable system.
If you want to preserve some parts of the original system (like the kernel), you move it to a directory and be careful not to overwrite that dir (/boot, for example).
You may need to tweak a little on the 'copied' system, but generally, systems can be 'cloned' with simply copying.
lacek
Moderator Team Member
 
Posts: 769
Joined: 2004-03-11 18:49
Location: Budapest, Hungary

Postby viniosity » 2004-09-20 16:15

Is there any way to do this without pulling open the computer? Maybe even through some combination of ssh and rsync?
User avatar
viniosity
 
Posts: 46
Joined: 2004-09-15 04:39
Location: DC

Postby Jeroen » 2004-09-20 16:47

Sure, at the study association where I admin the workstations, we have a script that simply rsyncs all of /usr, /var/lib, and a few other places from one place to the other, to duplicate the exact configuration. This way, we only have to maintain one workstation, the others can be brought completely in sync easily, and every time we buy a new computer, we duplicate the whole config this way.

Just boot on the target PC with a bootable linux distribution (knoppix for example), partition the harddisk accordingly, and just rsync the whole thing over (per partition, otherwise you're going to try to copy /proc over... won't work. Or just umount /proc first, it isn't essential for running your computer anyway (okay, lots of stuff might crash, but the important stuff remains running).
Jeroen
Debian Developer, Site Admin
Debian Developer, Site Admin
 
Posts: 571
Joined: 2004-04-06 18:19
Location: Utrecht, NL

Postby viniosity » 2004-09-26 03:31

Thanks for the replies everyone. I found a couple of other good sources:

Unison:
http://www.cis.upenn.edu/~bcpierce/unis ... anual.html

Rsync:
http://www.linux.com/article.pl?sid=04/09/15/1931240
User avatar
viniosity
 
Posts: 46
Joined: 2004-09-15 04:39
Location: DC


Return to System configuration

Who is online

Users browsing this forum: syscon and 11 guests

fashionable