Operating System - HP-UX
1835224 Members
2695 Online
110078 Solutions
New Discussion

Mirroring Disks on an HP-UX Server

 
paul perugini
New Member

Mirroring Disks on an HP-UX Server

I have a server with 4 physical disks. The first disk is defined as vg00 and has 8 file systems on it.

The second disk is defined as vg01 and has 1 file system on it.

How can I make use of the other 2 disks so that they mirror what the first two disks have on them?
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Mirroring Disks on an HP-UX Server

Do a swlist. If you have Mirror/UX installed then it's easy. If not, you need to purchase the product. HP-UX mirrors at the logical volume level rather than disk or filesystem.


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

Re: Mirroring Disks on an HP-UX Server

mirror/ux is a paid add in product but you can make two mirror copies of any logical volume.

lvextend -m 1 /dev/vg01/lv_name /dev/dsk/c#t#d#

its better to have the last parameter and dicatate where the mirror is going.

Rules: The mirror target needs to be in the same volume group as the logical volume being mirrored.

If the extra two disks are not in a volume group, use vgextend /dev/vg01 /dev/dsk/c#t#d# to do so.

Obviously you need real names for the disks.

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
paul perugini
New Member

Re: Mirroring Disks on an HP-UX Server

I know I don't have the add on product. So it seems that I could NEVER mirror the O/S since vg00 has more than 1 logical volume assigned.

If I purchase the add on product at a later date, can I mirror up the machine without destroying the existing filesystems?

RAC_1
Honored Contributor

Re: Mirroring Disks on an HP-UX Server

Do not worry if you do not have mirror-ux. You can always prepare the static copy of your root disk. Alow samw way you can create staic copy of vg01.

Also you need not destroy File system on vgs in order to create mirror with mirror-ux software.

The procedure to create staic copy is as follows.

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
A. Clay Stephenson
Acclaimed Contributor

Re: Mirroring Disks on an HP-UX Server

Absolutely. Now the one "gotcha" is this. In order to mirror, you need to add another disk (PV) to an existing volume group. The maximum number of PE's is determined at the time a volume group is created. For example, if you now have a 9GB boot disk but you are going to add a 36GB disk to vg00, you will only be able to access the first 9GB of the 36GB disk --- unless you overrode the defaults when you first created the VG.

The beauty of Mirror/UX is that if you only use hot-plug disks, you can replace drives without ever having to shutdown --- and this includes boot drives.
If it ain't broke, I can fix that.
paul perugini
New Member

Re: Mirroring Disks on an HP-UX Server

Thank you for your rapid replies! I couldn't have done it without you!

There's nothing more inspiring than being rushed for time.