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

Mon Oct 27 23:23:11 UTC 2014
SilverTip257 <silvertip257 at gmail.com>

On Mon, Oct 27, 2014 at 3:56 PM, reynierpm at gmail.com <reynierpm at gmail.com>
wrote:

> I'm trying to extend a logical volume and I'm doing as follow:


> 1- Run `fdisk -l` command and this is the output:
>

This is for actual partitions, not LVM which seems to be what you want per
the rest of your message.


>
> 2- Run `fdisk /dev/sda`and print partition using `p`:
>
>


>         Partition number (1-4): 3
>         No free sectors available
>

It's telling you the truth.
Sounds like you want another Logical Volume (LV) not partition.


>
> I also check the free available space using vgdisplay and watching the Free
> PE / Size part near the end and seems like I've free space available (Free
> PE / Size 7670 / 29.96 GiB) so I tried to extend the LV by using the
> command:lvextend -L+29G /dev/vg_devserver/lv_root but I got some errors and
>

Unless you know what you're doing, you _really_ shouldn't do this in
anything but a VM where you won't lose your data.
First rule of LVM resizing is to adjust the size (grow or shrink depending
on your goal) of the file system before resizing the LV "container".

Remember there are a few "layers" here you have to keep in mind.
disk --> partition --> LVM Phys Volume --> LVM Vol Group --> LVM Logical
Vol --> File System (ext4, xfs, etc)

If there are free extents in the VG, then you can probably create a LV.
Depends on the extent size (defaults can vary between releases and/or an
admin's configuration).


> don't know where to go from here. The first error I see at console is
> this /dev/root:
> read failed after 0 of 4096 at 27522957312: Input/output error /dev/root:
> read failed after 0 of 4096 at 27523014656: Input/output error Couldn't
> find device with uuid vSbuSJ-o1Kh-N3ur-JYkM-Ktr4-WEO2-JWe2wS. Cannot change
> VG vg_devserver while PVs are missing. Consider vgreduce --removemissing.
>
> Then following the suggestion from the previous command results I run this
> other command vgreduce --removemissing vg_devserver but again got this
> error: WARNING: Partial LV lv_root needs to be repaired or removed. There
> are still partial LVs in VG vg_devserver. To remove them unconditionally
> use: vgreduce --removemissing --force. Proceeding to remove empty missing
> PVs. so I change the command to the one suggested but once again another
> message Removing partial LV lv_root. Logical volume vg_devserver/lv_root
> contains a filesystem in use. so at this point I don't know what else to
> do,can any give me some ideas or help?
>

Sounds like you destroyed one or more of your LVs through all this.


Please read the following documentation before forging further ahead.
And you might spin up a VM or live CD to experiment with LVM operations
before going any further as well.
- speaks about extents [0]
- read the entire Chapter 2 on LVM [1] as it applies to your scenario (ex:
snapshots probably don't)
 - dated/older, but it may prove helpful [2]

[0]
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/lv_overview.html
[1]
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/LVM_components.html
[2] http://www.tldp.org/HOWTO/html_single/LVM-HOWTO/

-- 
---~~.~~---
Mike
//  SilverTip257  //