Solved: lvextend new size given (xx extents) not larger than existing size (xx extents)


Tips and Tricks, Error

The other day while trying to recover my LVM2 volume, I was doing some POC work and while using lvextend I encountered this error "New size given (XXX extents) not larger than existing size (XXX extents)" and it was not allowing me to perform lvextend.

 

The solution is quite straight forward but I will would still give some background on the environment.

 

My Lab Environment

I added a new disk (/dev/sdb) to my Virtual Machine to extend my root lvm partition

[root@server1 ~]# lsscsi
[0:0:0:0]    cd/dvd  VBOX     CD-ROM           1.0   /dev/sr0
[1:0:0:0]    cd/dvd  VBOX     CD-ROM           1.0   /dev/sr1
[2:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sda
[3:0:0:0]    disk    ATA      VBOX HARDDISK    1.0   /dev/sdb

Currently I only have single Physical Volume

[root@server1 ~]# pvs
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda2  rhel lvm2 a--  <14.50g    0

So I created a new physical volume using /dev/sdb

[root@server1 ~]# pvcreate /dev/sdb
  Physical volume "/dev/sdb" successfully created.

Next I extended the existing volume group to also use /dev/sdb PV

[root@server1 ~]# vgextend rhel /dev/sdb
  Volume group "rhel" successfully extended

List the bew volume group properties. So now I have around 8 GB free space available in my Volume group

[root@server1 ~]# vgs
  VG   #PV #LV #SN Attr   VSize  VFree
  rhel   2   2   0 wz--n- 22.49g <8.00g

Currently my root partition size is 14G

[root@server1 ~]# df -h /
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root   14G  6.8G  5.8G  54% /

 

lvextend error: new size given (xx extents) not larger than existing size (xx extents)

So I planned to use lvextend to increase my root lvm partition size. Here I wanted to increase lvm size by 7.5GB as I already had 8 GB available for which I got this error:

[root@server1 ~]# lvextend -L 7.5G /dev/rhel/root
  New size given (1920 extents) not larger than existing size (3472 extents)

Next I tried with a lower size and still the same resule

[root@server1 ~]# lvextend -L 7G /dev/rhel/root
  New size given (1792 extents) not larger than existing size (3472 extents)

Next I used 100%FREE to use all the free extend available in the Volume Group and still same error

[root@server1 ~]# lvextend -l 100%FREE /dev/rhel/root
  New size given (2047 extents) not larger than existing size (3472 extents)

 

Solution:

Finally I realised my silly mistake. My existing partition size itself is 14GB and to extend I must use (+) to define the additional size I wish to add to my existing volume

[root@server1 ~]# lvextend -l +100%FREE /dev/rhel/root
  Size of logical volume rhel/root changed from 13.56 GiB (3472 extents) to <21.56 GiB (5519 extents).

So with +100%FREE the lvextend command was successful

 

I hope this can help others doing the same mistake.

 

References:
How to fix resizing to the number of free extents rather than adding them to the current size in RHEL

Deepak Prasad

Deepak Prasad

He is the founder of GoLinuxCloud and brings over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels in various domains, from development to DevOps, Networking, and Security, ensuring robust and efficient solutions for diverse projects. You can connect with him on his LinkedIn profile.

Can't find what you're searching for? Let us assist you.

Enter your query below, and we'll provide instant results tailored to your needs.

If my articles on GoLinuxCloud has helped you, kindly consider buying me a coffee as a token of appreciation.

Buy GoLinuxCloud a Coffee

For any other feedbacks or questions you can send mail to admin@golinuxcloud.com

Thank You for your support!!

11 thoughts on “Solved: lvextend new size given (xx extents) not larger than existing size (xx extents)”

  1. Hey,
    In the first place you should’ve used ‘+’ sign before 7.5G like below.

    [root@server1 ~]# lvextend -L +7.5G /dev/rhel/root

    Reply
  2. (I wrote with errors, in a previous post).
    I had exactly the same problem.
    To resolve, the command was:

    # lvextend -l +100%FREE /dev/mapper-name-vg/lv_name

    Good luck

    Reply
  3. It’s important to mention that, if you rise a disk size, then you should add -r option to lvextend command to resize/update the filesystem as well. So the command could be:

    lvextend -l +100%FREE /dev/rhel/root

    Hope it be useful as this post was for me.

    Regards

    Reply
  4. root@apache:~# lvextend -l +100%FREE  /dev/mapper/apache--vg-root 
      New size (12372 extents) matches existing size (12372 extents)
      Run `lvextend --help' for more information.

    Hello , how to resolve problem please, New size (12372 extents) matches existing size (12372 extents) ??

    Reply

Leave a Comment