免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3551 | 回复: 7
打印 上一主题 下一主题

/tmp目录有20G 清理不掉怎么办? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-25 21:51 |只看该作者 |倒序浏览
系统centos4.4,安装系统时候我是采用默认的分区的。

用SSH连上也打不开/tmp目录 一打开就卡住。。

重启后还是打不开。。

cd /tmp
ls -l
也是卡住。

80G的硬盘...
/var/tmp/
倒是没有文件。。

我用du -sh /*

到/tmp目录就卡住了。

其他目录的空间是:

[quote][root@HLSERVER ~]# du -sh /*
5.3M    /bin
11M     /boot
152K    /dev
30M     /etc
21G     /home
8.0K    /initrd
120M    /lib
16K     /lost+found
12K     /media
8.0K    /misc
8.0K    /mnt
8.0K    /opt
du: `/proc/4279': No such file or directory
900M    /proc
29M     /root
16M     /sbin
8.0K    /selinux
8.0K    /srv
0       /sys

[root@HLSERVER ~]# du -sh /usr
4.2G    /usr
[root@HLSERVER ~]# du -sh /var
12G     /var
[/quote]


清空/tmp 我试过的办法:


1
[root@HLSERVER usr]# cd /tmp
[root@HLSERVER tmp]# rm -rf *

就卡住了。。过N长时间没反应。

2
[root@HLSERVER /]# rm -rf /tmp*


还是卡住了。。过N长时间没反应。


setup里面的服务一共有:
gpm
mysqld
network
sshd
vsftpd
syslogd


进程

[root@HLSERVER tmp]# ps ax
  PID TTY      STAT   TIME COMMAND
    1 ?        S      0:00 init [3]                                   
    2 ?        S      0:00 [migration/0]
    3 ?        SN     0:00 [ksoftirqd/0]
    4 ?        S      0:00 [migration/1]
    5 ?        SN     0:00 [ksoftirqd/1]
    6 ?        S<     0:00 [events/0]
    7 ?        S<     0:00 [events/1]
    8 ?        S<     0:00 [khelper]
    9 ?        S<     0:00 [kacpid]
   29 ?        S<     0:00 [kblockd/0]
   30 ?        S<     0:00 [kblockd/1]
   48 ?        S      0:00 [pdflush]
   49 ?        S      0:00 [pdflush]
   51 ?        S<     0:00 [aio/0]
   52 ?        S<     0:00 [aio/1]
   31 ?        S      0:00 [khubd]
   50 ?        S      0:00 [kswapd0]
  198 ?        S      0:00 [kseriod]
  312 ?        S<     0:00 [ata/0]
  313 ?        S<     0:00 [ata/1]
  317 ?        S      0:00 [scsi_eh_0]
  318 ?        S      0:00 [scsi_eh_1]
  335 ?        S<     0:00 [kmirrord]
  347 ?        S      0:00 [kjournald]
1423 ?        S<s    0:00 udevd
1904 ?        S<     0:00 [kauditd]
1964 ?        S      0:00 [kjournald]
2633 ?        Ss     0:00 syslogd -m 0
2637 ?        Ss     0:00 klogd -x
2679 ?        Ss     0:00 /usr/sbin/sshd
2697 ?        Ss     0:00 gpm -m /dev/input/mice -t imps2
2708 ?        S      0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/HLSERVER.
2715 ?        S      0:00 /bin/sh ./alsy.sh
2736 ?        S      0:00 /bin/sh ./hlds_run -pingboost 3 -tos +sys_ticrate 3000 +maxplayers 31 +map de_dust2 +servercfgfile 27015.cfg -game
2741 ?        S      0:09 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
2753 ?        S<     4:55 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 3000 +maxplayers 31 +map de_dust2 +servercfgfile 27015.cfg -game cstrike
2764 ?        Ss     0:00 /usr/local/apache2/bin/httpd -k start
2768 ?        S      0:00 /bin/sh ./kz.sh
2770 ?        S      0:00 /bin/sh ./match.sh
2775 ?        S<     1:12 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 500 -game cstrike -insecure -norestart +port 27016 +mapcyclefile kzmap.t
2776 ?        S      0:00 /bin/sh ./hlds_run -pingboost 3 -tos +sys_ticrate 2000 +maxplayers 14 +map de_dust2 +servercfgfile match.cfg -game
2786 tty1     Ss+    0:00 /sbin/mingetty tty1
2791 tty2     Ss+    0:00 /sbin/mingetty tty2
2793 tty3     Ss+    0:00 /sbin/mingetty tty3
2794 tty4     Ss+    0:00 /sbin/mingetty tty4
2796 tty5     Ss+    0:00 /sbin/mingetty tty5
2798 tty6     Ss+    0:00 /sbin/mingetty tty6
3358 ?        S<     0:09 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 2000 +maxplayers 14 +map de_dust2 +servercfgfile match.cfg -game cstrike
3361 ?        S      0:03 /usr/local/apache2/bin/httpd -k start
3365 ?        S      0:01 /usr/local/apache2/bin/httpd -k start
3368 ?        S      0:04 /usr/local/apache2/bin/httpd -k start
3373 ?        S      0:04 /usr/local/apache2/bin/httpd -k start
3391 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3392 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3393 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3394 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3395 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3396 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3397 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3398 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3399 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
3428 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 500 -game cstrike -insecure -norestart +port 27016 +mapcyclefile kzmap.t
3429 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 500 -game cstrike -insecure -norestart +port 27016 +mapcyclefile kzmap.t
3447 ?        Rs     0:00 sshd: root@pts/0
3472 ?        Ds     0:11 /usr/libexec/openssh/sftp-server
3553 pts/0    Ss     0:00 -bash
3597 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 3000 +maxplayers 31 +map de_dust2 +servercfgfile 27015.cfg -game cstrike
3598 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 3000 +maxplayers 31 +map de_dust2 +servercfgfile 27015.cfg -game cstrike
3609 ?        S      0:05 /usr/local/apache2/bin/httpd -k start
3614 ?        S      0:02 /usr/local/apache2/bin/httpd -k start
3615 ?        S      0:05 /usr/local/apache2/bin/httpd -k start
3626 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 500 -game cstrike -insecure -norestart +port 27016 +mapcyclefile kzmap.t
3642 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 2000 +maxplayers 14 +map de_dust2 +servercfgfile match.cfg -game cstrike
3643 ?        S<     0:00 ./hlds_i686 -pingboost 3 -tos +sys_ticrate 2000 +maxplayers 14 +map de_dust2 +servercfgfile match.cfg -game cstrike
3915 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
5554 ?        S      0:01 /usr/local/apache2/bin/httpd -k start
5569 ?        S      0:00 /usr/local/apache2/bin/httpd -k start
5571 ?        S      0:01 /usr/local/apache2/bin/httpd -k start
5647 ?        S      0:00 /usr/local/apache2/bin/httpd -k start
5658 ?        S      0:02 /usr/local/apache2/bin/httpd -k start
5990 ?        S      0:01 /usr/local/apache2/bin/httpd -k start
5994 ?        S      0:01 /usr/local/apache2/bin/httpd -k start
6114 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
6115 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
6199 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
6210 ?        S      0:00 /usr/local/apache2/bin/httpd -k start
6211 ?        S      0:00 /usr/local/apache2/bin/httpd -k start
6218 ?        S      0:00 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=
6278 pts/0    R+     0:00 ps ax
[root@HLSERVER tmp]#

论坛徽章:
0
2 [报告]
发表于 2007-11-25 22:19 |只看该作者
[root@HLSERVER /]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       72G   67G  1.2G  99% /
/dev/hdb1              99M   16M   79M  17% /boot
none                 1010M     0 1010M   0% /dev/shm
[root@HLSERVER /]#

硬盘共有80G

前天看还有5G,,现在就剩1G 了  我怎么办呀。。

论坛徽章:
0
3 [报告]
发表于 2007-11-26 15:10 |只看该作者
[root@HLSERVER ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       72G   67G  733M  99% /
/dev/hdb1              99M   16M   79M  17% /boot
none                 1010M     0 1010M   0% /dev/shm
[root@HLSERVER ~]#
眼下就剩733M了.....怎么办? 我

昨天到现在还是不行啊..

论坛徽章:
0
4 [报告]
发表于 2007-11-26 16:41 |只看该作者
你试试tmpwatch这个命令,另外不要用rm -rf *这样的语法,在文件大多的时候可能会有问题,用find -mtime可能好一些,而且用find不会误删正在使用中的临时文件

论坛徽章:
0
5 [报告]
发表于 2007-11-26 17:31 |只看该作者
tmpwatch -afq --mtime 1 /tmp

论坛徽章:
0
6 [报告]
发表于 2007-11-26 17:39 |只看该作者
应该不是命令的问题,rm -rf * 如果扩展后太长的话是会报错且退出的,并不会卡死在那里

而且有个问题,/tmp 下有 ssh 用的 socket 文件,你 rm -rf * 恐怕不妥吧

论坛徽章:
0
7 [报告]
发表于 2007-11-26 19:35 |只看该作者
好的我在用

tmpwatch -afq --mtime 1 /tmp

不知道行不行
硬盘灯狂亮ing..

论坛徽章:
0
8 [报告]
发表于 2007-11-26 20:11 |只看该作者
文件多自然就慢,假设你/tmp中的文件都没用的情况下。你可以试试
rm -rf /tmp/a*
这样就大概只删除其中1/62的文件了(文件名通常是26x2个字母,10个数字开头)
反复折腾几次,也就差不多了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP