System and processes
The lvreduce command
Shrinks a logical volume. Careful: it can cut data if the filesystem is not adjusted.
Syntax
sudo lvreduce -L -<tamaño> /dev/<grupo>/<lv>Most useful options
-LHow much to shrink (-1G)Copy-ready examples
$ sudo pvcreate /dev/sdbPV$ sudo vgcreate datos /dev/sdbVG$ sudo lvcreate -L 4G -n web datosLV$ sudo lvreduce -L -1G /dev/datos/webShrinkYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- Shrink the filesystem first, not the LV, or you will lose data.
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