Operating System - HP-UX
1836434 Members
2391 Online
110100 Solutions
New Discussion

Remote copy of raw device

 
SOLVED
Go to solution
Andrew S Babb
Advisor

Remote copy of raw device

I am trying to copy a raw device /dev/vg02/rlvol2 from host1 to host2, prefereably with compression.

The command
dd if=/dev/vg02/rlvol2 ibs=4096k | remsh host2 dd of=/dev/vg02/rlvol2 obs=4096k
copies the contents but not compressed.

Is there a way to compress the data on host1 and then uncompress or zcat the data on host2?

TIA
Andrew
3 REPLIES 3
Rodney Hills
Honored Contributor
Solution

Re: Remote copy of raw device

Just put "compress -c" and "zcat" into the stream.

dd if=/dev/vg02/rlvol2 ibs=4096k | compress -c | remsh host2 "zcat - | dd of=/dev/vg02/rlvol2 obs=4096k "

-- Rod Hills
There be dragons...
A. Clay Stephenson
Acclaimed Contributor

Re: Remote copy of raw device

The key to your problem is to use compress on one end and uncompress on the receiving end. Both of these will read/write stdin/stdout.

You will be better served using a bs= value because no buffer to buffer copy is needed.


dd if=/dev/vg02/rlvol2 bs=64k | compress - | remsh host2 uncompress - | dd of=/dev/vg02/rlvol2 bs=64k

That should be close; I would try it on a couple of regular files first.


If it ain't broke, I can fix that.
Andrew S Babb
Advisor

Re: Remote copy of raw device

Thanks for the quick response.

Rodney's solution works and on a 64Mb file going through gelan card takes 14sec appox to complete.

The alternate solution, I needed to change the remote hosts "bs" parameter to an "obs" (leaving ibs to default) and this took about 10sec to complete.