Operating System - HP-UX
1854688 Members
7333 Online
104102 Solutions
New Discussion

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

 
SOLVED
Go to solution
Joe Profaizer
Super Advisor

dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

If I did a pvremove on /dev/rdsk/c2t2d0 before I initiated the dd command (in subject line), would the "dd" still complete correctly or do I need the LVM structure to reside on the physical volume of the "of"?

Thanks,

..Joe
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

Hi Joe:

You toasted the disk as an LVM disk when you did the 'pvremove'. Since the 'dd' is simply a bit-for-bit copy it will (still) complete OK. The question, however, is once the copy completes, what do you expect to do and to have?

Regards!

...JRF...
Joe Profaizer
Super Advisor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

I just wanted to "dd" the system disk, take the "of" target disk into our test system and boot it. Basically wanted to replicate a system disk and boot a like server from it.
S.K. Chan
Honored Contributor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

Why would you need to run dd after a pvmove ? Are you pvmoving on
=>a VG that's in a shared mode ?
=>LVs that are striped ?
Because if you do that would explain why you need to run dd afterwards though I'm not sure if it'll work. Pvmove works best on a "regular" or "normal" logical volumes. If for some reason you need to run dd, you would still need to vgexport the physical volumes and vgimport it back with the new disks specified.
Joe Profaizer
Super Advisor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

pvremove not pvmove
S.K. Chan
Honored Contributor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

Sorry ... sometimes the eyes can play trick on you ..
Like JRF said, the LVM info/config on the disk is gone if you run pvremove. The dd should copy the LVM header back onto the disk for you (I've never tested this ..).
James R. Ferguson
Acclaimed Contributor
Solution

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

Hi Joe:

If you want to put things "right", move the physical disk back to its original server and do a 'vgcfgrestore' of its LVM header. Then, do a 'dd' as before.

Regards!

...JRF..
A. Clay Stephenson
Acclaimed Contributor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

When you do your new dd, increase your bs to something like =64k (or even 1024k); the transfer will go much faster. Also, make sure that you specify only bs= (as opposed to ibs= obs=) to avoid double buffering with a copy between them.
If it ain't broke, I can fix that.
Joe Profaizer
Super Advisor

Re: dd if=/dev/rdsk/c1t2d0 of=/dev/rdsk/c2t2d0 bs=2048

I forgot the "k" after 2048 in my message. Thanks anyway.