Contents

Question

I have to clone a Windows NT box and possibly a Linux box too.
Is there any good OSS cloning software out there, or is Norton Ghost the only viable option?

Answer

1. You don't need cloning for Linux.
2. For windows, you don't need cloning if you can take the disk out and mount it in a linux pc or boot something like toms root 'n boot from deskette or CD.

Cloning is an artificial requirement brought on by the fact that in windows there is no easy way to copy system files if they are "open".

In either case, you can use linux to copy the files - and perhaps bzip2 them for compression.

It is possible to gzip windows PCs and send the output via nc (netcat) over the wire to another PC using toms root 'n boot and nothing more.

You can try this if you feel like experimenting:

source:~# tar -jcpf - /source/directory | nc -w3 destination 300000
desination:~# nc -l -p 300000 -w3 | tar -jC /destination/directory -xpf -
or
destination:~# nc -l -p 300000 -w3 > /images/something.bz2

The -w3 might be a bit quick if you don't do the two commands within 3 seconds of each other. If you make it longer it takes that much longer to close the connection at the end. Tweak to suit yourself...

The -j won't work on toms root 'n boot because by default its tar doesn't do bzip2, but in that case you can just do it this way:

tar -cpf /dir | bzip2 | nc etc..

On a fast network, -j is overkill. You will get better performance with -z or even no compression (with old machines).

If you want to do this over a secure connection rather than using netcat do this:

tar -cjvf - /source/directory | ssh remotebox /bin/dd of=/tmp/something.tar.bz2

And for "bit for bit" backups:

 cat /dev/hda | gzip -c | ssh remotebox /bin/dd of=/tmp/hda.image.gz

Which you can restore like so (assuming identical geometry):

 zcat image.gz | ssh destination-box /bin/dd of=/dev/hda

Local cloning

For fast copying between filesystems on a linux box, try this:

cd /source-dir
find . -xdev -print0 | cpio -pdvum0 --sparse /dest-dir

Useful software


This page was last modified on 11 August 2010, at 12:47. This page has been accessed 2,886 times.

  
Powered by MediaWiki

Copyright © 1999-2009, Cape Linux Users Group | All contents are under GNU Free Documentation Licence | For all queries, join our mailing lists!