[CentOS] "No free sectors available" while try to extend logical volumen in a virtual machine running CentOS 6.5

Tue Oct 28 16:15:02 UTC 2014
Robert Nichols <rnicholsNOSPAM at comcast.net>

On 10/28/2014 10:30 AM, reynierpm at gmail.com wrote:
> You're right in some moment I added a new disk and try to extend the VG and
> yes once again I removed by trying to do the same from Gparted Live CD and
> I messed all, this is what I'm trying to fix if it's possible so what
> procedure I should follow having this extra info? (apologies perhaps I
> should say this from the begining)

Yes, that would have helped a lot. I can see in file
/etc/lvm/backup/vg_devserver that the lv_root LV has been extended by a
mere 32 Megabytes (yes, Mega) on the missing physical volume.  Do you
still have the additional disk?  The best thing to do would be to put
it back, make a partition on it, and then re-create the missing PV.
I'll assume that the new partition is /dev/sdb1.  Adjust all references
in the following if it si something else.

Make a copy of /etc/lvm/backup/vg_devserver on vg_devserver.bak, and
then run

    pvcreate -v --restorefile vg_devserver.bak \
             --uuid "vSbuSJ-o1Kh-N3ur-JYkM-Ktr4-WEO2-JWe2wS" \
             /dev/sdb1

(I've broken that up into multiple lines to avoid word wrap problems.)

You should then be able to run pvs and lvs successfully. To properly
remove this PV from the LVM structure, run

    lvreduce --extents -8 /dev/vg_devserver/lv_root
    vgreduce vg_devserver /dev/sdb1
    pvremove /dev/sdb1

That lvreduce will get rid of the 32MB that were allocated on that
added PV.  You will probably get a warning about possible data loss
and will have to confirm.  The vgreduce and pvremove should then
proceed without any issues.

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.