Operating System - HP-UX
1833415 Members
3487 Online
110052 Solutions
New Discussion

Mirroring for 2 hard disks

 
Andy Cole_1
Frequent Advisor

Mirroring for 2 hard disks

Hi, i have 2 hard disks in my server. How do i do a mirroring of the 2 hard disks? Using software? Can i do without a software? thanks
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: Mirroring for 2 hard disks

Andy,

The proper way to do this is with the HP software product, MirrorDisk/UX. Both of the disks will be made part of the same Volume Group, and then the individual Logical Volumes are mirrored within the volume group.
http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=B2491BA


Pete

Pete
Sundar_7
Honored Contributor

Re: Mirroring for 2 hard disks

You need the MirrorUX/DX software from HP to do the software mirror in HP-UX.

MirroUX/DX can do RAID levels 0 and 1 - It cannot do RAID 3/5. Though you can mirror a striped volume, I would not call that a "true" mirrored stripes.

There is a dirty alternative to keep a mirror copy of the disks - you can use the dd command and schedule the disk to disk transfer at an interval that you find suitable depending on the rate at which the data in your source disk is bound to change.

This is not going to cost you any money but this is very CPU intensive and probably not recommended either.
Learn What to do ,How to do and more importantly When to do ?
YoungHwan, Ko
Valued Contributor

Re: Mirroring for 2 hard disks

Mirror UX is purchasable software.
The Software itself is available on the Application CD Sets (DARTS) but it is codeword protected.
It is located on CD #1 of the set.
1. # swinstall -s /cdrom
2. Action => Add new cordword
3. select MirrorDISK/UX and mark for install
4. Install and reboot.
5. check the installed software(# swlist |grep -i mirror)


ex) Root Volume Mirroring.
#pvcreate -B /dev/rdsk/c0t1d0
#mkboot -l /dev/rdsk/c0t1d0
#mkboot -a "hpux (;0)/stand/vmunix" /dev/rdsk/c0t1d0
#vgextend /dev/vg00 /dev/rdsk/c0t1d0
#lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t1d0
#lvextend -m 1 /dev/vg00/lvol2 /dev/rdsk/c0t1d0
#lvextend -m 1 /dev/vg00/lvol3 /dev/rdsk/c0t1d0
#lvlnboot -r /dev/vg00/lvol1
#lvlnboot -s /dev/vg00/lvol2
#vgcfgbackup vg00


# lilnboot -v
# strings /etc/lvmtab
# lvdisplay -v /dev/vg00/lvol1
RAC_1
Honored Contributor

Re: Mirroring for 2 hard disks

without Mirroring software you can create the static copy of your boot disk. Once created, you should update it peridically.

Note: The following example is using the disk c1t6d0 and the

volume group vg01

1) Initialize the disk and make it bootable

pvcreate -B /dev/rdsk/c1t6d0

Note: the -B parameter tells pvcreate that this will be a bootable

disk.

mkboot /dev/dsk/c1t6d0

mkboot -a "hpux" /dev/rdsk/c1t6d0

2) Create the volume group

mkdir /dev/vg01

mknod /dev/vg01/group c 64 0x010000

vgcreate /dev/vg01 /dev/dsk/c1t6d0

3) Find the size of each logical volume in vg00

vgdisplay -v /dev/vg00 | more

look at LV Size (Mbytes) for each logical volume and note it.

Note: this example will use these value:

lvol1 84M

lvol2 256M

lvol3 140M

lvol4 500M

lvol5 64M

lvol6 20M

lvol7 500M

lvol8 500M

Note: The size of the new logical volumes needs to be exactly the

same as the size of the logical volumes on the primary root disk.

4) Create the first 3 logical volumes contiguous (needed by the system)

lvol1:

lvcreate -L 84 -C y -r n /dev/vg01

lvol2:

lvcreate -L 256 -C y -r n /dev/vg01

lvol3:

lvcreate -L 140 -C y -r n /dev/vg01

5) Now create the other logical volumes

lvol4:

lvcreate -L 500 /dev/vg01

lvol5:

lvcreate -L 64 /dev/vg01

lvol6:

lvcreate -L 20 /dev/vg01

lvol7:

lvcreate -L 500 /dev/vg01

lvol8:

lvcreate -L 500 /dev/vg01

6) Copy each logical volume except the swap which is usually lvol2.

dd if=/dev/vg00/rlvol1 of=/dev/vg01/rlvol1 bs=1024k

dd if=/dev/vg00/rlvol3 of=/dev/vg01/rlvol3 bs=1024k

dd if=/dev/vg00/rlvol4 of=/dev/vg01/rlvol4 bs=1024k

dd if=/dev/vg00/rlvol5 of=/dev/vg01/rlvol5 bs=1024k

dd if=/dev/vg00/rlvol6 of=/dev/vg01/rlvol6 bs=1024k

dd if=/dev/vg00/rlvol7 of=/dev/vg01/rlvol7 bs=1024k

dd if=/dev/vg00/rlvol8 of=/dev/vg01/rlvol8 bs=1024k

7) Verify the integrity of all the new volume except swap.

Note: The following lines are base on a system with vxfs

filesystems except for /stand (lvol1) which needs to be hfs.

fsck -F hfs /dev/vg01/rlvol1

fsck -F vxfs /dev/vg01/rlvol3

fsck -F vxfs /dev/vg01/rlvol4

fsck -F vxfs /dev/vg01/rlvol5

fsck -F vxfs /dev/vg01/rlvol6

fsck -F vxfs /dev/vg01/rlvol7

fsck -F vxfs /dev/vg01/rlvol8

8) Now configure the Boot Data Reserved Area (BDRA)

Note: The following commands assume that /stand is lvol1,

swap is lvol2 and / is lvol3

lvlnboot -b /dev/vg01/lvol1 /dev/vg01

lvlnboot -r /dev/vg01/lvol3 /dev/vg01

lvlnboot -s /dev/vg01/lvol2 /dev/vg01

lvlnboot -d /dev/vg01/lvol2 /dev/vg01

9) Modify the fstab file on the new disk.

a) If /tmp_mnt doesn't exist create it

mkdir /tmp_mnt

b) Mount the new root filesystem on /tmp_mnt

mount /dev/vg01/lvol3 /tmp_mnt

c) change to etc directory on the new disk.

cd /tmp/etc

d) Modify all occurence of vg00 in the fstab for vg01

sed "s/vg00/vg01/" fstab > fstab.out

mv fstab fstab.BAK

mv fstab.out fstab

e) Unmount the new root filesystem

cd /

umount /tmp_mnt


Anil
There is no substitute to HARDWORK
Kyri Pilavakis
Frequent Advisor

Re: Mirroring for 2 hard disks

Please see atached file, which should be useful to u.

kyris

[ JUST as a side line, I hope u ALL know by now GREECE 1 - Portugal 0 ]
Bosses don't undestand..HP does
Ted Buis
Honored Contributor

Re: Mirroring for 2 hard disks

Which server do you have? What OS?
Mom 6