因为filehome 上小文件过多,所以du –sh * 过滤掉 filehome

du -sh /* --exclude="filehome"

1.1G    /backup

7.8M    /bin

6.8M    /boot

#!/bin/bash
function ergodic(){
for file in `ls $`
do
if [ -d $"/"$file ]
then
ergodic $"/"$file
else
local path=$"/"$file
local name=$file
local size=`du --max-depth= $path|awk '{print $1}'`
echo $name $size $path
echo $size $name $path >> /tmp/file.txt
fi
done
} IFS=$'\n' #done
INIT_PATH=".";
ergodic $INIT_PATH sort -n /tmp/file.txt ####### 文件系统满的话,该如何处理。 .使用以上shell(file.sh)处理
.检查文件总大小是否小于df -k 的占用量,也就说明 进程没来得及释放日志文件,导致日志文件虽然被删除,但是进程仍然hold 空间
  详细请见:(http://www.cnblogs.com/feiyun8616/p/6132670.html)
看到/tmp oracle:dba 目录/tmp/rda 消耗较高,总和小于df -k显示的占用量,看到有oracle 进程占用/tmp.怀疑是清理了空间后进程未释放空间,需要进一步确认
 
方法如下:  

step1: From time to time the du command doesn’t match up with df. This is due to deleted but ‘still open’ file usage

lsof | awk '/deleted/ {sum+=$7} END {print sum}'

step 2:  (check $2 is pid, manaul to kill the process)

lsof | grep deleted

(COMMAND     PID      USER   FD      TYPE             DEVICE   SIZE/OFF       NODE NAME)


for ksh

#for ksh
#!/bin/bash
function ergodic {
for file in `ls $`
do
if [ -d $"/"$file ]
then
# echo $file
ergodic $"/"$file
else
# echo $
# echo $file
local path=$"/"$file
local name=$file
local size=`du -sk $path|awk '{print $1}'`
# echo $name $size $path
echo $size $name $path >> /tmp/file.txt
fi
done
} #IFS=$'\n' #done
INIT_PATH="/11_restore";
#echo $INIT_PATH
ergodic $INIT_PATH sort -n /tmp/file.txt

3.监控脚本本身异常 导致系统 误报。

大量未删除的文件 导致 脚本无法连接数据库,写入日志,出现如下提示。

[root@yidbmon1 ~]# /usr/sbin/lsof |grep home

bash       6623    oracle  cwd       DIR              253,8      12288     131223 /home/oracle/utility/macro

tnslsnr    6940    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

bash       9990    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

bash       9990    oracle  254r      REG              253,8       3493     143496 /home/oracle/11/osw_sort_11pr.sh

bash       9992    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

tee        9993    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

sh        11637    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

sh        11637    oracle    1w      REG              253,8 1994113024     147308 /home/oracle/11/nohup.out (deleted)

sh        11637    oracle    2w      REG              253,8 1994113024     147308 /home/oracle/11/nohup.out (deleted)

sh        11637    oracle  255r      REG              253,8       3493     143496 /home/oracle/11/osw_sort_11pr.sh

sh        11639    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

sh        11639    oracle    2w      REG              253,8 1994113024     147308 /home/oracle/11/nohup.out (deleted)

tee       11640    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

tee       11640    oracle    1w      REG              253,8 1994113024     147308 /home/oracle/11/nohup.out (deleted)

tee       11640    oracle    2w      REG              253,8 1994113024     147308 /home/oracle/11/nohup.out (deleted)

bash      20767    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

bash      20767    oracle  254r      REG              253,8       2648     143598 /home/oracle/11/osw_sort_edrprod.sh

bash      20769    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

tee       20770    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

bash      21678    oracle  cwd       DIR              253,8       4096          2 /home

se.sh     23010    oracle  cwd       DIR              253,8       4096     142968 /home/oracle/monitor/ngtools/se

se.sh     23010    oracle   11r      REG              253,8       2635     139902 /home/oracle/monitor/ngtools/se/se.sh

se.sh     23010    oracle   12r      DIR              253,8       4096     142968 /home/oracle/monitor/ngtools/se

sh        26763    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26839    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26855    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26871    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26887    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26903    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26919    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26935    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26951    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26967    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        26983    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29049    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29065    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29081    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29097    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29113    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29129    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29145    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29161    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29177    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29193    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sh        29209    oracle  cwd       DIR              253,8       4096     131073 /home/oracle

sleep     29934    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

sleep     29934    oracle    2w      REG              253,8 1994113024     147308 /home/oracle/11/nohup.out (deleted)

sleep     29957    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

sleep     29988    oracle  cwd       DIR              253,8       4096     131099 /home/oracle/11

文件系统满的话(filesystem full),该如何处理。的更多相关文章

  1. 文件系统满的话(filesystem full),该如何处理。(du and ls)

    #!/bin/bash function ergodic(){ ` do "/"$file ] then ergodic $"/"$file else loca ...

  2. db2 load报文件系统满

    使用db2 load导入数据 数据量比较大时常常会报文件系统已满错误. 原因分析:导入表建有索引,在load的“索引复制”阶段会从系统临时表空间拷贝到目标表空间,导致系统临时表空间所在的文件系统满,l ...

  3. Hadoop HDFS文件系统通过java FileSystem 实现上传下载等

    package linlintest; import java.io.File; import java.io.FileOutputStream; import java.io.IOException ...

  4. Linux:文件系统层次结构标准(Filesystem Hierarchy Standard)

    Linux FHS_2.3标准文档:http://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.pdf

  5. FUSE 用户空间文件系统 (Filesystem in Userspace)

    FUSE 仓库 Wiki FUSE 性能评测 关于Fuse文件系统: FUSE (Filesystem in Userspace) is an interface for userspace prog ...

  6. Hadoop源码分析之FileSystem抽象文件系统

    Hadopo提供了一个抽象的文件系统模型FileSystem,HDFS是其中的一个实现. FileSystem是Hadoop中所有文件系统的抽象父类,它定义了文件系统所具有的基本特征和基本操作. Fi ...

  7. PHP Filesystem 函数(文件系统函数)(每日一课的内容可以从php参考手册上面来)

    PHP Filesystem 函数(文件系统函数)(每日一课的内容可以从php参考手册上面来) 一.总结 1.文件路径中的正反斜杠:当在 Unix 平台上规定路径时,正斜杠 (/) 用作目录分隔符.而 ...

  8. linux概念之分区与文件系统

    分区类型 [root@-shiyan dev]# fdisk /dev/sda WARNING: DOS-compatible mode is deprecated. It's strongly re ...

  9. (转)认识 Linux 文件系统

    7.1 认识 Linux 文件系统 原文:https://wizardforcel.gitbooks.io/vbird-linux-basic-4e/content/59.html Linux 最传统 ...

随机推荐

  1. magento里获取用户姓名

    Mage::getSingleton('customer/session')->getCustomer()->getFirstname():

  2. 阮一峰:jQuery的几篇文章

    jQuery的设计思想:http://www.ruanyifeng.com/blog/2011/07/jquery_fundamentals.html jQuery的最佳实践:http://www.r ...

  3. PAT 团体程序设计天梯赛-练习集 L1-008. 求整数段和

    给定两个整数A和B,输出从A到B的所有整数以及这些数的和. 输入格式: 输入在一行中给出2个整数A和B,其中-100<=A<=B<=100,其间以空格分隔. 输出格式: 首先顺序输出 ...

  4. hdu_5862_Counting Intersections(扫描线)

    题目链接:hdu_5862_Counting Intersections 题意: 给你与坐标轴平行的线段,问你交点数 题解: 实质就是扫描线,这里我用树状数组来记录,所有线段按X坐标排序,遇到横线段的 ...

  5. Binary Trees

    1. Definiation What is Binary Trees? Collection of node (n>=0) and in which no node can have more ...

  6. Docker私有仓库3

    http://www.cnblogs.com/womars/p/5906435.html(上篇地址) 三.测试上两篇 #测试一下 [root@lh- data]# pwd /opt/data [roo ...

  7. MongoDB执行计划分析详解

    要保证数据库处于高效.稳定的状态,除了良好的硬件基础.高效高可用的数据库架构.贴合业务的数据模型之外,高效的查询语句也是不可少的.那么,如何查看并判断我们的执行计划呢?我们今天就来谈论下MongoDB ...

  8. EXEC 和 SP_EXECUTESQL的区别

    摘要: MSSQL为我们提供了两种动态执行sql语句的命令:EXEC 和 SP_EXECUTESQL.通常SP_EXECUTESQL更具优势,因为它提供了输入输出的接口,且能够重用执行计划,大大提高执 ...

  9. 6.编写一个Java应用程序,该应用程序包括2个类:Print类和主类E。Print 类里有一个方法output()功能是输出100 ~ 999之间的所有水仙花数(各位数字的 立方和等于这个三位数本身,如: 371 = 33 + 73 + 13。)在主类E的main方法中来 测试类Print。

    Print类: package com.bao; public class Print { int g,s,b; void outPut() { for(int i=100;i<1000;i++ ...

  10. SPI模式下MCU对SD卡的控制及操作命令(转)

    源:SPI模式下MCU对SD卡的控制及操作命令 一.前言 SD 卡有两个可选的通讯协议:SD 模式和 SPI模式 SD 模式是SD 卡标准的读写方式,但是在选用SD 模式时,往往需要选择带有SD 卡控 ...