1748279 Members
4215 Online
108761 Solutions
New Discussion юеВ

pvmove question

 
SOLVED
Go to solution
David Irish
Occasional Contributor

pvmove question

Out of curiousity I was playing around with this command the other day on one of our test servers (L1000 running HP-UX B.11.00 A 9000/800). Our root volume group contains two hard drives. I was thinking it might be nice to move some LVM's from one disk to another on some of our remote production machines (located in other parts of the world). Then I read the man page on the pvmove command and was disappointed to learn that the volume group needed to be deactivated to run the command (I'm assuming this would mean being in maintenence or single user mode for the root VG?). Just out of curiosity I issued the command and was suprised when it finished successfully and the LVM/filesystem was now located on the different drive. Has anyone else tried this with success or was I just lucky? Any comments appreciated.

Thanks David
16 REPLIES 16
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: pvmove question

No, pvmove can be used on active VG's with mounted filesystems and is safe. The restriction is that it is not allowed when the volume group is activated in SHARED mode (ie, more than 1 host). All the disks have to be in one volume group so this does tend to limit remote transfers.
If it ain't broke, I can fix that.
Patrick Wallek
Honored Contributor

Re: pvmove question

Clay is absolutely correct.

I, too, have used the pvmove command with VGs active and filesystems mounted with no ill effects.
Con O'Kelly
Honored Contributor

Re: pvmove question

Hi David

My understanding is that you can move PE's using pvmove when the VG is activated.
This is usually used to free up a disk(PV) in a VG so that it can removed and maybe added to another VG etc.

Cheers
Con
David Irish
Occasional Contributor

Re: pvmove question

Thanks guys for the clarification. I was just re-reading the man page. I've never used VG's in "shared mode". This can certainly help some of our machines. Thanks again.

David
Colin Topliss
Esteemed Contributor

Re: pvmove question

Bear in mind though that you can't move physical volumes that contain lvm striping (ie lvols that have been created using the -I and -i options).

Something to watch out for if you use LVM striping, or are tempted to use it in the future.

Col.
Marc Ahrendt
Super Advisor

Re: pvmove question

Marc Ahrendt
Super Advisor

Re: pvmove question

apologize ...my above response for for a different forum question
hola
Marc Ahrendt
Super Advisor

Re: pvmove question

to make up for my mistake i do have one comment regarding pvmove

i was told it was safer to use "lvextend" and "lvreduce" to move LVs instead of "pvmove" ...the point being that if the mirroring/unmirroing process gets interrupted then you do not lose the LV integrity but if the pvmove gets interrupted then you now have a potentially messed up LV that is definitely split up amongst PVs
hola
David Ritchie
Frequent Advisor

Re: pvmove question

Regarding pvmove corrupting LVM data - I have used pvmove extensively, and this is not consistant with my experience with the command. pvmove uses mirroring to replicate the data on an extent by extent basis - so while you may not have a complete copy
if you interrupt the pvmove, I can not think of a way that you could corrupt or lose data via use of the command.