Linux df 命令长时间没有返回

今天有个报警是:
执行结果=critical : "df -h" process number is more then 5 | 脚本监控告警:请根据提示检查相关项 [contain critica

登录主机查看df-h 发现卡住很久,于是mount一下看到有个nfs卷
ip地址替换成*了,保密

*.*.*.*:/data02 on /mnt type nfs (rw,vers=4,addr=*.*.*.*,clientaddr=*.*.*.*)

于是百度了一波可能是nfs卷卸载异常了。但是同事告诉我用

strace df -h

正常是不会卡主的,异常情况可以看到卡在哪个卷那里

[logmonitor@localhost ~]$ strace df -h
execve("/bin/df", ["df", "-h"], [/* 27 vars */]) = 0
brk(0)                                  = 0x1c52000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0f0c7d000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=46602, ...}) = 0
mmap(NULL, 46602, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff0f0c71000
close(3)                                = 0
open("/lib64/libc.so.6", O_RDONLY)      = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\356\201\2233\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1928936, ...}) = 0
mmap(0x3393800000, 3750184, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3393800000
mprotect(0x339398a000, 2097152, PROT_NONE) = 0
mmap(0x3393b8a000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18a000) = 0x3393b8a000
mmap(0x3393b90000, 14632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3393b90000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0f0c70000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0f0c6f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0f0c6e000
arch_prctl(ARCH_SET_FS, 0x7ff0f0c6f700) = 0
mprotect(0x3393b8a000, 16384, PROT_READ) = 0
mprotect(0x339321f000, 4096, PROT_READ) = 0
munmap(0x7ff0f0c71000, 46602)           = 0
brk(0)                                  = 0x1c52000
brk(0x1c73000)                          = 0x1c73000
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=99164480, ...}) = 0
mmap(NULL, 99164480, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff0eaddb000
close(3)                                = 0
open("/etc/mtab", O_RDONLY)             = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=795, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0f0c7c000
read(3, "/dev/mapper/VolGroup00-LVroot / "..., 4096) = 795
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7ff0f0c7c000, 4096)            = 0
statfs("/", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=7708159, f_bfree=7114459, f_bavail=6721243, f_files=1966080, f_ffree=1883060, f_fsid={-776585995, 1108717655}, f_namelen=255, f_frsize=4096}) = 0
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=2512, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff0f0c7c000
read(3, "# Locale name alias data base.\n#"..., 4096) = 2512
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x7ff0f0c7c000, 4096)            = 0
open("/usr/share/locale/en_US.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en_US/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.UTF-8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en.utf8/LC_MESSAGES/coreutils.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/locale/en/LC_MESSAGES/coreutils.mo", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=435, ...}) = 0
mmap(NULL, 435, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff0f0c7c000
close(3)                                = 0
statfs("/sys", {f_type="SYSFS_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
statfs("/dev/pts", {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
statfs("/dev/shm", {f_type=0x1021994, f_bsize=4096, f_blocks=33052438, f_bfree=33052438, f_bavail=33052438, f_files=33052438, f_ffree=33052437, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
statfs("/boot", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=249830, f_bfree=240021, f_bavail=226914, f_files=65536, f_ffree=65497, f_fsid={-116806949, 885015568}, f_namelen=255, f_frsize=4096}) = 0
statfs("/home", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=7708159, f_bfree=7696866, f_bavail=7303650, f_files=1966080, f_ffree=1966024, f_fsid={236779102, 105200375}, f_namelen=255, f_frsize=4096}) = 0
statfs("/kdump", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=12868767, f_bfree=12855499, f_bavail=12200139, f_files=3276800, f_ffree=3276787, f_fsid={-605602565, -1856834956}, f_namelen=255, f_frsize=4096}) = 0
statfs("/tmp", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=5127839, f_bfree=5116565, f_bavail=4854421, f_files=1310720, f_ffree=1310686, f_fsid={560414392, 1857271414}, f_namelen=255, f_frsize=4096}) = 0
statfs("/var", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=5127839, f_bfree=4949767, f_bavail=4687623, f_files=1310720, f_ffree=1308530, f_fsid={989462255, 1576435300}, f_namelen=255, f_frsize=4096}) = 0
statfs("/proc/sys/fs/binfmt_misc", {f_type=0x42494e4d, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
statfs("/dba/app", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=7708159, f_bfree=6382705, f_bavail=5989489, f_files=1966080, f_ffree=1965611, f_fsid={1799800290, 416388298}, f_namelen=255, f_frsize=4096}) = 0
statfs("/mysql_tmp", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=77376512, f_bfree=77360426, f_bavail=73428266, f_files=19660800, f_ffree=19660789, f_fsid={-727106197, -1600548577}, f_namelen=255, f_frsize=4096}) = 0
statfs("/mysql_backup", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=128982638, f_bfree=128964776, f_bavail=122411176, f_files=32768000, f_ffree=32767989, f_fsid={-1985690702, 273485452}, f_namelen=255, f_frsize=4096}) = 0
statfs("/data", {f_type="EXT2_SUPER_MAGIC", f_bsize=4096, f_blocks=1290120324, f_bfree=1274709053, f_bavail=1209173053, f_files=327680000, f_ffree=327678617, f_fsid={-1399205202, -542965053}, f_namelen=255, f_frsize=4096}) = 0
statfs("/var/lib/nfs/rpc_pipefs", {f_type=0x67596969, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
statfs("/mnt", 

如上图显示,卡在了 mnt 目录。通过 mount 命令查看这个目录,是一个网络目录:
所以,相应的解决办法是:
耐心等待统计完成后返回
卸载 NFS 分区的挂载后重新统计
检查 NFS 分区访问情况
检查服务器端NFS服务是否开启

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,817评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,329评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,354评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,498评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,600评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,829评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,979评论 3 408
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,722评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,189评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,519评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,654评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,329评论 4 330
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,940评论 3 313
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,762评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,993评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,382评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,543评论 2 349

推荐阅读更多精彩内容