CentOS7.6下LVM减容操作

参考来自 https://blog.csdn.net/ycl146/article/details/78906298

系统环境

CentOS Linux release 7.6.1810 (Core)

3.10.0-957.1.3.el7.x86_64

home分区减容之前

正常LVM减容操作失败,提示 resize2fs: Bad magic number insuper-block ......

互联网找答案:https://blog.csdn.net/ycl146/article/details/78906298

根据提示:XFS是centos7 预装的操作系统,XFS只能扩大不能缩小,所以需要利用xfsdump / xfsrestore 工具在必须缩小lvm 的情况下,备份与还原资料。

解决办法:

一、安装xfsdump套件备份/home分区文件

yum -y install xfsdump

xfsdump -f /home.xfsdump /home

...

->home

...

->home

...

xfsrestore: Restore Status: SUCCESS

 二、减容操作

umount /home

lvreduce -L 2048G /dev/cl/home

三、格式化

 四、恢复/home分区数据

 五、查看减容效果

猜你喜欢

转载自www.cnblogs.com/hbgs/p/10441885.html