'lvextend -l 100%FREE' resizing to the number of free extents rather than adding them to the current size in RHEL

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 4, 5, 6, 7, 8, 9

Issue

  • I believe it to be the case that:

    # lvextend -l 100%FREE /dev/VolGroup00/lv_root
    
  • Error

  New size given (XXX extents) not larger than existing size (XXX extents)

...will extend the logical volume lvroot to be its current size plus the current free space in the volume group.  That is not what it is attempting to do however.

  • When resizing a logical volume with the following command, it is try to resize it to the number of free extents, rather than the current size plus the number of free extents

    # lvextend -l 100%FREE <logvol path>
    

Resolution

Use the + symbol in front of X%FREE to indicate the space should be added to the current size.

# lvextend -l +100%FREE /dev/volgroup/logvol

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments