1827385 Members
4036 Online
109963 Solutions
New Discussion

pvmove question

 
hpuser_6
Advisor

pvmove question

pvmove is such a power tool, however, i can't perform the following the procedure.
pvmove allows us to move a particular logical extends from a vg to a disk that are part of the vg. Why can't pvmove allow us to also
allocate a particular logical from the same vg?
pvmove -n /dev/vg01/lvol4 /dev/dsk/c1t6d0 /dev/vg01/lvol6 /dev/dsk/c3t1d0
anythoughts
6 REPLIES 6
John Dvorchak
Honored Contributor

Re: pvmove question

That would be lvextend. I would lvextend the lv to another disk creating a mirror then lvreduce the original pv from the lv.
lvdisplay -v /dev/vg01/lvol1
PV = /dev/dsk/c1t1d0

lvextend -m 1 /dev/vg01/lvol1 /dev/dsk/c4t4d0

lvreduce -m 0 /dev/vg01/lvol1 /dev/dsk/c1t1d0

Good luck
If it has wheels or a skirt, you can't afford it.
S.K. Chan
Honored Contributor

Re: pvmove question

A few things I noticed .. your command does not look right. Say for instance if you want to move all your extents (lvol4) from cXtXdX to CZtZdZ then you would run ..
# pvmove -n /dev/vg01/lvol4 /dev/dsk/cXtXdX cZtZdZ
Move the logical volume one at a time. I see you got lvol6 in your command line as well. Separate that out.
Another reason for a failed pvmove is if the destination disk does not have enough extents. You would see the error if that happens after you run the pvmove command.
S.K. Chan
Honored Contributor

Re: pvmove question

I'm sorry .. it should be ..
# pvmove -n /dev/vg01/lvol4 /dev/dsk/cXtXdX /dev/dsk/cZtZdZ
hpuser_6
Advisor

Re: pvmove question

what i try to accomplish is this:
the scenarios:
I want to move a particular logical volume in an existing group to a new logical volume with a bigger size, without having to destroy the data on the exisiting logical volume.

That is what i want to know if i can do that.

anythoughts
S.K. Chan
Honored Contributor

Re: pvmove question

I want to move a particular logical volume in an existing group to a new logical volume with a bigger size, without having to destroy the data on the exisiting logical volume.

Ok lets start fresh .. are you refering to all this within the same volume group ? If yes to get you need to lvextend your LV. The pvmove simply moves the extents (re-point if you will) from one disk to another (size of LV remains the same). If no you need to create the new LV in a separate VG and cpio the data over. For exmple I want to create a larger LV (lvol4 - 4GB) in vg02 and then copy from /dev/vg01/lvol4 to /dev/vg02/lvol4.
# lvcreate -L 4000 -n lvol4 /dev/vg02
# newfs -F vxfs /dev/vg02/rlvol4
==> I'm assuming vxfs
# mkdir /temp
# mount /dev/vg02/lvol4 /temp

Now you're ready to copy the data from vg01's lvol4. Make sure the FS is not being accessed (assuming the FS is /data).

# cd /data
# find . -xdev -depth -print | cpio -pudlmv /temp
# vi /etc/fstab
==> Edit your mount table accordingly.

Hopefully that answers your q.
Sunil Sharma_1
Honored Contributor

Re: pvmove question

Hi,
pvmove will not server your purpoes.ou have to use lvextend to increase the size of logical volume first and then you have to extend the File system using extendfs or fsad command.

if you are using Veritas Volume manager you can use single command
vxresize with some swith to increase the size of volume as well as file system online.

Sunil
*** Dream as if you'll live forever. Live as if you'll die today ***