1751802 Members
4939 Online
108781 Solutions
New Discussion

Pvmove is online

 
rescuehp17
Frequent Advisor

Pvmove is online

Can pvmove be done online?

Planning to move the data from no. of disks to single disk.

 

 

21 REPLIES 21
Torsten.
Acclaimed Contributor

Re: Pvmove is online

It can be used online (except the VG is shared - see man page), but it can get tricky.

I prefer a mirror/unmirror procedure.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
rescuehp17
Frequent Advisor

Re: Pvmove is online

Below steps sounds ok:

# pvcreate /dev/rdisk/disknew ==> new disk

# vgextend vgname /dev/disk/disknew

# lvextend -L 74120 /dev/vgname/lvname ==> double the disk space of lvm

# lvextend -m 1 /dev/vgname/lvname ==> mirror

# lvreduce -m 0 /dev/vgname/lvname /dev/disk/diskold

 

 

rescuehp17
Frequent Advisor

Re: Pvmove is online

But the above steps performed and got the following:

PV Name LE on PV PE on PV
/dev/disk/disk34 10 10
/dev/disk/disk35 10 10
/dev/disk/disk36 10 10
/dev/disk/disk37 10 10
/dev/disk/disk38 10 10
/dev/disk/disk39 9 9
/dev/disk/disk40 9 9
/dev/disk/disk41 9 9
/dev/disk/disk42 9 9
/dev/disk/disk43 9 9
/dev/disk/disk131 1641 1641
/dev/disk/disk136 581 581

disk131 and disk136 are new, so I thought when I mirrored and then removed disk34-43, still not removed. Goal to is move all the lvm data from 10 disks to new disks disk131 and disk136. Help is appreciated.

Torsten.
Acclaimed Contributor

Re: Pvmove is online

the lvextend -L step is wrong, don't do this.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
RogerVI
Regular Advisor

Re: Pvmove is online

if you have a mirror license, then use lvextend and lvreduce. In other case, use pvmove.

But if the destination is only one disk, then pvpaths must be indicated in lvextend. Same for lvreduce.

Example:

lvextend -m 1 /dev/vgxx/lvolxxx /dev/disk/diskx  /dev/disk/disky ...

 

Roger
rescuehp17
Frequent Advisor

Re: Pvmove is online

@Torsten., if I don't use lvextend -L, how can I extend the space for that logical volume? Since there are 2 other lvms in that VG...

# pvcreate /dev/rdisk/disknew ==> new disk

# vgextend vgname /dev/disk/disknew

# lvextend -L 74120 /dev/vgname/lvname ==> double the disk space of lvm ==== ignore this step and proceed next??

# lvextend -m 1 /dev/vgname/lvname ==> mirror

# lvreduce -m 0 /dev/vgname/lvname /dev/disk/diskold

 

rescuehp17
Frequent Advisor

Re: Pvmove is online

@RogerVI, so should do the following steps?

# pvcreate /dev/rdisk/disknew ==> new disk

# vgextend vgname /dev/disk/disknew

# lvextend -L 74120 /dev/vgname/lvname 

# lvextend -m 1 /dev/vgname/lvname /dev/disk/disknew /dev/disk/disknew1 ==> mirror

# lvreduce -m 0 /dev/vgname/lvname /dev/disk/diskold /dev/disk/diskold1 ==> removing old disks

Please suggest

 

Torsten.
Acclaimed Contributor

Re: Pvmove is online

For mirroring you need empty space inside the VG.

If you extend the LVOL size, there is no more space for mirroring.

So don't do this step.

 

With

# lvextend -m 1 /dev/vgname/lvname ==> mirror

you specify which LVOL to mirror to which disk.

 

To handle a large number of disks, you should use lvmpvg - with this group definition you specify to mirror from group of disks 1 to the other group (even if one group has only a single disk) -- many to one).

 

 


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Torsten.
Acclaimed Contributor

Re: Pvmove is online

In order to mirror an lvol that resides on several disks (disk1..disk4 in this example) you create a physical volume group
definition like this:

create a text file
/etc/lvmpvg
with this contents:
VG   /dev/vg01
PVG  PVG0
/dev/disk/disk1
/dev/disk/disk2
/dev/disk/disk3
/dev/disk/disk4
PVG  PVG1
/dev/disk/disk5



Before mirroring a LV you need to set it’s allocation policy to PVG-strict, e.g:
# lvchange -s g /dev/vg01/lvol1

/usr/sbin/lvextend [-A autobackup] {-l le_number | -L lv_size | -m mirror_copies} lv_path [pv_path ... | pvg_name ...]

Then you create the physical volume, extend the VG and finally mirror the LVOL:


# pvcreate /dev/rdisk/disk5
# vgextend vg01 /dev/disk/disk5
# lvextend -m 1 /dev/vg01/lvol1 PVG1


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!