码迷,mamicode.com
首页 > 其他好文 > 详细

揪出占用磁盘空间的罪魁祸首-企业生产实战

时间:2016-06-01 21:33:04      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:揪出占用磁盘空间的罪魁祸首

磁盘空间已满,但是找不到占用空间的文件,整个故障排除过程如下:

[root@localhost opt]# df -h

Filesystem      Size  Used Avail Use% Mounted on

/dev/sda5       9.5G  6.1G  3.0G  68% /

tmpfs            24G  228K   24G   1% /dev/shm

/dev/sda1       190M   34M  146M  19% /boot

/dev/sda8        24G   44M   23G   1% /data

/dev/sda2       212G   50G  152G  25% /home

/dev/sda6       9.5G  8.2G  901M  91% /opt

/dev/sda7       9.5G  293M  8.8G   4% /var

[root@localhost opt]# du -sh /opt/*

556M    /opt/buildirm

16K     /opt/lost+found

4.0K    /opt/rh

[root@localhost opt]# df -i /opt

Filesystem     Inodes  IUsed  IFree IUse% Mounted on

/dev/sda6      640848 184516 456332   29% /opt

[root@localhost opt]# ls -al 

总用量 40

drwxrwxrwx.  6 root root  4096 12月 16 09:46 .

dr-xr-xr-x. 29 root root  4096 4月  28 09:44 ..

drwxrwxrwx.  4 root root  4096 9月  16 2015 buildirm

-rw-------.  1 root root    39 12月 16 09:46 .directory

drwx------.  2 root root 16384 5月   8 2015 lost+found

drwxr-xr-x.  2 root root  4096 5月  17 2013 rh

drwx------.  4 root root  4096 9月  17 2015 .Trash-0

[root@localhost opt]# du --max-depth=1 -lh /opt

16K     /opt/lost+found

4.0K    /opt/rh

7.6G    /opt/.Trash-0  //终于找出占用磁盘空间的罪魁祸首了!

556M    /opt/buildirm

8.1G    /opt

 [root@localhost opt]# du --max-depth=1 -lh --all /opt
16K     /opt/lost+found
4.0K    /opt/rh
7.6G    /opt/.Trash-0
556M    /opt/buildirm
4.0K    /opt/.directory
8.1G    /opt 


本文出自 “兰州linux运维” 博客,请务必保留此出处http://linuxzkq.blog.51cto.com/9379412/1785246

揪出占用磁盘空间的罪魁祸首-企业生产实战

标签:揪出占用磁盘空间的罪魁祸首

原文地址:http://linuxzkq.blog.51cto.com/9379412/1785246

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!