Operating System - HP-UX
1834936 Members
2197 Online
110071 Solutions
New Discussion

Re: disk copy procedure in HPUX

 
SOLVED
Go to solution
Shankar_6
Regular Advisor

disk copy procedure in HPUX

Hi all,

Assume i have HPUX server with one single hard disk.I need the procedure to copy this disk to another and make it as bootable if the first one fails(something like mirroring).I dont have Mirror UX installed.Let me know how to do this by dd command and also let me know the other way if exists.

regards
shankar
3 REPLIES 3
RAC_1
Honored Contributor
Solution

Re: disk copy procedure in HPUX

Here is the manual way to create a secondary bootable device as a copy of the primary root disk (not a mirror).

Example:

primary disk= /dev/dsk/c0t6d0

seconday disk= /dev/dsk/c4t6d0

mkdir /dev/vgbroot

mknod /dev/vgbroot group c 64 0x020000

Note: make sure minor node is unique - your choice.

pvcreate -fB /dev/rdsk/c4t6d0

mkboot /dev/rdsk/c4t6d0

mkboot -a "hpux -lq" /dev/rdsk/c4t6d0

mkboot -b /usr/sbin/diag/lif/updatediaglif -p ISL -p HPUX -p AUTO -p LABEL -p PAD
/dev/rdsk/c0t8d0
updatediaglif2 it is 64 bit kernel.

lifcp /dev/rdsk/c4t6d0:AUTO -

Note: this is to confirm your AUTO file is ok.

vgcreate /dev/vgbroot /dev/dsk/c4t6d0

lvcreate -L {sizeofstand} -s y -C y -r n -n \ bstand /dev/vgbroot

lvcreate -L {sizeofswap} -s y -C y -c n -r n\ -M n -n bswap /dev/vgbroot

lvcreate -L {sizeofroot} -s y -C y -r n -n broot /dev/vgbroot

lvcreate -L {sizeofusr} -s y -n busr \ /dev/vgbroot

lvcreate -L {sizeoftmp} -s y -n btmp \ /dev/vgbroot

Continue in this manner for every lvol on your primary root disk matching the order on the disk, the size and using any naming convention you want (e.g. blvol1, blvol2, etc) I like broot, bswap, etc. Likewise the volume group can be any name (vgbroot, vg02, vgaltboot, etc)

***Next steps are important or you won't boot from the new disk.

lvlnboot -b /dev/vgbroot/bstand

lvlnboot -r /dev/vgbroot/broot

lvlnboot -s /dev/vgbroot/bswap

lvlnboot -d /dev/vgbroot/bswap

lvlnboot -v

check the output should have vg00 and vgbroot as bootable volume groups.

dd all the lvols on the primary disk to the lvols on the second disk. You can also mount and use cpio if you wish.

Example:

dd if=/dev/vg00/rlvol1 of=/dev/vgbroot/rbstand bs=64k (or whatever bs you want to use)

After your dd's or cpio's are complete, then fsck your filesystems.

Need to edit the fstab on the 2d disk so that it will properly mount file systems.

mkdir /mnt

mount /dev/vgbroot/broot /mnt

cd /mnt/etc

cp fstab Ofstab

edit /mnt/etc/fstab

change the "vg00" to "vgbroot" for all the file systems you put on the second bootable device. Save the file. Also copy the file to /mnt/etc/Bfstab.

umount /dev/vgbroot/broot

You should now be able to boot to the second bootable device (either use setboot -p to change you boot path or interrupt the boot and select the second disk boot path). After that the system should come up and run and include all your other mount points, applications, etc.

This process can be automated and changed, etc.

It has saved us many times and shortened what could have been major outages to a simple reboot.
There is no substitute to HARDWORK
Shankar_6
Regular Advisor

Re: disk copy procedure in HPUX

thanks a lot..!!!
Matthew_50
Valued Contributor

Re: disk copy procedure in HPUX

if you use 'dd', i suggest switch to single user mode.

primary: /dev/rdsk/c1t12d0
second: /dev/rdsk/c0t12d0

#dd if=/dev/rdsk/c1t12d0 of=/dev/rdsk/c0t12d0 bs=256k