I wanted to increase the disk size of 2 VMs from 20GB to 100GB.

I followed the normal procedure, increased vmdk size, fdisk to create a new partition with the free space (sda3), vgextend, then lvextend to increase my root lv to 100% of the free space, and finally resize2fs for lv_root.

Now, I have 2 exactly same machines, but at the end I get different results concerning the lv_root size. Please see the screenshot below.

enter image description here

Can anyone please explain to me what's happening?

edit: Sorry for the screenshot, but because there is too much text output I found it more clear to have it like this.

My vgs output on the second machine

[root@ddsl-e012 ~]# vgs
VG          #PV #LV #SN Attr   VSize  VFree 
vg_ddsle012   2   2   0 wz--n- 99.47g 18.50g

On the first it shows no free space. I followed both times the same procedure. Why in the second time when I did a vgextend (vgextend vg_ddsle012 /dev/sda3) didn't allocate the whole space and how can I fix it now?

  • 1
    (1) Please post text for text, not images. Images are hard to read, not searchable, and not copy&pasteable. (2) As you are dealing with LVM, not partitions, output from fdisk (a partitioning tool) is not very important. Output from vgs and lvs etc... is what you will want to include here.
    – Celada
    Jul 23 '15 at 12:11
  • Seems you've answered your own question: one of the VGs has free space in it and the other one does not. You haven't shown information about the LVs, but my guess is that one of the LVs is correspondingly smaller than the other one... and the solution is to make it bigger, which you are able to do because there is some free space in the VG.
    – Celada
    Jul 23 '15 at 12:41
  • By the way, regarding "On the first it shows no free space", as a matter of best practices it's a good idea to always leave a small amount of breathing room free in a VG, for example in case you want to make snapshots.
    – Celada
    Jul 23 '15 at 12:42
  • 1
    FYI, I'm not going to bother to read the screenshot. If you ever want an answer from me, post text. Jul 23 '15 at 22:53

Ok, it seems that during my lvextend on the second machine I had forgotten the "+" sign. So, instead of

lvextend -l +100%FREE /dev/mapper/vg_ddsle012-lv_root

I've written

lvextend -l 100%FREE /dev/mapper/vg_ddsle012-lv_root

so the space wasn't added to the actual size of the logical volume.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.