Nov 282011

I hope this brief guide will be useful to others as it has been helpful to me, I found it on Lilis a site where there are useful guides published by Linux enthusiasts.

Mini guide to clone 2 PC without any special tools.
With two Linux livecd, can be anything you like the only requirement is the support to the network, you can proceed using the command “dd” and transferring the data over the network with the comand “netcat“.

Start the two machines and configure the network so that they see each other, do a test with the “ping” command.
In this example assume that the computer on which we want to clone your PC has IP

Assuming that the disk is to clone is /dev/sda and that on the target machine you are using /dev/sda as well, proceeds with the following command.

On the computer where we want to copy the image give as root the command:

nc -l  10000 > /dev/sda

where: 10000 is the port number to use and /dev/sda is the partition where to copy the information.

On the PC you want to clone give as root this command:

nc 10000 < /dev/sda

where: is the IP address of the PC where we want to send the disk image, 10000 is the port to use and /dev/sda is the hard disk to copy. This command will copy an entire disk with also the MBR and the partition table, so the best thing would be to have two disks with the same size.

If you want to clone just a partition you can point at it (in both commands) instead of /dev/sda, for example, to copy the first partition from the computer and put it in the third partition on the second SCSI hard disk of our target we use the commands:

On the computer that receive the information give as root:

nc -l -p 10000 > /dev/sdb3

On the PC you want to clone give as root this command:

nc 10000 < /dev/sda1

note, the data travel over the network unencrypted.

There are many software, more advanced than this solution, to make clones, such as Clonezilla, but this is a solution with very few requirements and that quickly copy your data over the network.

Popular Posts:

flattr this!

  10 Responses to “How to clone a PC on the network with 2 live cd”

  1. Pardon me for the novice questions. Can you please clarify “On the computer where we want to copy the image”
    and “On the PC you want to clone”. Which computer is the source (gives the disk content) and which is the target (receive the disk content).


  2. actually, with some live CD distros (like tinycore or DSL), you only need once CD.
    you can load the entire image to memory on the first, and then do the same for the second.

    or if capable, both machines can be booted over the network (DSL and Tinycore can do this).
    no need for a CD or a USB stick. (but of course you need another machine to act
    as DHCP/PXE server).

  3. Quasta soluzione e abbastanza grossolana e parte dal prerequisito di avere origine e destinazione UGUALI o al massimo la destinazione piu grande dell’origine (pena poi il ridimensionamento della partizine destinaione)
    inoltre viene clonato l’intero disco nn curante dello spazio non utilizzato spreco di tempo assurdo con i tagli di dischi attuali

    • Ciao,

      Si è una soluzione con pochi requisiti e facile, se vuoi grossolana :)
      Nel caso tu abbia dischi diversi basta che fai sulla seconda macchina una partizione che sia uguale alla partizione della macchina sorgente.

      Per il copiare solo il disco realmente utilizzato e non gli 0, devi usare soluzioni come clonezilla, ovviamente dd non va bene.

      Che dire in generale sono d’accordo con te, ma mi pareva di avere specificato tutto questo già nell’articolo.


  4. Ciao Linuxaria; i simboli di Maggiore e Minore non si vedono ;) sarà colpa del mio firefox? anyway si vede la controparte HTML.

  5. The same with compressione and ssh:

    dd if=/dev/sda | gzip | ssh root@target ‘gzip -d | dd of=/dev/sda’

    if you use dcfldd you can have a nice progression and hash “on the fly”.

    If you have a faulty drive the best way is to use ddrescue locally or a locally mounted drive.


 Leave a Reply




You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>