cancel
Showing results for 
Search instead for 
Did you mean: 

Some doubts on pvmove

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

Some doubts on pvmove

Hi All,

I am new to HP-UX.

My Questions:

1)Can we move any type of data (oracle or normal) using pvmove?


2)Moving a LV from one PV to another PV:

a)First we have to include the new PV in to the VG where that LV exists.

# pvcreate /dev/dsk/c1t0d0

# vgextend /dev/vg01 /dev/dsk/c1t0d0

b)To move the data:

#pvmove -n /dev/vg01/markets /dev/dsk/c0t0d0 /dev/dsk/c1t0d0

My under standing

All the data of the logical volume "/dev/vg01/markets" located in "/dev/dsk/c0t0d0" will be moved to "/dev/dsk/c1t0d0" , then here after that LV keeps new PV in its record, and older PV will be removed automatically from existing VG. Therefore LV will operate from new PV.


Am i correct?



3)I would like to move whole data of a PV to another PV:


a)First we have to include the new PV in to the VG where that LV exists.

# pvcreate /dev/dsk/c1t0d0

# vgextend /dev/vg01 /dev/dsk/c1t0d0

b)Used following command to move the data from one PV to another PV:

#pvmove /dev/dsk/c0t0d0 /dev/dsk/c1t0d0

My Questions:

3.1)Should both disks be in same size?

3.2)Can we have size of new disk more than older one?

3.3)After executing the above command, Do VG and LV know about new PV automatically and server will work as earlier?

3.4)Older PV removed automatically from VG?
10 REPLIES 10
Patrick Wallek
Honored Contributor
Solution

Re: Some doubts on pvmove

1) YES

2a) Correct
2b) All correct, EXCEPT the old PV will NOT be removed automatically from the VG. You must do this yourself with the 'vgremove' command.

3a) Correct
3b) Correct

3.1 / 3.2) The disks should be the same size or larger if you want ALL data from the original disk to reside on the new disk.

3.3) Yes.

3.4) No, you must use 'vgreduce' to reduce the OLD PV out of the VG.
Emil Velez
Honored Contributor

Re: Some doubts on pvmove

1. It does not matter what data is in the LV that you move. Pvmove works at the LVM level and moves the 4 MB (default) PE from 1 disk to another.

your disks will be busy if the data is being accessed at the same time but it can be done online. There are limitations like the first 3 LVs in vg00 (boot, swap, and root) have to be contiguous on a single disk but all of the other LVs even ones used for swap do not have to be contiguous.


2a. yet
2b. You can just say
pvmove -n /dev/vg01/markets /dev/dsk/c0t0d0

and it will move the PEs of the lv to any other disk in the vg

pvmove /dev/dsk/c0t0d0

this will move any LV on that disk to other disks in the VG.

lots of flexability with the command.

3a. yes
3.1 not necessarily as long as there is space to move the PEs
3.2 yes as long as the VG can use a disk that size.
3.3 of course LVM configuration is in sync after every command
3.4 no the disk could be used for new LVs or removed from VG.

since you figured out but asking these questions it shows you are getting a good handle on LVM.

Good luck

Highlighted
Elmar P. Kolkman
Honored Contributor

Re: Some doubts on pvmove

> 3.1)Should both disks be in same size?

The disks don't have to be the same size. You could even move from 1 disk to multiple new 'disks' (LUNs, for instance). But keep in mind that the new PV is not used after the maximum size you used when creating the VG.
This size is the PE_size * max_PE/PV, shown in:
vgdisplay

> 3.3)After executing the above command, Do VG and LV know about new PV automatically and server will work as earlier?

It's even better: during the pvmove the server keeps on working as before (though I/O might be a bit slower). This action is an online action!

> 3.4)Older PV removed automatically from VG?

This you have to do yourself. The old PV is removed automatically from the LV only.
If all PE's on the disk are free, you can remove it from the VG using vgreduce.
Every problem has at least one solution. Only some solutions are harder to find.
Torsten.
Acclaimed Contributor

Re: Some doubts on pvmove

Maybe the command "vgmove" (11.31) is a better option here.

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!   
senthil_kumar_1
Super Advisor

Re: Some doubts on pvmove

Hi All,

Thanks a lot for you valid answers.

Could you please answer to below questions.

1)After pvmove, will data be still available in odlder PV?

2)While do pvmove, will PE size on dest disk be same as source disk (4mb / 8mb /16mb)?

3)Which is better option , doing pvmove online (runlevel 3) or in LVM manitenance mode?

4)If LVM mode, will all above mentioned commands work fine?

5)How to use vgmove, this command is not available in my server, do we need to install it separately?

Patrick Wallek
Honored Contributor

Re: Some doubts on pvmove

1) NO. The data has been moved OFF of that PV.

2) The PE size is set at the VG level, so this is independent of the pvmove command. The PE Size will be the same for ALL disks in a particular VG.

3) A pvmove can be done in run level 3, however I would do it when activity is light. If you want to be really safe, shut down any applications that are using those VGs / PVs.

5) Are you on 11.31? It is probably a new command with the latest release of 11.31. Here's a link to the vgmove man page:
http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02273776/c02273776.pdf
senthil_kumar_1
Super Advisor

Re: Some doubts on pvmove

Hi

I just red the man pages of vgmove.

I have some doubts.

1)Do we need to have same number of new disks same with same size as total number of disks available in VG?

2)If there is one VG (vg00) having 100GB , this 100GB spreads accross 4 disks (/dev/disk/disk1 (20Gb), /dev/disk/disk2 (25Gb), /dev/disk/disk3 (40GB), /dev/disk/disk4 (15GB)), now I would like to move this VG, for that, can we have one pv "/dev/disk/disk5" with 100GB (or above 100Gb)?

3)Can we do vgmove online?

4)What is the impact while doing online?

Bijeesh
Respected Contributor

Re: Some doubts on pvmove

1)No , â ¢The migration succeeds even if the number of destination PVs is different from the number of original PVs.

2)It is possible

3)yes

4)The volume group must be activated before running the vgmove command. If the vgmove command is interrupted before it completes, the volume group is in the same state it was at the beginning of the vgmove command.


reffer:-
http://docs.hp.com/en/5992-6576/ch03s05.html


senthil_kumar_1
Super Advisor

Re: Some doubts on pvmove

Hi

1)Please check if following steps are correct, if I am going to use following steps to vgmove.

# cat newdiskfile
/dev/disk/disk5


# vgmove -i newdiskfile -f diskmap.txt /dev/vg00


# vgmove -f diskmap.txt /dev/vg00


Are above steps correct?


2)Will VG be intact if any thing goes wrong while doing vgmove?