Skip to content

Instantly share code, notes, and snippets.

@rubi022
Created March 6, 2020 04:56
Show Gist options
  • Save rubi022/c63d4b32e521d1d3b0a4125d7a71d7cc to your computer and use it in GitHub Desktop.
Save rubi022/c63d4b32e521d1d3b0a4125d7a71d7cc to your computer and use it in GitHub Desktop.
logical-volume-resize-ubuntu
appliance@zabbix:~$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/zabbix-vg/root
LV Name root
VG Name zabbix-vg
LV Size 15.52 GiB
--- Logical volume ---
LV Path /dev/zabbix-vg/swap_1
LV Name swap_1
VG Name zabbix-vg
LV Size 4.00 GiB
appliance@zabbix:~$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
zabbix-vg 1 2 0 wz--n- 24.52g 5.00g
As you see i have 5 GB Free space
appliance@zabbix:~$ sudo lvextend -L+5G /dev/zabbix-vg/root
Size of logical volume zabbix-vg/root changed from 15.52 GiB (3973 extents) to 20.52 GiB (5253 extents).
Logical volume root successfully resized.
appliance@zabbix:~$ sudo resize2fs /dev/zabbix-vg/root
The filesystem on /dev/zabbix-vg/root is now 5379072 (4k) blocks long.
appliance@zabbix:~$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/zabbix-vg/root
LV Name root
VG Name zabbix-vg
LV Size 20.52 GiB
--- Logical volume ---
LV Path /dev/zabbix-vg/swap_1
LV Name swap_1
VG Name zabbix-vg
LV Size 4.00 GiB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment