先把所以磁盘卸载掉,然后再去查找系统盘大文件,因为有可能是系统盘里建了一个和磁盘相同的目录然后拷贝了相同的文件导致的(系统盘有个目录、跟磁盘里的文件内容相同)
1、du命令
root@hos132_231:~# sudo du -ah /root | sort -n -r | head -n 20
991M /root/.lotus/datastore/chain/000259.vlog
974M /root/.lotus/datastore/chain/000292.vlog
955M /root/.lotus/datastore/chain/000242.vlog
852K /root/cary/install/tools/mcelog/.git
744M /root/.lotus/datastore/chain/000263.vlog
742M /root/.lotus/datastore/chain/000276.vlog
742M /root/.lotus/datastore/chain/000275.vlog
740M /root/.lotus/datastore/chain/000281.vlog
737M /root/.lotus/datastore/chain/000277.vlog
736M /root/.lotus/datastore/chain/000272.vlog
733M /root/.lotus/datastore/chain/000273.vlog
733M /root/.lotus/datastore/chain/000208.vlog
732M /root/.lotus/datastore/chain/000280.vlog
730M /root/.lotus/datastore/chain/000306.vlog
728M /root/.lotus/datastore/chain/000264.vlog
727M /root/.lotus/datastore/chain/000274.vlog
726M /root/.lotus/datastore/chain/000291.vlog
726M /root/.lotus/datastore/chain/000286.vlog
725M /root/.lotus/datastore/chain/000295.vlog
723M /root/.lotus/datastore/chain/000304.vlog
# 先确定是哪个文件夹占用较多
# 如果文件较多命令执行可能很慢,在知道大概位置的情况下不建议直接对根目录操作
# du的--max-depth=1表示只展示第一个层级的目录和文件
# sort的-h选项和du的-h选项一个意思,-r表示倒叙,默认升序
root@hos132_231:/var/lib# du -h /var/lib --max-depth=1 | sort -hr | head -n 10
84G /var/lib
82G /var/lib/postgresql
1006M /var/lib/docker
262M /var/lib/apt
174M /var/lib/smartmontools
90M /var/lib/dkms
47M /var/lib/dpkg
42M /var/lib/mlocate
2.5M /var/lib/grafana
668K /var/lib/containerd
root@tidb3:~# du -sh /*
15M /bin
90M /boot
0 /dev
5.5M /etc
84K /home
0 /initrd.img
0 /initrd.img.old
623M /lib
4.0K /lib64
16K /lost+found
8.0K /media
4.0K /mnt
223M /nvme0
262M /nvme1
249M /nvme2
7.1G /nvme3
136M /nvme4
20K /nvme5
4.0K /opt
du: cannot access '/proc/5772/task/5772/fd/4': No such file or directory
du: cannot access '/proc/5772/task/5772/fdinfo/4': No such file or directory
du: cannot access '/proc/5772/fd/3': No such file or directory
du: cannot access '/proc/5772/fdinfo/3': No such file or directory
0 /proc
56K /root
1.5M /run
15M /sbin
8.0K /snap
4.0K /srv
2.1G /swapfile
0 /sys
8.0K /tidb-data
30M /tidb-deploy
72K /tmp
1.1G /usr
634M /var
0 /vmlinuz
0 /vmlinuz.old