Operating System - HP-UX
1826775 Members
1680 Online
109702 Solutions
New Discussion

About Physical volume groups....

 
SOLVED
Go to solution
OLIVA_1
Regular Advisor

About Physical volume groups....

Hello,

I have a VG configuration with these Physical Volume Groups :

.....
--- Physical volume groups ---
PVG Name pvgwp1data
PV Name /dev/dsk/c5t8d0
PV Name /dev/dsk/c5t9d0
PV Name /dev/dsk/c5t10d0
PV Name /dev/dsk/c5t11d0

PVG Name pvgwp1data_m
PV Name /dev/dsk/c7t1d0
PV Name /dev/dsk/c7t2d0
PV Name /dev/dsk/c7t3d0
PV Name /dev/dsk/c7t4d0
....

I would like pull out physically the 4 disks c5tXd0, how can I remove physical volume group "pvgwp1data" ?
I'm not familiar with this kind of configuration.

Thanks,
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: About Physical volume groups....

Shalom OLIVA,

vgexport pvgwp1data

You might wish to remove the logical volumes in it, but that is not a requirement.

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
Chauhan Amit
Respected Contributor

Re: About Physical volume groups....

You need to do a vgreduce on the disks c5tXd0 and then emove '/etc/lvmpvg' file
so that system doesn't use PVG anymore.

-Amit
If you are not a part of solution , then you are a part of problem
OLIVA_1
Regular Advisor

Re: About Physical volume groups....

For my information someone can explain me how can I create 2 physical volume groups with X disks each and with the first volume group mirrored on the second one ?

What command must be used to create this kind of configuration :
.....
--- Physical volume groups ---
PVG Name pvgwp1data
PV Name /dev/dsk/c5t8d0
PV Name /dev/dsk/c5t9d0
PV Name /dev/dsk/c5t10d0
PV Name /dev/dsk/c5t11d0

PVG Name pvgwp1data_m
PV Name /dev/dsk/c7t1d0
PV Name /dev/dsk/c7t2d0
PV Name /dev/dsk/c7t3d0
PV Name /dev/dsk/c7t4d0
....

Ususally I mirror LV with this command :
ï ­ lvextend -m 1 /dev/vg_name/lvol_data /dev/dsk/device_2

Thanks...
Ninad_1
Honored Contributor

Re: About Physical volume groups....

Hi,

I would suggest you to run the following script

pvdisplay -v /dev/dsk/c5t8d0 /dev/dsk/c5t9d0 /dev/dsk/c5t10d0 /dev/dsk/c5t11d0 | awk '/Distribution of physical volume/,/Physical extents/' | egrep -v 'Distribution|Physical|LV Name|^$'| awk '{print $1}' | while read lvname
do
if [[ $(lvdisplay -v $lvname | grep -i Mirror | awk '{print $NF}') = "0" ]]
then
echo $lvname is not mirrored
else
if [[ $(lvdisplay -v $lvname | grep -c stale) != "0" ]]
then
echo $lvname has stale extents
fi
fi
done


to check if all the volumes on the disks you wish to remove are mirrored and dont have any stale extents.
If you are satisfied then you will have to reduce the mirrors of the logical volumes from the c5 disks using
lvreduce -m 0 lvname pv_path
for all volumes
Then remove the disks from the VG

Regards,
Ninad

Ninad_1
Honored Contributor
Solution

Re: About Physical volume groups....

The pvgs must have been created like this
vgcreate -g pvgwp1data /dev/vgname /dev/dsk/c5t8d0 /dev/dsk/c5t9d0 /dev/dsk/c5t10d0 /dev/dsk/c5t11d0
vgextend -g pvgwp1data_m /dev/vgname /dev/dsk/c7t1d0 /dev/dsk/c7t2d0 /dev/dsk/c7t3d0 /dev/dsk/c7t4d0

Then when creating volumes you can do
lvcreate -m 1 -n volname -L size_in_mb -s g /dev/vgname

Regards,
Ninad
Chauhan Amit
Respected Contributor

Re: About Physical volume groups....

q) How to create a Physical Volume Group (PVG)

create a file named /etc/lvmpvg with the following syntax:
VG vg_name
PVG pvg_name
pv_path
...
PVG pvg_name
pv_path
...
VG vg_name
PVG pvg_name
pv_path
...

