System Administration

Re: Using dd to clone root disk never finishes

 
Gerard Demers
Occasional Contributor

Using dd to clone root disk never finishes

I'm using dd to clone my production SuperDome partition to a test partition. I would reconfigure the partition to move the device from production to test after cloning. In an attempt to remove that step I tried using it with remsh to pipe the copy accross the LAN to remshd process on the test partition
dd if=/dev/rdsk/c0t2d0 bs=65536|remsh superd2 dd of=/dev/rdsk/c0t2d0

It never completes. sar shows write activity to the disk drive but I let it run for days and it never completes. Any thoughts as to what I'm doing wrong would be appreciated.
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: Using dd to clone root disk never finishes

Perhaps a more supported methodology:

pvcreate -B /dev/rdsk/c1t0d0 #use real disk

mkboot -l /dev/rdsk/c1t0d0
mkboot -a "hpux -lq (;0)/stand/vmunix" /dev/rdsk/c1t0d0 # use real disk


# mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?

If you are running 64-bit OS:

# mkboot -b /usr/sbin/diag/lif/updatediaglif2 -p ISL -p AUTO -p HPUX -p PAD -p LABEL /dev/rdsk/c?t?d?


vgextend /dev/vg00 /dev/dsk/c1t0d0 # same thing
lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c1t0d0

# real disk. repeat for other lvols

lvlnboot -r /dev/vg00/lvol3 # root fs /
lvlnboot -s /dev/vg00/lvol2 #swap
lvlnboot -d /dev/vg00/lvol2 #swap/dump
lvlnboot -b /dev/vg00/lvol1
lvlnboot -R
lvlnboot -v
setboot
setboot -a 52.1.0 # second disk

At the proper point for a Superdome, transfer the disk to the control of the second server/parittion.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Patrick Wallek
Honored Contributor

Re: Using dd to clone root disk never finishes

When using remsh and copying via pipes I normally do it the reverse of what you are doing.

In your case you would issue this from superd2:

# remsh superd1 "dd if=/dev/rdsk/c0t2d0 bs=64k" | dd of=/dev/rdsk/c0t2d0

I just did a quick test of a single file and it worked well. You might consider using a larger block size as well. Depending on your disk size, using 64 KB blocks could take a while.
Hai Nguyen_1
Honored Contributor

Re: Using dd to clone root disk never finishes

Hi,

From my experience, using bs=1024k is the most time efficient.

Hai
Naveej.K.A
Honored Contributor

Re: Using dd to clone root disk never finishes

I too agree with Ngyuen...
I had done a dd of my disk with the block size at 1024K. and have been pretty fast.

with best wishes
Naveej
practice makes a man perfect!!!
Gerard Demers
Occasional Contributor

Re: Using dd to clone root disk never finishes

I ran a local test piping standard out of one dd to standard in of another:

dd if=/dev/rdsk/c8t2d0 bs=64k|dd of=/dev/rdsk/c0t2d0

Its been running for 24 hours. Its a 71Gig drive. sar shows a rate of 250 blocks per second. The rate is the same if I use 640k as the block size. If I run a single dd locally (no piping) sar shows a throughput of 25000 blocks per second. At 250 blocks per second it would take days to copy 71Gig.