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