Growing LVM root

You can resize it without rebooting, doing:

lvextend -r -L+100%FREE /dev/vg/lv-root

if you only have 5GB free on the volume group vg

or

lvextend -r -L+5G /dev/vg/lv-root

This commands adds the free space from the volume group vg to the volume lv-root, and extends it; with -r it also extends the underlying filesystem at the same time at run time. (So no need to reboot it from something else)

As for lvresize I think you have an extra space in the command. The command should be:

lvresize -L+5G -r /dev/vg/lv-root

Yes, you can omit the size from your second command. In this case, the fs will be resized to use the whole block device (lv-root).

In general, this can be done with unmounted partitions only. But ext4 (and also some different fs) has a special feature, that it can be grown while it is online. It is the feature of the ext4 filesystem driver. In this case, the resize2fs command will only ask this online grow functionality of the kernel fs driver.

Tags:

Linux

Debian

Lvm