wiki:Linux/ExtendLvmExt3FileSystem

Extend an LVM Ext3 File-System

Check the Volume Groups and Free Space

What devices are present?

ls /dev/mapper

control  sda4encrypted  VGencrypted-home  VGencrypted-root  VGencrypted-var

What free-space is available?

df | grep /var

Filesystem                  1K-blocks      Used       Available Use% Mounted on
/dev/mapper/VGencrypted-var 4843912        3748968    850824    82%  /var

How much free space does the Logical Volume group have?

sudo vgdisplay VGencrypted

  --- Volume group ---
  VG Name               VGencrypted
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               154.84 GB
  PE Size               4.00 MB
  Total PE              39638
  Alloc PE / Size       30920 / 120.78 GB
  Free  PE / Size       8718 / 34.05 GB
  VG UUID               d6BfCn-sZ7y-xgyc-l96U-JHpy-se0H-87BzyC

Free is 34GB

What is the Logical Volume using?

sudo lvdisplay /dev/VGencrypted/var

  --- Logical volume ---
  LV Name                /dev/VGencrypted/var
  VG Name                VGencrypted
  LV UUID                3ul3lH-fPts-KjpI-kEkB-MyZr-UhLb-LY5NMg
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.66 GB
  Current LE             1192
  Segments               1
  Allocation             inherit
  Read ahead sectors     0
  Block device           254:2

Extend the Required Volume Group

Add 10 Gigabytes to /var:

sudo lvextend -L +10G /dev/VGencrypted/var /dev/mapper/sda4encrypted 

  Extending logical volume var to 14.66 GB
  Logical volume var successfully resized

Extend the Ext3 File-System

sudo resize2fs /dev/mapper/VGencrypted-var

resize2fs 1.40.8 (13-Mar-2008)
Filesystem at /dev/mapper/VGencrypted-var is mounted on /var; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/VGencrypted-var to 3842048 (4k) blocks.
The filesystem on /dev/mapper/VGencrypted-var is now 3842048 blocks long.

Check Free Space

df | grep /var

Filesystem                  1K-blocks      Used       Available Use% Mounted on
/dev/mapper/VGencrypted-var 15248696       3751368    10733964  26%  /var