Tag Archives: lv

Extending logical volume size on Ubuntu

One of the servers iscomplaining about a mount point being 90% full, and this must to be resolved.

The server is running Ubuntu, and it is using lvm.

First, check the mount points.

$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg00-lvvar
                      4.0G  3.6G  0.3G  91% /var

The logical volume resides in vg00.  Is there any space unallocated in the volume group?

$ sudo vgdisplay
  --- Volume group ---
  VG Name               vg00
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  10
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                6
  Open LV               6
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               27.75 GB
  PE Size               4.00 MB
  Total PE              7104
  Alloc PE / Size       5861 / 22.89 GB
  Free  PE / Size       1243 / 4.86 GB
  VG UUID               --------

Yes there is. Let’s extend the volume.

$ sudo lvextend -L +1G /dev/vg00/lvvar

Finally, extend the filesystem.

$ sudo resize2fs /dev/vg00/lvvar

Done.