We have a CentOS 7 VPS with 20GB of SSD space, we later upgraded it to 160GB but I'm a little confused on how to extend the / partition. We have multiple full backups but I'd rather not reinstalling everything only to extend the disk size.
df -h gives the following result:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg-lv_root 18G 12G 5.3G 68% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 8.5M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda1 477M 193M 255M 44% /boot
tmpfs 799M 0 799M 0% /run/user/0
fdisk -l gives the following result:
Disk /dev/sda: 171.8 GB, 171798691840 bytes, 335544320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009fba7
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 20971519 9972736 8e Linux LVM
/dev/sda3 20971520 41943039 10485760 8e Linux LVM
Thanks in advance.
edit:
pvdisplay output:
--- Physical volume ---
PV Name /dev/sda2
VG Name vg
PV Size 9.51 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 2434
Free PE 0
Allocated PE 2434
PV UUID ZltsYs-V501-Z2uY-28Z5-1ed1-v7VQ-Zh1yAH
--- Physical volume ---
PV Name /dev/sda3
VG Name vg
PV Size 10.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 2559
Free PE 0
Allocated PE 2559
PV UUID 5ugv7f-KZPm-JQkB-g0fk-ZE3c-mD4d-4U2A9j
vgdisplay output:
--- Volume group ---
VG Name vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 2
Act PV 2
VG Size 19.50 GiB
PE Size 4.00 MiB
Total PE 4993
Alloc PE / Size 4993 / 19.50 GiB
Free PE / Size 0 / 0
VG UUID gEjaWG-mvkc-k5FD-dtB0-9fA4-4VCY-k5619J
lvdisplay output:
--- Logical volume ---
LV Path /dev/vg/lv_root
LV Name lv_root
VG Name vg
LV UUID Tvyt4e-11m4-kzsV-dPY9-VIPD-Uefx-UM7Tl6
LV Write Access read/write
LV Creation host, time localhost, 2015-04-13 17:15:48 +0200
LV Status available
# open 1
LV Size 17.42 GiB
Current LE 4459
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
--- Logical volume ---
LV Path /dev/vg/lv_swap
LV Name lv_swap
VG Name vg
LV UUID 1ZT9Xj-3MZx-5gG7-Q7Lg-b3xU-jMVI-mHXDzJ
LV Write Access read/write
LV Creation host, time localhost, 2015-04-13 17:15:50 +0200
LV Status available
# open 2
LV Size 2.09 GiB
Current LE 534
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1