Sitemap
Karim Bellioum

Karim Bellioum

Security — DevOps — FullStack

Volume Extension

2 min readSep 1, 2018

Here’s the steps to extend the volumes :

[root@tangier ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 1
Act PV 1
VG Size 931.02 GiB
PE Size 4.00 MiB
Total PE 238341
Alloc PE / Size 238325 / 930.96 GiB
Free PE / Size 16 / 64.00 MiB
VG UUID mG9aJe-MlHN-YTBa-QE1l-xpMz-poYB-RqoqAT
vgextend centos /dev/sdb--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 1.36 TiB
PE Size 4.00 MiB
Total PE 357575
Alloc PE / Size 238325 / 930.96 GiB
Free PE / Size 119250 / 465.82 GiB
VG UUID mG9aJe-MlHN-YTBa-QE1l-xpMz-poYB-RqoqAT

15% root 17887

Get Karim Bellioum’s stories in your inbox

Join Medium for free to get updates from this writer.

85% home 101363

lvextend -l +17887 /dev/centos/root
lvextend -l +101363 /dev/centos/home

These commands didn’t work for this plateforme

resize2fs /dev/centos/root
resize2fs /dev/centos/home

We had got this error :

resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/centos/root
Couldn't find valid filesystem superblock.

The solution was :

using the command xfsgrowfs instead of resize2fs

[root@tangier ~]# xfs_growfs /dev/centos/root
meta-data=/dev/mapper/centos-root isize=256 agcount=4, agsize=3276800 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=0 finobt=0 spinodes=0
data = bsize=4096 blocks=13107200, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=6400, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 13107200 to 31423488
[root@tangier ~]# xfs_growfs /dev/centos/home
meta-data=/dev/mapper/centos-home isize=256 agcount=4, agsize=57480448 blks
= sectsz=4096 attr=2, projid32bit=1
= crc=0 finobt=0 spinodes=0
data = bsize=4096 blocks=229921792, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=112266, version=2
= sectsz=4096 sunit=1 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 229921792 to 333717504

vgdisplay:

[root@tangier ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 7
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 3
Open LV 3
Max PV 0
Cur PV 2
Act PV 2
VG Size 1.36 TiB
PE Size 4.00 MiB
Total PE 357575
Alloc PE / Size 357575 / 1.36 TiB
Free PE / Size 0 / 0
VG UUID mG9aJe-MlHN-YTBa-QE1l-xpMz-poYB-RqoqAT

--

--

Karim Bellioum
Karim Bellioum

Written by Karim Bellioum

Security — DevOps — FullStack