Copying entire partitions... over the network ?

Copying entire partitions... over the network ?

Post by Andreas Grosch » Sun, 12 Mar 2000 04:00:00



Of course I can easily copy an entire partition into an image file (e.g.
by a simple "cp /dev/hdc6 /dos/hdc6.img") and remount this image in just a
matter of seconds through the loop device ("mount /dos/hdc6.img /warp -t
hpfs -o loop=/dev/loop3"), or copy it back to another partition of the same
size on a new hard disk. But now, how about this approach at a higher level:

Having created e.g. two partitions of the same size on the hard disks of two
*different* systems, linked by nothing more than their respective network
connections, how do I copy the *raw* data of an *entire* partition over TCP/IP
(i.e. the whole partition such as /dev/hdc6 e.g. to the /dev/hda6 on another
computer "at the other end of the network wire", but without any need to put
both hard disks into the same computer for making the copy, or to make an
image on removable media, to then mount it on the new system and copy the
files individually, or even to care about the format of these partitions)?

Briefly, the way that I'd like to transmit the data (preferably with
standard tools not specific to any particular distribution) is this:

 /dev/hdc6 =cp=> PC1 =TCP/IP=> LAN/Dial-Up =TCP/IP=> PC2 =cp=> /dev/hda6

Thanks in advance for your help (also by eMail to my address below).

Read U soon...

Greetinx


 
 
 

Copying entire partitions... over the network ?

Post by David William » Sun, 12 Mar 2000 04:00:00


dd if=/dev/hdc6 |gzip --fast >big.img
use nfs/ftp/scp/rcp or whatever to transfer the file
gunzip big.img |dd of=/dev/hda6

you'll want to make the destination identical to the source, same
partition size, block size, etc.

if you can dd /dev/zero across the partition before formating it, it
usually doubles the compression rate(around 4:1).  You probally don't want
to try this with a dial-up and a partition of any reasonable size, it'd
probally be cheaper and faster to mail the drive.....

oh and watch out for the ext2 2GB file size limit  

David Williams
Systems Administrator
Department of Computer Science
/**********************************************************/
today's fortune:
"They know your name, address, telephone number, credit card numbers, who ELSE
is driving the car "for insurance", ...  your driver's license number. In the
state of Massachusetts, this is the same number as that used for Social
Security, unless you object to such use. In THAT case, you are ASSIGNED a
number and you reside forever more on the list of "weird people who don't give
out their Social Security Number in Massachusetts."
-- Arthur Miller


> Of course I can easily copy an entire partition into an image file (e.g.
> by a simple "cp /dev/hdc6 /dos/hdc6.img") and remount this image in just a
> matter of seconds through the loop device ("mount /dos/hdc6.img /warp -t
> hpfs -o loop=/dev/loop3"), or copy it back to another partition of the same
> size on a new hard disk. But now, how about this approach at a higher level:

> Having created e.g. two partitions of the same size on the hard disks of two
> *different* systems, linked by nothing more than their respective network
> connections, how do I copy the *raw* data of an *entire* partition over TCP/IP
> (i.e. the whole partition such as /dev/hdc6 e.g. to the /dev/hda6 on another
> computer "at the other end of the network wire", but without any need to put
> both hard disks into the same computer for making the copy, or to make an
> image on removable media, to then mount it on the new system and copy the
> files individually, or even to care about the format of these partitions)?

> Briefly, the way that I'd like to transmit the data (preferably with
> standard tools not specific to any particular distribution) is this:

>  /dev/hdc6 =cp=> PC1 =TCP/IP=> LAN/Dial-Up =TCP/IP=> PC2 =cp=> /dev/hda6

> Thanks in advance for your help (also by eMail to my address below).

> Read U soon...

> Greetinx




 
 
 

Copying entire partitions... over the network ?

Post by t.. » Sun, 12 Mar 2000 04:00:00




>> [...] how do I copy the *raw* data of an *entire* partition over
>> TCP/IP (i.e. the whole partition such as /dev/hdc6 e.g. to the
>> /dev/hda6 on another computer "at the other end of the network wire",
>> but without any need to put both hard disks into the same computer
>> for making the copy, or to make an image on removable media, to then
>> mount it on the new system and copy the files individually, or even
>> to care about the format of these partitions)?

>> Briefly, the way that I'd like to transmit the data (preferably with
>> standard tools not specific to any particular distribution) is this:

>> /dev/hdc6 =cp=> PC1 =TCP/IP=> LAN =TCP/IP=> PC2 =cp=> /dev/hda6
> dd if=/dev/hdc6 |gzip --fast >big.img
> use nfs/ftp/scp/rcp or whatever to transfer the file
> gunzip big.img |dd of=/dev/hda6
> you'll want to make the destination identical to the source, same
> partition size, block size, etc.

Sure enough I will, and of course I do know that a even a tiny typo in
this context could*up the target disk beyond recovery...

Quote:> You probally don't want to try this with a dial-up and a partition
> of any reasonable size, it'd probally be cheaper and faster to mail
> the drive...

