Filip Chabik

DevOps Engineer, Husband & Dad.

Extend LV & FS on-line with one command

1st October 2011

Today my GNOME 3 told me, that my root partition is filling in pretty quickly and there’s not much space left. I looked into it and figured that 1 GB of additional space will suffice for some time. Since version 2.02.86 of lvm2 package, there’s a new flag for lvextend command: -r (--resizefs):

Resize underlying filesystem together with the logical volume using fsadm(8).

Neat. I decided to give it a try:

sudo lvextend -L +1G -r /dev/mapper/duckbill-root

  Extending logical volume root to 14,90 GiB
  Logical volume root successfully resized
resize2fs 1.42-WIP (25-Sep-2011)
System plików /dev/mapper/duckbill-root jest zamontowany pod /; wymagana zmiana rozmiaru w locie
old_desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/mapper/duckbill-root to 3906560 (4k) blocks.
The filesystem on /dev/mapper/duckbill-root is now 3906560 blocks long.

System Administration