[Gloucs] disk image to ftp server?

Mark gloucs at mailman.lug.org.uk
Fri Jan 17 07:03:01 2003


On 14 Jan 2003, Guy Edwards wrote:

> Hi,
>
> I know there's lots of linux floppy disk based distributions with
> network support...
>
> I want to copy a hard disk image (by ftp?) to some kind of image file


Ok, It may not be excatly what you want but here's a trade "secret".

dd for the imaging. so if your going to be imaging say the primary IDE
drive: dd if=/dev/hda of=/path/to/image.dd count=2000000 be=1024 skip=0

bearing in mind that linux only supports files of approx 2 gig in size, so
if you are imaging a HDD that is larger than that (but you wont be if you
are just using a floppy type distro..) just increment the skip=i so that
you get a different block of segments, ie skip=2000000.

are you trying to basically (for want of a better term) ghost a load of
pc's? because if you are, get the netcat binary onto the disk and then you
can have that piped into dd, via gzip so that you can compress the data as
it travels over the network.

so.

set the netcat executable on the host to recieve data (via shell script to
ease your effort if you know that things like NIC's will work
automagically.)

listening host: nc -l -p 10000 > disk.dd

server host: dd bs=1024 < /dev/hda | nc 192.168.0.1 10000 -w 3


If you are going to have multiple file segments traversing the network,
use multiple listeners on different ports, eg:
nc -l -p 10001 > disk.dd2

and thats where you would pipe your skip=2000000 into.

once you have them all on the system, assuming there is the space, you can
just use dd again to push the image onto hard disk.
first:

cat image.dd >> disk.image
cat image.dd2 >> disk.image

then:
dd if=./disk.image of=/dev/hda bs=1024

Right, caffeine needed, Hard disks to examine.

Mark