您好,登錄后才能下訂單哦!
搞了個centos7.5安裝12.2rac,安裝數(shù)據(jù)庫軟件時空間不夠,所以打算擴(kuò)一下lvm。
操作系統(tǒng)版本:
[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
擴(kuò)展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.
此時卷組還沒擴(kuò)展,需要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開始默認(rèn)文件系統(tǒng)放棄了第四代ext4的文件系統(tǒng),轉(zhuǎn)向了xfs日志文件系統(tǒng)。該系統(tǒng)性能比ext4增強(qiáng)很多,擴(kuò)展性也更強(qiáng),能夠得到近似裸設(shè)備的IO性能。該文件系統(tǒng)下的lvm拉伸命令也有了變化,需要xfs_growfs實(shí)現(xiàn)之前的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
完成!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。