1834250 Members
2154 Online
110066 Solutions
New Discussion

Re: replicate root disk

 
hi_5
Frequent Advisor

replicate root disk

is there any other way to replicate the root disk without using the mirroring method??
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: replicate root disk

hi hi.

You can use the dd command. Check the man page.

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
doug mielke
Respected Contributor

Re: replicate root disk

I've used the dd command to clone systems,

dd if= old disk device name of= new disk device name

start it, go home and tomorrow you have another system...
A. Clay Stephenson
Acclaimed Contributor

Re: replicate root disk

Yes. If you are using identically sized disks then you can simply dd from one drive to the other.

e.g.

src=/dev/rdsk/c0t6d0
DEST=/dev/rdsk/c1t5d0
BS=256k

dd if=${SRC} of=${DEST} bs=256k

You should do this while the system is relatively quiet. Because the filesystems are not unmounted, if you attempt to use the copy as a boot disk, an fsck will be needed and automatically run but I've never had one of these to fail. I do this on my servers each weekend as a 'lifeboat'. If the boot drive fails, I can simply remove it and insert the 'lifeboat' in the boot slot; boot; and all is well. I do this IN ADDITION to mirroring because the lifeboat protects you from two things that mirrors do not: 1) Your own stupidity (e.g. rm -r * .tmp) 2) really, really bad patches.

If it ain't broke, I can fix that.
doug mielke
Respected Contributor

Re: replicate root disk

..and, don't get the dd if= and of= commands backwards. It wont complain while it destoys your rood disk, even if it's with a zero byte file.
Hai Nguyen_1
Honored Contributor

Re: replicate root disk

You can use the dd command:

# dd if=/dev/rdsk/current_root_disk of=/dev/rdsk/duplicate_root_disk bs=1024k

the option bs=1024k speeds up the copy much faster.

Hai
twang
Honored Contributor

Re: replicate root disk

dd should work (dd if=/dev/rdsk/c0t2d0 of=/dev/rdsk/c2t2d0 bs=1024k), but it is not a good command for placing boot utilities on a disk, it is not reliable for creating BDRA structures under an LVM. I recommend to use copyutil which comes with HPUX diag CD.
And I think the best way to replicate root disk is mirroring the root disk, or to use make_tape_recovery to clone the system.
malay boy
Trusted Contributor

Re: replicate root disk

Hi ,
Doug ,your tip is very-very important.dd - simple command but if get it wrong could destroy you server.

regards
mB
There are three person in my team-Me ,myself and I.