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


一、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、查看减容效果

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM