centos7 换成xfs文件格式了。由于运行xmr门罗币钱包程序,导致/root空间不够了。必须对空间进行调整,悲剧的是xfs只能增加空间,不能缩减空间,必须曲线救国了。

查看一下,缺省有两个lvm的分区

/dev/mapper/centos-root 40G
/dev/mapper/centos-home 20G

先备份home分区,并缩小到2G

# yum -y install xfsdump
# xfsdump -f /home.xfsdump /home
please enter label for this dump session (timeout in 300 sec)  
-> home
please enter label for media in drive 0 (timeout in 300 sec)  
-> home
# umount /home
# lvreduce -L 2G /dev/mapper/centos-home
Do you really want to reduce home? [y/n]: y  

扩充root分区

# lvextend -L +18G /dev/mapper/centos-root
# xfs_growfs /dev/mapper/centos-root

最后恢复home分区

# mkfs.xfs -f /dev/mapper/centos-home
# mount /home
# xfsrestore -f /home.xfsdump /home

搞定

comments powered by Disqus