Logical Volume Manager 2 (LVM2) allows you to aggregate physical storage devices into volume groups. You can then divide that aggregated space into one or more logical volumes. Once created, logical volumes can be extended to utilize unused space within the volume group, allowing the file system residing on the logical volume to be extended as well.

The lvextend command is used to extend the logical volume. Before we use lvextend there are few steps that need to be followed. The following are sample steps to extend a Volume Group (VG), a Logical Volume (LV), and a filesystem using a device named /dev/sdN as its Physical Volume (PV).

1. Create a PV from a free disk or partition (e.g. /dev/sdN1 as a partition):

You can also use a complete disk to create a physical volume with pvcreate.

2. Extend the VG (/dev/sdN1 is an existing PV path):

# vgextend vgdata /dev/sdN1

Extend the LV and resize the underlying filesystem together (/dev/vgdata/lvdata is the existing LV path), which will be extended by 125 GB:

# lvextend -r -L +125G /dev/vgdata/lvdata

Examples of lvextend command

1. To resize a logical volume (in units of logical extents)

# lvresize -l [+|-]LogicalExtentsNumber[%{VG|LV|PVS|FREE|ORIGIN}]
# lvresize --extents [+|-]LogicalExtentsNumber[%{VG|LV|PVS|FREE|ORIGIN}]

2. To do not perform fsck before resizing filesystem when filesystem requires it:

# lvresize -n
# lvresize --nofsck

3. To disable udev synchronization:

4. To resize underlying filesystem together with the logical volume using fsadm:

# lvresize -r
# lvresize --resizefs

5. To change or set the logical volume size in units of megabytes:

# lvresize -L [+|-]LogicalVolumeSize[bBsSkKmMgGtTpPeE]
# lvresize --size [+|-]LogicalVolumeSize[bBsSkKmMgGtTpPeE]

6. To gives the number of stripes to use when extending a Logical Volume:

# lvresize -i stripes
# lvresize --stripes stripes

7. To gives the number of kilobytes for the granularity of the stripes

# lvresize -I StripeSize
# lvresize --stripesize StripeSize