免费注册 查看新帖 |

Chinaunix

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

[SCO UNIX] df和du看到的硬盘空间使用情况不一致,如何解决? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-11-25 15:51 |只看该作者 |倒序浏览
Tru64 4.0F操作系统,usr_domain#usr mount到/usr,目录下除了系统软件还有sybase系统软件,用df命令看/usr使用了97%,但在/usr下用du去看才用了几百兆,而df命令看到的/usr总空间是4G,我试着拷了1G的文件到/usr下,用df看已经使用101%了,但文件还是能写进去,这种情况谁遇到过啊?

论坛徽章:
0
2 [报告]
发表于 2004-11-25 16:55 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

晕,还有这种情况
真想登录到你机器上看一下,能不能把df -k的情况贴出来!

论坛徽章:
0
3 [报告]
发表于 2004-11-25 17:15 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

# df -k
Filesystem       1024-blocks       Used   Available Capacity  Mount on
root_domain#root      262144    67656      191792    27%     /
/proc                            0               0           0              100%    /proc
usr_domain#usr     3723096   3470776    252320    94%     /usr

# du -sk /usr
697592  /usr


# showfdmn usr_domain

               Id              Date Created  LogPgs  Domain Name
3830b8e5.00074c20  Tue Nov 16 09:52:37 1999     512  usr_domain

  Vol   512-Blks        Free  % Used  Cmode  Rblks  Wblks  Vol Name
   1L    7446192     5765040     23%     on    128    128  /dev/vol/rootdg/vol-r
z8g

# showfsets usr_domain
usr
        Id           : 3830b8e5.00074c20.1.8001
        Files        :    20794,  SLim=        0,  HLim=        0
        Blocks (512) :  6942146,  SLim=        0,  HLim=        0
        Quota Status : user=off group=off

论坛徽章:
0
4 [报告]
发表于 2004-11-25 18:49 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

二者功能应该不同

论坛徽章:
0
5 [报告]
发表于 2004-11-25 20:35 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

这种情况是有的,我都遇到过好几次了,5。1版本的也出现过。有时候重启机就好了,不行就得把那个分区删除掉重新建立。compaq的人说打新的补丁可能会防止以后再出现这个问题。

论坛徽章:
0
6 [报告]
发表于 2004-11-25 23:09 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

删除分区?!!!
不用搞得这么兴师动众吧,重新mount一下就完了.
patch解决不了这个问题,各种unix都有这个现象的.
如果重新mount后,现象依旧,再考虑patch

论坛徽章:
0
7 [报告]
发表于 2004-11-26 10:36 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

这个是/usr分区啊,每次重起都会mount的,我这边有2,3十台机器都有这样的毛病啊!

论坛徽章:
0
8 [报告]
发表于 2004-11-28 21:21 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

我想这台机子是不是和其他机子做了cluster,如果是,主要是因为cluster中每一个文件系统都有一个cluster server端,可以通过cfsmgr -a 执行看到,server端都为另一台预留了一部分空间,默认情况下是400m,或25%,这是在sysconfigtab中的一个参数设定,在一次读写超出这个设定的情况之下,该值会自动往上调。可以通过重新mount 一次该fileset后恢复。

论坛徽章:
0
9 [报告]
发表于 2004-12-14 22:27 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

在Solaris讨论区看到了一篇文档,应该对大家认识df和du有帮助,摘抄如下:
This article explains how reporting disk usage du and reporting free disk space
on file systems df may show different numbers.
du
The du user command gives the number of kilobytes contained in all files and, recursively(递归), directories within each specified directory or file (filename).
If filename is missing, `.' (the current directory) is used. A file which
has multiple links to it is only counted once.
EXAMPLE:
system % du
5 ./jokes
33 ./squash
44 ./tech.papers/lpr.document
217 ./tech.papers/new.manager
401 ./tech.papers
144 ./memos
80 ./letters
388 ./window
93 ./messages
15 ./useful.news
1211 .
Note that the last number, 1211 is the grand total (in kilobytes) for the directory.
df
The df user command displays the following information:
amount of disk space occupied by currently mounted file systems
the amount of used and available space
how much of the file system's total capacity has been used
Used without arguments, df reports on all mounted file systems.
EXAMPLE:
system % df
Filesystem kbytes used avail capacity Mounted on
/dev/ip0a 7445 4714 1986 70% /
/dev/ip0g 42277 35291 2758 93% /usr
Note: used plus avail is less than the amount of space in the file system
(kilobytes) because the system reserves a fraction of the space in the file
system to allow its allocation routines to work well. The amount reserved is
typically about 10%. (This may be adjusted using the tunefs command. Refer to
the man pages on tunefs(  for more information.) When all the space on a file
system, except for this reserve, is in use, only the super-user can allocate
new files and data blocks to existing files. This, however, may cause the file
system to be over allocated. When a file system is over allocated in this way,
df may report that the file system is more than 100% utilized.
If arguments to df are disk partitions (for example, /dev/ip0as or path names), df produces a report on the file system containing the named file. Thus, df shows the amount of space on the file system containing the current directory.
Problem Definition
This section gives the technical explanation of why du and df sometimes report different totals of disk space usage.
When a program that is running in the background writes to a file while the
process is running, the file to which this process is writing is deleted.
Running df and du shows a discrepancy in the amount of disk space usage. The df command shows a higher value.
Explanation Summary
When you open a file, you get a pointer. Subsequent writes to this file references this file pointer. The write call does not check to see if the file is there or not. It just writes to the specified number of characters starting at a predetermined location. Regardless of whether the file exist or not, disk blocks are used by the write operation.
The df command reports the number of disk blocks used while du goes through the file structure and and reports the number of blocks used by each directory. As far as du is concerned, the file used by the process does not exist, so it does not report blocks used by this phantom file. But df keeps track of disk blocks used, and it reports the blocks used by this phantom file.

论坛徽章:
0
10 [报告]
发表于 2004-12-15 09:39 |只看该作者

df和du看到的硬盘空间使用情况不一致,如何解决?

看看以前的帖子,有有关这方面的解决方法。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP