I want to add this 32GB free space to my "/": My LVM info and HDD information are:
Code: Select all
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 280G 0 disk
├─sda1 8:1 0 200M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
├─sda3 8:3 0 38.8G 0 part
│ ├─centos-root 253:0 0 246.8G 0 lvm /
│ └─centos-swap 253:1 0 2G 0 lvm [SWAP]
├─sda4 8:4 0 160G 0 part
│ └─centos-root 253:0 0 246.8G 0 lvm /
└─sda5 8:5 0 50G 0 part
└─centos-root 253:0 0 246.8G 0 lvm /
sr0 11:0 1 1024M 0 rom
loop0 7:0 0 4G 0 loop /var/tmp
#
# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.9G 0 2.9G 0% /dev
tmpfs 2.9G 0 2.9G 0% /dev/shm
tmpfs 2.9G 20M 2.9G 1% /run
tmpfs 2.9G 0 2.9G 0% /sys/fs/cgroup
/dev/mapper/centos-root 243G 179G 54G 77% /
/dev/sda2 976M 284M 626M 32% /boot
/dev/sda1 200M 12M 189M 6% /boot/efi
/dev/loop0 3.9G 8.3M 3.7G 1% /tmp
tmpfs 579M 0 579M 0% /run/user/0
Code: Select all
# vgs
VG #PV #LV #SN Attr VSize VFree
centos 3 2 0 wz--n- 248.79g 0
#
# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 246.79g
swap centos -wi-ao---- 2.00g
#
# pvs
PV VG Fmt Attr PSize PFree
/dev/sda3 centos lvm2 a-- 38.80g 0
/dev/sda4 centos lvm2 a-- <160.00g 0
/dev/sda5 centos lvm2 a-- <50.00g 0
#
# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 3
Act PV 3
VG Size 248.79 GiB
PE Size 4.00 MiB
Total PE 63691
Alloc PE / Size 63691 / 248.79 GiB
Free PE / Size 0 / 0
VG UUID fr47JL-Wlkw-W1Uk-RjDl-xKTe-NnT2-nQ79IP
#
# lvdisplay -v
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID dFW3or-Tw3V-yLG2-Z9s6-yjVF-EfPt-VCL3tN
LV Write Access read/write
LV Creation host, time X-X-X-X.static.MyHost.name, 2020-09-02 19:43:27 +0430
LV Status available
# open 1
LV Size 246.79 GiB
Current LE 63179
Segments 4
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
--- Logical volume ---
LV Path /dev/centos/swap
LV Name swap
VG Name centos
LV UUID FjaR6s-83n3-0YOm-p6lB-bfX6-S98i-nXZtzB
LV Write Access read/write
LV Creation host, time X-X-X-X.static.MyHost.name, 2020-09-02 19:43:29 +0430
LV Status available
# open 2
LV Size 2.00 GiB
Current LE 512
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
#
# pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name centos
PV Size 38.80 GiB / not usable 2.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 9933
Free PE 0
Allocated PE 9933
PV UUID mmwDs9-e5I6-vzzu-KkUJ-so75-PyBp-1upsYK
--- Physical volume ---
PV Name /dev/sda4
VG Name centos
PV Size 160.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 40959
Free PE 0
Allocated PE 40959
PV UUID XfUuPl-OsxC-NqfL-VnXN-Mrc6-oG3i-g2dfHR
--- Physical volume ---
PV Name /dev/sda5
VG Name centos
PV Size 50.00 GiB / not usable 4.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 12799
Free PE 0
Allocated PE 12799
PV UUID gh4uBI-huyn-fG3R-Y8UQ-wNC4-hEUg-Yexj39
Code: Select all
# lvextend -l +100%FREE /dev/centos/root
# resize2fs /dev/centos/root