CentOS 7 xfs文件系统下实现LVM减容

爷,独闯天下 提交于 2020-05-06 08:25:23

一、xfs文件系统不支持减容操作,官方说法 :https://xfs.org/index.php/XFS_FAQ#Q:_Is_there_a_way_to_make_a_XFS_filesystem_larger_or_smaller.3F

Q: Is there a way to make a XFS filesystem larger or smaller?

You can NOT make a XFS partition smaller online. The only way to shrink is to do a complete dump, mkfs and restore.

 

二、新装系统自动分区方式,需求缩减/home分区容量。

1、系统环境

系统版本: CentOS Linux release 7.6.1810 (Core)

内核版本: 3.10.0-957.1.3.el7.x86_64

容量:11T  /home xfs文件系统分区

 

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

yum -y install xfsdump

xfsdump  -f  /home.xfsdump  /home

...

->home

...

->home

...

xfsrestore: Restore Status: SUCCESS

 

3、减容操作

umount  /home

lvreduce  -L  2048G  /dev/cl/home

 

4、格式化

 

5、恢复/home分区数据

 

6、查看减容效果

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!