The approach is also considered for use within a 100MBit/s Ethernet, so
there are actually no worries about the transmission time and cost ;-)

However, as I said in the earlier message, the one thing I *dont* want
to do is make an *image file*; Id rather like "the network" itself to
be the destination, so I will not need the extra space for storing the
(even compressed) partition anywhere. However I do not know exactly how
it could be done, maybe theres something like a named pipe over TCP/IP?

Thanks in advance for your suggestions.

Greetinx


Sent via Deja.com http://www.veryComputer.com/
Before you buy.

 
 
 

Copying entire partitions... over the network ?

Post by Jayan » Tue, 14 Mar 2000 04:00:00


There was a perl wrapper that one my friend wrote
to ncftp for doing this kind of thing.. mail me
at (jayanm at e* dot com )and I'll send it to you..

Jayan




> >> [...] how do I copy the *raw* data of an *entire* partition over
> >> TCP/IP (i.e. the whole partition such as /dev/hdc6 e.g. to the
> >> /dev/hda6 on another computer "at the other end of the network wire",
> >> but without any need to put both hard disks into the same computer
> >> for making the copy, or to make an image on removable media, to then
> >> mount it on the new system and copy the files individually, or even
> >> to care about the format of these partitions)?

> >> Briefly, the way that I'd like to transmit the data (preferably with
> >> standard tools not specific to any particular distribution) is this:

> >> /dev/hdc6 =cp=> PC1 =TCP/IP=> LAN =TCP/IP=> PC2 =cp=> /dev/hda6
> > dd if=/dev/hdc6 |gzip --fast >big.img
> > use nfs/ftp/scp/rcp or whatever to transfer the file
> > gunzip big.img |dd of=/dev/hda6
> > you'll want to make the destination identical to the source, same
> > partition size, block size, etc.

> Sure enough I will, and of course I do know that a even a tiny typo in
> this context could*up the target disk beyond recovery...

> > You probally don't want to try this with a dial-up and a partition
> > of any reasonable size, it'd probally be cheaper and faster to mail
> > the drive...

> The approach is also considered for use within a 100MBit/s Ethernet, so
> there are actually no worries about the transmission time and cost ;-)

> However, as I said in the earlier message, the one thing I *dont* want
> to do is make an *image file*; Id rather like "the network" itself to
> be the destination, so I will not need the extra space for storing the
> (even compressed) partition anywhere. However I do not know exactly how
> it could be done, maybe theres something like a named pipe over TCP/IP?

> Thanks in advance for your suggestions.

> Greetinx


> Sent via Deja.com http://www.veryComputer.com/
> Before you buy.

--
---------------------------------------------
Our master in Redmond,
Holy be your stocks, may your market grow..
Give us today our daily FUD. Forgive all our
sins, since you sin as much everyday.
           - Morning prayer of a WinUser(TM)
---------------------------------------------
 
 
 

Copying entire partitions... over the network ?

Post by karsten_schmidt8.. » Wed, 15 Mar 2000 04:00:00


Hi,
 you can do something like (on the target machine)

 # rsh souce_box dd if=/dev/hdx | dd of=/dev/hdx

Karsten



> Of course I can easily copy an entire partition into an image file
(e.g.
> by a simple "cp /dev/hdc6 /dos/hdc6.img") and remount this image in
just a
> matter of seconds through the loop device ("mount /dos/hdc6.img /warp
-t
> hpfs -o loop=/dev/loop3"), or copy it back to another partition of
the same
> size on a new hard disk. But now, how about this approach at a higher
level:

> Having created e.g. two partitions of the same size on the hard disks
of two
> *different* systems, linked by nothing more than their respective
network
> connections, how do I copy the *raw* data of an *entire* partition
over TCP/IP
> (i.e. the whole partition such as /dev/hdc6 e.g. to the /dev/hda6 on
another
> computer "at the other end of the network wire", but without any need
to put
> both hard disks into the same computer for making the copy, or to
make an
> image on removable media, to then mount it on the new system and copy
the
> files individually, or even to care about the format of these
partitions)?

> Briefly, the way that I'd like to transmit the data (preferably with
> standard tools not specific to any particular distribution) is this:

> /dev/hdc6 =cp=> PC1 =TCP/IP=> LAN/Dial-Up =TCP/IP=> PC2 =cp=>
/dev/hda6

> Thanks in advance for your help (also by eMail to my address below).

> Read U soon...

> Greetinx



Sent via Deja.com http://www.deja.com/
Before you buy.
 
 
 

Copying entire partitions... over the network ?

Post by Rudy Tarasc » Wed, 15 Mar 2000 04:00:00



