Operating System - HP-UX
1832373 Members
3111 Online
110041 Solutions
New Discussion

dd command to copy rlvol (source) rlvol (target)

 
Joe Profaizer
Super Advisor

dd command to copy rlvol (source) rlvol (target)

I was told to use the following command to move data from one lvol to another.

dd if=/dev/vgdvl/rlvol2 of=/dev/vgdvl2/rlvol1 bs=2048&

Do the filesytems need to be dismounted? If not, when will I start seeing files on the target volume?

How can I gather statistics on transfer rates?

Please consult.

Thanks,

..Joe
5 REPLIES 5
Sridhar Bhaskarla
Honored Contributor

Re: dd command to copy rlvol (source) rlvol (target)

Joe,

You can use this command. Only disadvantage is that you need to dd entire logical volume irrespective of the data.Also, you need to have both the logical volumes of same size.

Coming to the question. You don't need the file system /dev/vgdv1/lvol2 unmounted. But the other one (target) should be unmounted.

Once the dd is over, you need to do an fsck on the logical volume and then mount it. You will see the contents then.

Gathering stats - Write a small script like this

date >> log
dd if=/dev/vgdvl/rlvol2 of=/dev/vgdv2/rlovl2 bs=2048 >> log 2>&1
date >> log

Check the log files for time diffs.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
A. Clay Stephenson
Acclaimed Contributor

Re: dd command to copy rlvol (source) rlvol (target)

Hi Joe:

The short answer is that you won't. Dd is used to copy raw data from one device or file to another. If your source rlvol contains a filesystem then you could create a mountpoint and mount the dest block device (lvolxx) not rlvolxx and then the files will appear. If you are transferring a filesystem this way (and this is a really nutty way to do it), then yes the filesystem should be unmouted. Normally, this technique is only used to more raw database datafiles which you will not see as files.

Clay
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: dd command to copy rlvol (source) rlvol (target)

Hi Joe:

You can preface the 'dd' with the 'time' command, and run the operation in the foreground:

# time dd if=/dev/vgdvl/rlvol2 of= ...

If you are going to copy data this way, I'd make sure that the source data isn't changing during the copy.

Regards!

...JRF...
Victor BERRIDGE
Honored Contributor

Re: dd command to copy rlvol (source) rlvol (target)

Hi Joe,
Just thoughts... Do you have mirror-ux?
If so why not mirror then split your copies and use the second?
You will in this case not have to deal with being sure nothing on the volume is changing while copying... (almost...)


All the best

Victor
Kevin Wright
Honored Contributor

Re: dd command to copy rlvol (source) rlvol (target)

for filesystem copies I have had good luck using find.
cd source dir
find . -depth -print |cpio -pd /dest/dir

obviously in this case, both FS are mounted.