Re: How to remove LVM Physical Volume from Volume Group?

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



On 06/24/2014 10:11 PM, Ljubomir Ljubojevic wrote:
> On 06/24/2014 09:59 PM, Mauricio Tavares wrote:
>> On Tue, Jun 24, 2014 at 3:56 PM, Zhang, Jonathan <zhangj@xxxxxxxxxxxxx> wrote:
>>> The doc is recommend you do pvremove first and then run vgreduce.
>>> But you will get error something like "...you need to remove from volume group first before delete the physical volume" (the message makes sense for me. Need to removing from volume group first then removing the physical one)
>>>
>>> While ago I run "vgrreduce" first and then do "pvremove". It worked fine for me.
>>>
>>         I myself always thought you would pvmove, then vgreduce, and
>> then pvremove. Unless you also had to resize the lv first
>>
>>
>>> -----Original Message-----
>>> From: centos-bounces@xxxxxxxxxx [mailto:centos-bounces@xxxxxxxxxx] On Behalf Of Eero Volotinen
>>> Sent: Tuesday, June 24, 2014 12:45 PM
>>> To: CentOS mailing list
>>> Subject: Re:  How to remove LVM Physical Volume from Volume Group?
>>>
>>> 2014-06-24 22:31 GMT+03:00 Zhang, Jonathan <zhangj@xxxxxxxxxxxxx>:
>>>
>>>> Fidsk -l (you will see sdd5, sdd6 and sdd7) Pvdisplay (to make sure
>>>> the Allocated PE on /dev/sdd7 Vgreduce vg_data /dev/sdd7 Pvremove
>>>> /dev/sdd7
>>>>
>>>> (before you run vgreduce you need to move all data from sdd7 to new
>>>> dic
>>>>
>>>>
>>> this is wrong way to do this. see the real docs at:
>>> https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/disk_remove_ex.html
>>>
>>> --
>
>
> As like many time before, as soon as Isent the e-mail with a question, a
> lightbulb went off in my mind.
>
> 1. Unmount filesystem (I only have one in the group) on Logical Volume.
> 2. Resize Logical Volume since I stretched it before (did not know how
> all that goes). I resized it to well over the size of sdd7. I used LVM
> GUI for filesystem+LV resize in one go.
>
> Now:
> 3. pvmove to move away all allocated extents
> 4. vgreduce
>
> I hope those last too go without a problem. Will report back.
>

It turned out that new partition, sdc5 is smaller then sdd7, so pvmove 
failed.

But then I checked the LVM GUI and solved the problem. I opened Physical 
volumes, chose sdd7 and clicked on "Migrate Extents....." which offered 
to redistribute all of the Extents automatically to the rest of the PV's.

At the moment I am waiting for migration to complete, but then removal 
of PV should be simple. I think I will use wonderful LVM GUI again, and 
I will not allow anyone to tell me how DE/GUI on a server is bad thing. ;)


-- 
Ljubomir Ljubojevic
(Love is in the Air)
PL Computers
Serbia, Europe

StarOS, Mikrotik and CentOS/RHEL/Linux consultant
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux