Operating System - HP-UX
1833642 Members
5076 Online
110062 Solutions
New Discussion

Re: LVM : How to create the logi.volume in alternate path ?

 
Saravanan_6
Advisor

LVM : How to create the logi.volume in alternate path ?

Hi All.,

Can someone pls answer to the following query.

In LVM, I created a volume group ( /dev/vg02 ) which has 3 different disks, One is primary link and others are alternate links.

And 4 logical volumes are created in the primary disk (/dev/dsk/c5t5d0). Now i want to create the logi.volumes in alternate link (/dev/dsk/c34t3d1) instead of primary link.

So i used vgreduce to change the primary path to alternate path.

# vgreduce vg02 /dev/dsk/c5t5d0
vgreduce: Physical volume "/dev/dsk/c5t5d0" could not be removed since some of its
physical extents are still in use.
#

# vgdisplay -v /dev/vg02

PV Name /dev/dsk/c5t5d0
PV Name /dev/dsk/c34t3d1
PV Name /dev/dsk/c34t3d2

#

How can i create a logical volumes in /dev/dsk/c34t3d1 and /dev/dsk/c34t3d2 disks without removing the previous log.volumes created in /dev/dsk/c5t5d0.

Regards
Saravanan
5 REPLIES 5
Peter Godron
Honored Contributor

Re: LVM : How to create the logi.volume in alternate path ?

Hi,
from "man vgreduce"
"Before executing vgreduce, remove all logical volumes residing on each physical volume represented by a pv_path by executing lvremove (see lvremove(1M))."

James R. Ferguson
Acclaimed Contributor

Re: LVM : How to create the logi.volume in alternate path ?

HI Saravanan:

Depending upon the number and distribution of free physical extents, you may be able to use 'pvmove' to isolate a logical volume on the disk you want. For instance:

# pvmove -n /dev/vg02/lvol1 /dev/dsk/c5t5d0 /dev/dsk/c34t1d1

If you use 'pvmove' do *not* interrupt it during its execution. To do so may leave your logical volume in an unusable state.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: LVM : How to create the logi.volume in alternate path ?

Are the devices you mention actually different paths to the same disk or are they different disks and you are trying to mirror to them?

I think you may be trying to have c5t5d0 be the primary and c34t3d1 and c34t3d2 be mirror copies?

If so you need to do:

lvextend -m 1 /dev/vg02/lvol1 /dev/dsk/c34t3d1
lvextend -m 1 /dev/vg02/lvol2 /dev/dsk/c34t3d1
lvextend -m 1 /dev/vg02/lvol3 /dev/dsk/c34t3d1
lvextend -m 1 /dev/vg02/lvol4 /dev/dsk/c34t3d1

lvextend -m 1 /dev/vg02/lvol1 /dev/dsk/c34t3d2
lvextend -m 1 /dev/vg02/lvol2 /dev/dsk/c34t3d2
lvextend -m 1 /dev/vg02/lvol3 /dev/dsk/c34t3d2
lvextend -m 1 /dev/vg02/lvol4 /dev/dsk/c34t3d2

Substitute your LV names in place of lvol1-4 in the above commands.

Note that this also requires that you have the MirrorDisk/UX product installed on your system. This is something that you must BUY.
Patrick Wallek
Honored Contributor

Re: LVM : How to create the logi.volume in alternate path ?

My second set of 4 lvextend commands should be:

lvextend -m 2 /dev/vg02/lvol1 /dev/dsk/c34t3d2
lvextend -m 2 /dev/vg02/lvol2 /dev/dsk/c34t3d2
lvextend -m 2 /dev/vg02/lvol3 /dev/dsk/c34t3d2
lvextend -m 2 /dev/vg02/lvol4 /dev/dsk/c34t3d2
Geetha_1
Regular Advisor

Re: LVM : How to create the logi.volume in alternate path ?

I agree with Patrick. These don't seem to be alternate links to the same disk. If not, you would want to create mirror copies on the other disks.