# Cloning (Ghosting) a Linux Drive



## snorkythewea (Mar 14, 2006)

*I need to "ghost" a Linux drive located on server "A".* The idea is to be able to drop the clone drive into another Linux box and start working with it.

The drive to be cloned uses only 4GB. it's running SQUID with SQUIDGUARD filters - an excellent proxy/content filter for children. *Server "A" has lots of bandwidth.*

*I have a linux machine - server "B"* - which I can use to burn the clone. Server "B" will probably be the new home for the cloned drive. *Server "B" is not part of the 1Gb network, *although I can arrange to connect if necessary.

Available is a linux FTP server - *server "C"* with plenty of disk space and a big pipe.

I also have a good assortment of Windows POSs - XP and server 2003 - with good bandwidth. And a DVD burner.

Assuming that I don't have much money ( I'm doing this for a cash-poor non-profit group), what is the best approach to this?


----------



## Squashman (Apr 4, 2003)

You can use the Builtin utilities in Linux to image the drive.
http://www.pccitizen.com/driveimage.htm

Or if you want to image the drive to a server, you could use Ghost 4 Unix.
http://www.feyrer.de/g4u/


----------



## snorkytheweasel (May 3, 2006)

Thanks. Those look very promising.


----------



## saikee (Jun 11, 2004)

It is perfect job for the dd command

To clone disk a source hda to a target hdb

```
dd if=/dev/hda of=/dev/hdb bs=32768
```
Partition hda1 to partition hdb7

```
dd if=/dev/hda1 of=/dev/hdb7 bs=32768
```
The block size is for speeding up the process as without it dd defaults to 512 byte in each transfer. The 32768 =512 times 64 or one complete track at a time

The only rule needs to remember in using dd command is that it is a sector-by-sector cloning and so the target should be larger than the source if not matching exactly. Normally an exact match is preferred for trouble free operation. dd will break down if the target cannot accept all the source data (smaller in size).

Also dd clone boot sector too, as against cloning a filing system, and so the target will boot as the source. It is a complete 100% mirror image.

It pays to remember the first parameter if (=input file) is always the source data. A mix up with the source with the target will lead to loss of data!!! I always shout at the top of my voice when reading the command line before hitting the return key.

My experience with dd is that it is faster, more reliable but slightly less flexible than the commercially available Ghost.

Had clone 300Gb disks with 60 distros and used the target disks on different computers.

Target disk will work immediately if the hardware is the same. Even if totally different hardware were use as in my case Linux can be edited to suit the new computer.


----------



## snorkythewea (Mar 14, 2006)

Something that I didn't make clear (my bad!) is that I can't add a drive to the server whose disk is to be cloned. In other words, a disk-to-disk clone in the same computer is not possible in this case.

The cloning will have to occur over the fat pipe network or the internet.

STOP THE PRESSES! I just had a hot flash or a flash or something.

I could use a USB external drive on the original server and clone to the disk that is in the USB drive. Actually that's a question (the question mark is in a hidden share). Is that feasible?


----------



## saikee (Jun 11, 2004)

Yep

You USB disk will be seen as sda or sdb (could be also hde or hdg).

The cloning speed will be slowed down as USB port is a bottle neck.


----------



## Squashman (Apr 4, 2003)

snorkythewea said:


> The cloning will have to occur over the fat pipe network or the internet.


Then use Ghost 4 Unix. That is what it was designed for.


----------

