Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Tip of the Day: "ghosting" a machine with nc and dd



On Tue, 17 Jul 2007 15:34:20 +0900
"Josh Glover" <jmglov@example.com> wrote:

> 5. On the target machine, run:
> HDD_DEV=/dev/sda
> # (replace /dev/sda with the appropriate device name from the previous step)
> TARGET_PORT=2727
> nc -l -p ${TARGET_PORT} | dd of=${HDD_DEV}
> 
> 6. On the source machine, run:
> HDD_DEV=/dev/hda
> # (replace /dev/hda with the appropriate device name)
> TARGET_IP=192.168.1.254
> # (replace 192.168.1.254 with the correct IP address if you did not
> follow my advice)
> TARGET_PORT=2727
> dd if=${HDD_DEV} | nc ${TARGET_IP} ${TARGET_PORT}

Hint: use tar on a preformated partition instead of dd.
The advantage is that you can deal with different sized
partitions with different filesystems (as long as they
support the unix semantics) and the amount of data
transfered is only the data stored on disk instead of
the size of the disk. 

Additionally, if you have considerably fast CPUs you can also
pipe it trough gzip to limit the bandwidth used.

Hint #2: if you are trying to recover a dying disk from
machine A to machine B, use dd_rescue instead of dd

			Attila Kinali
-- 
Praised are the Fountains of Shelieth, the silver harp of the waters,
But blest in my name forever this stream that stanched my thirst!
                         -- Deed of Morred


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links