> how do I copy the *raw* data of an *entire* partition over TCP/IP
> (i.e. the whole partition such as /dev/hdc6 e.g. to the /dev/hda6 on another
> computer "at the other end of the network wire",

from the 'tar' manpage on my SGI IRIX 5.3 machine:

Quote:> To move hierarchies between machines, use the command

>    cd fromdir; tar cBf - . | rsh remote "(cd todir; tar xBf -)"

> where remote is the host name of the remote machine.

HTH

                                                 rudy

 
 
 

Copying entire partitions... over the network ?

Post by Bill Unr » Wed, 15 Mar 2000 04:00:00



]> how do I copy the *raw* data of an *entire* partition over TCP/IP

What do you mean by the *raw* data? Do you want all of the superblocks
inodes etc to be identical? Do you just want the data to be identical?
Do you care if data x on sector y on the first drive and on sector z of
the second?

Ie, be a bit clearer on your demands. The suggestion below will work
if you just want the data, not the detailed drive structure transfered.
(Note you must have the dest machine in your /etc/hosts file and you
must have the source machine in the .rhosts file on the dest machine.)

]> (i.e. the whole partition such as /dev/hdc6 e.g. to the /dev/hda6 on another
]> computer "at the other end of the network wire",

]from the 'tar' manpage on my SGI IRIX 5.3 machine:

]> To move hierarchies between machines, use the command
]>
]>    cd fromdir; tar cBf - . | rsh remote "(cd todir; tar xBf -)"
]>

Note, I would use tar xBpf -, to make sure that permissions were
preserved. I would also probably use the S option.
tar xBpSf -
to handle sparse files properly.
(This assumes you use gnu tar. Otherwise sparse files are expanded and a
1K file can grow to 10M.)

]> where remote is the host name of the remote machine.

 
 
 

Copying entire partitions... over the network ?

Post by Kenny McCorma » Fri, 17 Mar 2000 04:00:00





>> how do I copy the *raw* data of an *entire* partition over TCP/IP
>> (i.e. the whole partition such as /dev/hdc6 e.g. to the /dev/hda6 on another
>> computer "at the other end of the network wire",

>from the 'tar' manpage on my SGI IRIX 5.3 machine:

>> To move hierarchies between machines, use the command

>>    cd fromdir; tar cBf - . | rsh remote "(cd todir; tar xBf -)"

>> where remote is the host name of the remote machine.

Of course, then you have to deal with all the bugs in tar (cf earlier
discussion of why tar (*) is not a reliable tool for backups).

(*) At leat GNU tar under Linux - and at least as of when I got bitten by it
a few times and stopped using it (about a year and a half ago).

To answer the original question - use netcat, netcat is all you need.
I've done this trick many a time - it is particularly cool to use it for
cloning DOS/Winxx partitions, booting Linux from Tomsroot (on both source
and target).

 
 
 

Copying entire partitions... over the network ?

Post by Bud Roger » Sat, 18 Mar 2000 04:00:00



> Of course, then you have to deal with all the bugs in tar (cf earlier
> discussion of why tar (*) is not a reliable tool for backups).

> (*) At leat GNU tar under Linux - and at least as of when I got bitten by it
> a few times and stopped using it (about a year and a half ago).

> To answer the original question - use netcat, netcat is all you need.
> I've done this trick many a time -

You know, you could have passed along the command line you used...

--

Though all my neighbors are barbarians, and you are a thousand miles away,
there are always two cups on my table.

 
 
 

Copying entire partitions... over the network ?

Post by Kenny McCorma » Sat, 18 Mar 2000 04:00:00




...

Quote:>> To answer the original question - use netcat, netcat is all you need.
>> I've done this trick many a time -

>You know, you could have passed along the command line you used...

On the receiving end, do: netcat -l -p 2000 > /dev/hda
Then, on the sending end, do: netcat -w 10 [receiver-ip-addr] 2000 < /dev/hda

Pretty straightforward stuff - just make sure you get the redirections
right - and don't call me if anything goes wrong...

 
 
 

1. Copying entire partitions... over the network ?

Of course I can easily copy an entire partition into an image file (e.g.
by a simple "cp /dev/hdc6 /dos/hdc6.img") and remount this image in just a
matter of seconds through the loop device ("mount /dos/hdc6.img /warp -t
hpfs -o loop=/dev/loop3"), or copy it back to another partition of the same
size on a new hard disk. But now, how about this approach at a higher level:

Given two partitions of the same size on the hard disks of two *different*
systems, linked by nothing more than their respective network connections,
how do I copy the raw data of an entire partition over TCP/IP, without any
need to make an image on removable media, mount it on the new system and copy
the files individually, or even care about the format of these partitions ?

Thanks in advance for your help (also by eMail to my address below).

Read U soon...

Greetinx


2. Web pages in Konqueror 2.0rc2 and some other questions

3. HELP. Copying entire linux partition to another partition

4. Can somone compile something for me, please?

5. Why kernel hangs when copied entire partition ?

6. How to rsh Red Hat Linux ?

7. how do you copy an entire partition?

8. BASH Frequently-Asked Questions (FAQ version 3.9)

9. Copying Entire Partition

10. how to copy entire extfs2 partition to another?

11. Copying entire disk structure

12. Why doesn't tcopy copy entire tapes?

13. copying an entire bootable disk.