[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lvm2 - question about pvmove

In <537f90650907131240t37ff3fa9k2e72f498eec26163@mail.gmail.com>, Mike 
Castle wrote:
>On Mon, Jul 13, 2009 at 12:24 PM, Boyd Stephen Smith
>Jr.<bss@iguanasuicide.net> wrote:
>> pvcreate /dev/sdc1
>> pvcreate /dev/sdc2
>> pvcreate /dev/sdc3
>> pvcreate /dev/sdc4
>> vgextend $vg /dev/sdc1
>> vgextend $vg /dev/sdc2
>> vgextend $vg /dev/sdc3
>> vgextend $vg /dev/sdc4
>> pvmove /dev/sda2
>> pvmove /dev/sdb
>> vgreduce $vg /dev/sda2
>> vgreduce $vg /dev/sdb
>> pvremove /dev/sda2
>> pvremove /dev/sdb
>Wouldn't you want to move the first pvremove up after the first
>pvmove?  Otherwise the second pvmove might choose to move onto the
>device you just cleared out.

Sort of.  I was a bit sloppy there.

The last 6 lines should be rearranged:
pvmove /dev/sda2
vgreduce $vg /dev/sda2
pvmove /dev/sdb
vgreduce $vg /dev/sdb
pvremove /dev/sda2
pvremove /dev/sdb

You could also move the first pvremove up a bit.  Anytime after the first 
vgreduce is fine.

Also, the pvmove commands might be optional.  ISTR that vgreduce is smart 
enough to perform a pvmove if the PV being removed still has PEs allocated.

Finally, the pvremove command are good practice but optional.  LVM will not 
complain if those devices suddenly disappear because they are not associated 
with a known VG.
Boyd Stephen Smith Jr.           	 ,= ,-_-. =.
bss@iguanasuicide.net            	((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy 	 `-'(. .)`-'
http://iguanasuicide.net/        	     \_/

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply to: