Chinaunix

标题: df和du的区别以及磁盘空间使用问题 [打印本页]

作者: leolein    时间: 2004-12-13 17:38
标题: df和du的区别以及磁盘空间使用问题
solaris sparc\r\nroot\r\n\r\ndf -kb 结果\r\n/dev/vx/dsk/home     12197220 11086515  988733    92%    /home\r\n\r\ndu -ks 查看/home分区情况为\r\n10      dep\r\n27      lost+found\r\n395517  oracle\r\n288     bigml.lsof\r\n212309  wei\r\n4041696 lan\r\n346074  xue\r\n520     xue.log\r\ndu相加的结果和df的结果不同?!\r\n请帮忙分析原因
作者: billquick    时间: 2004-12-13 21:30
标题: df和du的区别以及磁盘空间使用问题
which is bigger?  df or du?
作者: bear    时间: 2004-12-14 10:08
标题: df和du的区别以及磁盘空间使用问题
你在/下用du -sk home看看
作者: leolein    时间: 2004-12-14 10:15
标题: df和du的区别以及磁盘空间使用问题
一样的,/home的使用量查出来,df的基本上比du的大一倍。会不会是应用程序的问题,我有一些程序在不停的写硬盘,而且基本上都是大文件。
作者: race    时间: 2004-12-14 10:24
标题: df和du的区别以及磁盘空间使用问题
# du -sk /data1\r\n27046194        /data1\r\n# df -k /data1\r\nFilesystem            kbytes    used   avail capacity  Mounted on\r\n/dev/dsk/c2t6d0s6    48059735 27046194 20532944    57%    /data1\r\n\r\n这个是几天没运行程序的机器的结果。如果硬盘在进行操作的话,统计结果就不是那么准确了。
作者: leolein    时间: 2004-12-14 10:50
标题: df和du的区别以及磁盘空间使用问题
但这个也太不准了吧,相差几个G啊!
作者: leolein    时间: 2004-12-14 10:54
标题: df和du的区别以及磁盘空间使用问题
或者这样问吧:\r\n    df和du哪个准确?
作者: ma_hu    时间: 2004-12-14 12:43
标题: df和du的区别以及磁盘空间使用问题
man du \r\n你仔细看一下 du的计算方法. 这两个命令都是准的,用处不一样.
作者: leolein    时间: 2004-12-14 17:34
标题: df和du的区别以及磁盘空间使用问题
谢谢,就是这个原因。\r\n我因为磁盘快满了就删除了一些过期的文件,可能应用程序还在使用这些文件句柄,所以导致了我说的问题。\r\n我把所有的应用程序都停止后,du和df的结果就大致相同了
作者: leolein    时间: 2004-12-14 17:36
标题: df和du的区别以及磁盘空间使用问题
谢谢bear 提供的文档及各位的帮助!
作者: nanaskylead    时间: 2004-12-14 17:36
标题: df和du的区别以及磁盘空间使用问题
不错,这是一个盲点。。。。。。
作者: bear    时间: 2004-12-14 20:47
标题: df和du的区别以及磁盘空间使用问题
其实这样也是避免文件系统满的另外一个方面,不清理就会造成文件系统满的假象。
作者: xhui    时间: 2004-12-14 21:02
标题: df和du的区别以及磁盘空间使用问题
这个问题我在AIX上也碰到了,我们的应用跑上一段时间(几周)后,用df和du统计出来的结果相差就很大(df统计值更大),有的时候有几百M, 甚至1、2个G,我把所有的应用全部停下来后还是没有什么改变,不知道为什么?不知有没有那位大侠知道
作者: bear    时间: 2004-12-14 21:25
标题: df和du的区别以及磁盘空间使用问题
[quote]原帖由 \"xhui\"]这个问题我在AIX上也碰到了,我们的应用跑上一段时间(几周)后,用df和du统计出来的结果相差就很大(df统计值更大),有的时候有几百M, 甚至1、2个G,我把所有的应用全部停下来后还是没有什么改变,不知道为什么?不?.........[/quote 发表:\n\r\n把那个文件系统umount试试
作者: 吹拂的晨风    时间: 2004-12-14 22:17
标题: df和du的区别以及磁盘空间使用问题
bear提供的文档很不错,虽然在其他地方也见过类似的解释,可没有这些具体和明白,而且这样的讨论值得继续!顶一下!
作者: xhui    时间: 2004-12-17 22:21
标题: df和du的区别以及磁盘空间使用问题
谢谢bear的回复!\r\nunmount文件系统是可以的,以前试过。但是产生df和du不同的原因一直没有查到。按理说应用系统的进程全部终止后,操作系统应该释放进程占用的资源,可是实际上没有。不知道应用程序中什么样的调用会导致文件系统的“虚”增长。
作者: xiaoqiangxp    时间: 2005-04-12 16:33
标题: df和du的区别以及磁盘空间使用问题
我这边的solaris操作系统  用 df -k  看/export/homea占用空间为90G .用du -k看/export/homea占用空间为3G多,相差几十倍 哪位能知道这方面的原因?
作者: xiaoqiangxp    时间: 2005-04-13 12:37
标题: df和du的区别以及磁盘空间使用问题
When a file system is over allocated in this way, \r\ndf may report that the file system is more than 100% utilized\r\n\r\n那有可能 df   磁盘占用已经超了100%的情况?但是其实是正常的。业务不会受到影响?
作者: liuchanghu    时间: 2006-02-07 14:41
标题: 有什么方法查可以 把某个目录下的目录或者文件 按 文件(目录)大小,降序排列
有什么方法查可以  把某个目录下的目录或者文件 按 文件(目录)大小,降序排列,取前10个\r\n\r\n硬盘被占满了,却不知道都是什么东西?
作者: susbin    时间: 2008-01-24 05:22
A better explanation:\r\n\r\nThe difference is that whenever an application has an\r\nopen file, but the file is already deleted, then it is counted in the df\r\noutput (because the space is certainly not free) but not in du (because\r\nit is not being used by a file).\r\nhttp://lists.debian.org/debian-isp/2002/05/msg00046.html
作者: star33375249    时间: 2008-01-26 17:12
标题: 回复 #23 yuhe27913 的帖子
恩 受用了...\r\n
  1. -bash-3.00$ du -sk /home/e\r\n242104  /home/e
复制代码
\r\n\r\n
  1. -bash-3.00$ df -k /home/e\r\nFilesystem            kbytes    used   avail capacity  Mounted on\r\n192.168.2.5:/store/home\r\n                     2399169188 126412956 2150885488     6%    /home
复制代码
\r\n\r\n\r\n这个统一也是有问题的丫.....\n\n[ 本帖最后由 star33375249 于 2008-1-26 17:15 编辑 ]
作者: zhyp    时间: 2009-09-26 09:26
我看刚碰到这个问题,受教了,谢谢!
作者: honrryTD    时间: 2009-09-29 16:55
新手学习中。。。。。。。
作者: tunaau    时间: 2009-10-01 08:04
呵呵, 我也碰到这样的问题.\r\n\r\n两台设置一模一样的机器, Solaris10 x86的, root partition 10G.\r\n\r\n一台用df -h检查, /使用了28%, 另一台/用了78%.\r\n\r\n在两台机器同时用du / -h | more 一版一版翻看, 没有区别.\r\n\r\n会是什么原因呢?




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2