Linux 根目录爆满 解决(/dev/mapper/centos-root 100%问题)

0.查看磁盘分区情况

blkid -o list
fdisk -l
cfdisk
lsblk 

 

1.查看分区 

df -h 

 

2.备份home分区文件 

tar cvf /tmp/home.tar/home 

 

3.卸载/home,如果无法卸载,先终止使用/home文件系统的进程     

fuser -km /home/  umount /home 

 

4.删除/home所在的lv 

lvremove/dev/mapper/centos-home 

 

5.扩展/root所在的lv,增加800G 

lvextend -L +800G/dev/mapper/centos-root 

 

6.扩展/root文件系统 

xfs_growfs/dev/mapper/centos-root 

 

7.重新创建home lv 

lvcreate -L 73G -n/dev/mapper/centos-home 

 

8. 创建文件系统 

mkfs.xfs  /dev/mapper/centos-home 

 

9.挂载home 

mount/dev/mapper/centos-home 

 

10.home文件恢复 

tar xvf /tmp/home.tar -C/home/  cd /home/home/  mv * ../

 

 

参考:

https://jingyan.baidu.com/article/7e4409532db33f6ec1e2ef66.html

https://zhuanlan.zhihu.com/p/586839216

https://blog.csdn.net/Cecidit_824/article/details/131245922

https://blog.csdn.net/e_wsq/article/details/79531493

posted on 2023-07-10 17:55  dudumao  阅读(6092)  评论(0编辑  收藏  举报

导航

阿里云