Centos7将/dev/mapper/centos-home磁盘空间转移到/dev/mapper/centos-root

lvextend命令
-L:指定逻辑卷的大小,单位为“kKmMgGtT”字节;
-l:指定逻辑卷的大小(LE数)

 

[root@localhost ~]# df -h
文件系统 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root 50G 1.3G 49G 3% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 9.0M 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/sda1 1014M 148M 867M 15% /boot
/dev/mapper/centos-home 46G 33M 46G 1% /home
tmpfs 379M 0 379M 0% /run/user/0


[root@localhost ~]# umount /home


[root@localhost ~]# 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@localhost ~]# lvextend -L +50G /dev/mapper/centos-root
Insufficient free space: 12800 extents needed, but only 11551 available


[root@localhost ~]# lvextend -l +11551 /dev/mapper/centos-root
Size of logical volume centos/root changed from 61.28 GiB (15688 extents) to 95.12 GiB (24351 extents).
Logical volume centos/root successfully resized.


[root@localhost ~]# xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=512 agcount=4, agsize=3276800 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 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=1
log =internal bsize=4096 blocks=6400, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0

————————————————

原文链接:https://blog.csdn.net/iteye_18762/article/details/116712640

posted @ 2022-02-23 18:06  walkersss  阅读(922)  评论(0编辑  收藏  举报