System and processes

The lvextend command

Extends a logical volume without unmounting it or losing data.

Syntax

sudo lvextend -L +<tamaño> /dev/<grupo>/<lv>

Most useful options

-LHow much to grow (+2G)

Copy-ready examples

$ sudo pvcreate /dev/sdbPV
$ sudo vgcreate datos /dev/sdbVG
$ sudo lvcreate -L 2G -n web datosLV
$ sudo lvextend -L +2G /dev/datos/webExtend

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • After extending the LV you must grow the filesystem (resize2fs).

Related commands

FAQ

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course