[root@zookeeper home]# df -hT
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root xfs 148G 49G 100G 33% /
devtmpfs devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs tmpfs 3.9G 25M 3.8G 1% /run
tmpfs tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/centos-home xfs 24G 33M 24G 1% /home
/dev/xvda1 xfs 1014M 143M 872M 15% /boot
tmpfs tmpfs 782M 0 782M 0% /run/user/0
[root@zookeeper home]# cd
[root@zookeeper ~]# umount /home
[root@zookeeper ~]# lvremove /dev/mapper/centos-home
Do you really want to remove active logical volume centos/home? [y/n]: y
Logical volume "home" successfully removed
[root@zookeeper ~]# lvextend -L +20G /dev/mapper/centos-root
Size of logical volume centos/root changed from <147.79 GiB (37833 extents) to <167.79 GiB (42953 extents).
Logical volume centos/root successfully resized.
[root@zookeeper ~]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512 agcount=13, agsize=3131648 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=38740992, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal bsize=4096 blocks=6116, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 38740992 to 43983872
[root@zookeeper ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 8
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 178.99 GiB
PE Size 4.00 MiB
Total PE 45822
Alloc PE / Size 44969 / 175.66 GiB
Free PE / Size 853 / 3.33 GiB
VG UUID AHC2Xz-J4yb-6qMG-eh0i-nbWJ-W0xz-KS0vXh
[root@zookeeper ~]# pvdisplay
--- Physical volume ---
PV Name /dev/xvda2
VG Name centos
PV Size <79.00 GiB / not usable 3.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 20223
Free PE 853
Allocated PE 19370
PV UUID 3nEbKR-3XKk-11Ar-I3M3-7Ps9-dPYf-nBE5bU
--- Physical volume ---
PV Name /dev/xvdb1
VG Name centos
PV Size <100.00 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 25599
Free PE 0
Allocated PE 25599
PV UUID 8qOKh6-CJP4-OA8I-DsDd-Knt2-thSS-v06FEu
[root@zookeeper ~]# lvdisplay
--- Logical volume ---
LV Path /dev/centos/root
LV Name root
VG Name centos
LV UUID CFgQol-djDQ-seLm-SRCA-qnKL-Lozr-mbWTlm
LV Write Access read/write
LV Creation host, time localhost, 2018-04-05 19:55:01 +0800
LV Status available
# open 1
LV Size <167.79 GiB
Current LE 42953
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 6d0e2c-YjRZ-vipc-boVg-fgcu-o6Oj-yu1XyP
LV Write Access read/write
LV Creation host, time localhost, 2018-04-05 19:55:01 +0800
LV Status available
# open 2
LV Size <7.88 GiB
Current LE 2016
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
[root@zookeeper ~]# lvcreate -l +100%FREE -n home centos
Logical volume "home" created.
[root@zookeeper ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 168G 49G 120G 29% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 25M 3.8G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/xvda1 1014M 143M 872M 15% /boot
tmpfs 782M 0 782M 0% /run/user/0
[root@zookeeper ~]# mkfs.xfs /dev/mapper/centos-home
meta-data=/dev/mapper/centos-home isize=512 agcount=4, agsize=218368 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0, sparse=0
data = bsize=4096 blocks=873472, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =internal log bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
[root@zookeeper ~]# mount /dev/mapper/centos-home /home/
[root@zookeeper ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 168G 49G 120G 29% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 25M 3.8G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/xvda1 1014M 143M 872M 15% /boot
tmpfs 782M 0 782M 0% /run/user/0
/dev/mapper/centos-home 3.4G 33M 3.3G 1% /home
xfs分区调整lvm大小
最新推荐文章于 2024-06-25 00:10:58 发布