1829453 Members
754 Online
109992 Solutions
New Discussion

How copy an OS disk ?

 
OLIVA_1
Regular Advisor

How copy an OS disk ?

Hello,

I have 2 servers (S1 and S2) and I need to install S2 as S1. Unfortunately I haven't got a tape driver on S2 so I can't use an ignite tape.

I have plugged a disk of S1 into S2 and I would like copy S1 OS disk like that:

dd if=/dev/rdsk/c0t5d0 of=/dev/rdsk/c0t10d0 bs=1024

Do you know if this should be work ? Will c0t10d0 disk be bootabled ?


Thanks,
4 REPLIES 4
OLIVA_1
Regular Advisor

Re: How copy an OS disk ?

I made a mistake...
---> I have plugged a disk of S2 into S1
doug mielke
Respected Contributor

Re: How copy an OS disk ?

the dd will work, but you'll need to confirm the drive names with ioscan -fnC disk.
A mistake here could wipe the ariginal drive.
A. Clay Stephenson
Acclaimed Contributor

Re: How copy an OS disk ?

Yes, that will produce a bootable disk but you should increase bs to something larger so the copy will go faster. e.g. bs=1000k. In order for this scheme to work, you must set the SCSI ID of the target drive to match the source drive when you install it in the second server. I also assume that your two servers are identical (or very nearly so). Note, the IP addresses will be identical so one of these must be disconnected from the network until you can assign a new IP addrerss. Because you are doing this copy on mounted filesystems, an fsck will be done on the target machine; you should also do this copy when the machine is an inactive as possible.

Have you considered make_net_recovery?


If it ain't broke, I can fix that.
Steven E. Protter
Exalted Contributor

Re: How copy an OS disk ?

This sounds like a job for Ignite or mirror/ux

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

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