For example, to use two PVGs "pvgwp1data" and "pvgwp1data_m" in vg01 with and c5t8d0,c5t9d0,c5t10d0 and c5t11d0 in one PVG (pvgwp1data)

c7t1d0,c7t2d0,c7t3d0 and c7t4d0 in the other PVG (pvgwp1data_m) then
contents of the file (/etc/lvmpvg) should be:

VG /dev/vg01
PVG pvgwp1data
PV Name /dev/dsk/c5t8d0
PV Name /dev/dsk/c5t9d0
PV Name /dev/dsk/c5t10d0
PV Name /dev/dsk/c5t11d0

PVG pvgwp1data_m
PV Name /dev/dsk/c7t1d0
PV Name /dev/dsk/c7t2d0
PV Name /dev/dsk/c7t3d0
PV Name /dev/dsk/c7t4d0



q) How to use PVG to mirror logical volumes on specific physical volumes.

Note: in the following text, the volume group will be vg01 and the logical volume will be name lvol_data

After creating the /etc/lvmpvg file as describe above, each copy of your mirror could be force on different PVG.

To achieve this if the logical volume is already created but not mirrored yet, use the following command:

lvchange -s g /dev/vg01/lvol_data
lvextend -m 1 /dev/vg01/lvol_data

If the logical volume is not created yet:
lvcreate -s g -m 1 -n lvol_data -L 200 /dev/vg01


Hope this helps.

-Amit
If you are not a part of solution , then you are a part of problem
Mridul Shrivastava
Honored Contributor

Re: About Physical volume groups....

Systems with mirrored logical volumes often use multiple SCSI controllers to be able to work on in case of hardware failure. To secure that the mirrored extents of a logical volume can always be established on a disk not connected to the same card, PVGs - Physical Volume Groups can be created:
# vgcreate -g [PVG name] vgXY /dev/dsk/cCtTdA /dev/dsk/cCtTdB ...

All stated physical volumes are part of the new PVG.

Further PVGs for an existing volume group can be created or extended by using the vgextend command.

The information of the Physical Volume Group is stored in the ASCII file /etc/lvmpvg. This file can also be created or extended manually, instead of using the vgcreate and vgextend commands. lvmpvg stores the volume-group information for all of the physical volume groups in the system. The information is stored in a hierarchical format. First, it starts with a volume group under which multiple physical volume groups can exist. Under each physical volume group, a list of physical volumes can be specified. There must be at least one physical volume group in each volume group that appears in this file. The physical-volume-group name must be unique within the corresponding volume group, although it is permissible to use a common physical volume group name across different volume groups. There can be as many volume groups in this file as there are in the system.

At following example of /etc/lvmpvg, four hard disks are connected to two SCSI controllers.

# cat /etc/lvmpvg

VG /dev/vg01
PVG scsi0
/dev/dsk/c0t6d0
/dev/dsk/c0t5d0
PVG scsi1
/dev/dsk/c1t2d0
/dev/dsk/c1t1d0

The volume group shows up as follows:

# vgdisplay -v /dev/vg01

...
--- Physical volume groups ---
PVG Name scsi0
PV Name /dev/dsk/c0t6d0
PV Name /dev/dsk/c0t5d0

PVG Name scsi1
PV Name /dev/dsk/c1t1d
PV Name /dev/dsk/c1t2d0

The allocation policy of the logical volumes has to be set to PVG-strict , so that the extents are allocated automatically to a disk within the other PVG when mirroring:

# lvchange -s g /dev/vg01/lvol4
Time has a wonderful way of weeding out the trivial
Mridul Shrivastava
Honored Contributor

Re: About Physical volume groups....

Would like to add few more things to earlier post:
The creation of PVGs does not restrict creation of logical volume mirrors on
particular disks. If a logical volume is created as PVG-strict, mirrors of
the logical volume can be created only on different PVGs. PVGs increase your
flexibility by adding one more option, where you can force mirrors to be on
different physical volume groups.

With just the lvextend command without PVGs, you can force the disks that you
put your original lvol and its mirror onto. As long as you know the device
files for the disks on the different channels, you can force I/O channel
separation using lvextend without using PVGs.

There is an example of PVGs in the "System Administration Tasks" manual
(B2355-90051). Information is in sections of chapter 7 entitled "Should I
Use I/O Channel Separation?" and "Achieving I/O Channel Separation".
Time has a wonderful way of weeding out the trivial