您好,登錄后才能下訂單哦!
搞了個centos7.5安裝12.2rac,安裝數據庫軟件時空間不夠,所以打算擴一下lvm。
操作系統版本:
[root@mdb1 ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.5.1804 (Core)
Release: 7.5.1804
Codename: Core
sdb盤初始化為物理卷
[root@mdb1 ~]#
pvcreate /dev/sdb
Physical volume "/dev/sdb" successfully created.
將要添加的物理卷加入到vg卷組中
[root@mdb1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 1 0 wz--n- 21.53g 0
[root@mdb1 ~]#
vgextend centos /dev/sdb
Volume group "centos" successfully extended
[root@mdb1 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 2 1 0 wz--n- <29.53g <8.00g
擴展lvm
[root@mdb1 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root centos -wi-ao---- 21.53g
[root@mdb1 ~]#
lvextend -l +100%FREE /dev/mapper/centos-root
Size of logical volume centos/root changed from 21.53 GiB (5512 extents) to <29.53 GiB (7559 extents).
Logical volume centos/root successfully resized.
此時卷組還沒擴展,需要resize一下
[root@mdb1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 22G 14G 7.6G 65% /
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 0 1.4G 0% /dev/shm
tmpfs 1.4G 9.6M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/sda1 473M 134M 339M 29% /boot
tmpfs 279M 0 279M 0% /run/user/0
tmpfs 279M 0 279M 0% /run/user/1001
[root@mdb1 ~]#
resize2fs /dev/mapper/centos-root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/centos-root
Couldn't find valid filesystem superblock.
linux從7開始默認文件系統放棄了第四代ext4的文件系統,轉向了xfs日志文件系統。該系統性能比ext4增強很多,擴展性也更強,能夠得到近似裸設備的IO性能。該文件系統下的lvm拉伸命令也有了變化,需要xfs_growfs實現之前的resize2fs命令的功能。
[root@mdb1 ~]#
xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=1411072 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=5644288, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=2756, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 5644288 to 7740416
[root@mdb1 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 30G 14G 16G 48% /
devtmpfs 1.4G 0 1.4G 0% /dev
tmpfs 1.4G 644M 747M 47% /dev/shm
tmpfs 1.4G 9.6M 1.4G 1% /run
tmpfs 1.4G 0 1.4G 0% /sys/fs/cgroup
/dev/sda1 473M 134M 339M 29% /boot
tmpfs 279M 0 279M 0% /run/user/0
完成!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。