Operating System - HP-UX
1836402 Members
2484 Online
110100 Solutions
New Discussion

Re: physical volume group

 
Mauro Cimino_2
Frequent Advisor

physical volume group

Hwen I create a vg with pvg with 2 disk, the mirror on 2 disk i automatically done?
9 REPLIES 9
Ravi_8
Honored Contributor

Re: physical volume group

Hi,
when you create a vg on a disk mirror on the second disk wouldn't be created automatically.

Mirror disk operations require the installation of the optional HP MirrorDisk/UX software, which is not included in the standard HP-UX
never give up
Ricardo Bassoi
Regular Advisor

Re: physical volume group


Hi !

When you create a vg in a disk that is already a mirror you need to resync the disks in order to have the vg in the other disk. Only the data are saved in both disks without an external resync !

The command to resync the mirror:

vgsync /dev/vgnew

Once the vg has been synced, do a vgdisplay to make sure the lv's have been mirrored correctly,

vgdisplay -v /dev/vgnew

If you still have doubts go to the HP manual at http://www.docs.hp.com
specifically:

http://www.docs.hp.com/hpux/onlinedocs/B2355-90701/B2355-90701.html

Read the section:
Mirroring Root, Boot, and Primary Swap Logical Volumes

This gives you step by step instructions.


Regards
If you never try, never will work
Armin Feller
Honored Contributor

Re: physical volume group

Hi,

if you create a volume group with PVGs:

# vgcreate -g [PVG name] vgXY /dev/dsk/cCtTdA /dev/dsk/cCtTdB ...

then LVM will take about the right policy of the lvols, even if you extend then or if you create mirrors. Importent is that the allocation of the lvols is also PVG-strict, check this with:

# lvdisplay /dev/vgXY/lvolX

Hope that helps.

Regards ...
Armin
Stanimir
Trusted Contributor

Re: physical volume group

Disk to be used as an additional mirror copy will be /dev/dsk/c0t5d0 on which as well the root as the swap logical volume will be mirrored. The primary mirror copy will be on /dev/dsk/c0t6d0.

# pvcreate -B /dev/rdsk/c0t5d0
# vgextend /dev/vg00 /dev/dsk/c0t5d0
# mkboot -l /dev/rdsk/c0t5d0
# mkboot -a "hpux" /dev/rdsk/c0t5d0
Or, use the -lq option to allow the system to boot in the event that one of the disks is unavailable, resulting in a loss of quorum.
# mkboot -a "hpux -lq" /dev/rdsk/c0t5d0
NOTE: Use the -lq option when the root volume group contains only 2 disks. If more than 2 disks are in the root volume group, the -lq option is not needed as quorum will be maintained even if 1 disk fails.
# lifcp /dev/rdsk/c0t5d0:AUTO -
Alternatively, one could set the alternate boot path variable according to e.g.
# setboot -a 8/0/19/0.5.0
The hardware address of the disk that will become the mirror disk can be determined with 'ioscan -fnC' disk. To check use setboot without any arguments.
Use pvdisplay -v to the order of the logical volumes on the primary disk.
# pvdisplay -v

NOTE: In the following, the standard sequence lvol1, lvol2, lvol3, and so forth, is assumed.
Mirror the boot logical volume, primary swap logical volume, root logical volume and other logical volumes as needed, to the mirror disk in the correct sequence

# lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c0t5d0
# lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c0t5d0
# lvextend -m 1 (additional LV)
Use pvdisplay -v to the order of the logical volumes on the mirror disk to insure they are in the correct order.
# pvdisplay -v
Update all physical volumes in the volume group so that the logical volume become the root, boot, primary swap, or a dump volume when the system is next booted:
For HP-UX 10.20 (not updated to) and 11.X only:
# lvlnboot -r /dev/vg00/lvol3 /dev/vg00
# lvlnboot -b /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
For HP-UX 10.01, 10.10, and updates to 10.20 only:
# lvlnboot -r /dev/vg00/lvol1 /dev/vg00
# lvlnboot -s /dev/vg00/lvol2 /dev/vg00
# lvlnboot -d /dev/vg00/lvol2 /dev/vg00
Check with
# lvlnboot -v
Both disks must be listed for root, boot and swap definitions.

NOTE: If forgotten, it often occurs that the system has to be booted in LVM maintenance mode. If you need to know how to boot systems in LVM maintenance mode or other mode, please refer to document OZBEKBRC00000607.

In order to test the mirror configuration, shut down the system and boot from the mirror disk.
# shutdown -ry 0
The system will shut down and reboot. As the system starts to come back up, look for the message (system's output may vary):
TO INTERRUPT THE BOOT SEQUENCE, PRESS ...
Interrupt the boot sequence. This will display the Boot Admin display. At the boot_admin> prompt type:
bo Mirror_disk_hardware_address or
bo alt
if the alternate boot device has been configured. The system will prompt to interact with IPL, answer 'no', and the system will boot from the mirror root disk.
Mauro Cimino_2
Frequent Advisor

Re: physical volume group

Yes, I think Iknow what you said, but I don't know the use of pvg. If I create the vg with pvg and two diwk, the two disk are automatically in mirror? What differences between this and if I create the vg without pvg and I make vgextend and lvcreate and lvextend -m 1 ?

When I have to use pvg?
Steven E. Protter
Exalted Contributor

Re: physical volume group

the command lvexend -m 1 creates the mirrors.

You can't do what you want with a single command line

lvextend -m(for mirror copies) 1 creates the mirror.

You've got some very good, thorough answers in the prior posts.

Outline for what you are tying to do:

Create volume group or exetend an existing one.

create logical volume if it doesn't already exist.

extend the logical volume to a mirror copy specifying what physical disk you want to use.

P
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
Mauro Cimino_2
Frequent Advisor

Re: physical volume group

and then what does the pvg do?
Ricardo Bassoi
Regular Advisor

Re: physical volume group


In my own way I call it a "dirty" mirror (VG) vs a "clean" mirror (PVG). Imagine you got 4 disks (A,B,C,D) and you're going to setup you VG.
Clean-mirror
============
You would setup the VG by putting A and B in PVG1 & C and D in PVG2 when you create your VG the first time using "-g" option to define the PVG name. Now when you create you LVs and you want to mirror say 1 copy you would want the mirrored copy to reside in a separate PVG instead so that you know your mirrored copies are always in PVG2 for example. This would also help in disaster recovery situation. The "lvcreate" command has "-s g" option that tells it to do a PVG-strict mirror. Going forward extending your existing LVs would just be a straight forward "lvextend" since it was already defined as PVG-strict.
Dirty-mirror
============
You setup the VG in a normal manner. In the creation of your LVs, if you simply say mirror 1 copy and let LVM figure out where to put it's mirrored copy then you may end up in a siuation whereby your mirrored copy can reside anywhere in A,B,C,D even on the disk where the primary copy sits ! Having said that you can actually tell lvextend to put your mirror-copy to a specific disk but then you would have to keep track of the PEs, etc, etc. If PVG is setup this is done automatically.
If you never try, never will work
Trond Haugen
Honored Contributor

Re: physical volume group

Forst of all LVM-mirroring is done on lvol level (not disks, VGs nor PVGs).
Mirroring has to be done on separate disks. Preferably on different controllers. Now if you have two disks on each controller you can use PVGs as Ricardo explained to make sure the mirrors are on differnet controllers. In his clean example that would be A & B on one controller and C & D on the other.

Regards,
Trond
Regards,
Trond Haugen
LinkedIn