免费注册 查看新帖 |

Chinaunix

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

[FreeBSD] FreeBSD 根目录提示使用 100% 但实际使用6%怎么解决? [复制链接]

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-07-06 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-10-02 00:55 |只看该作者 |倒序浏览
提示:
  1. /: write failed, filesystem is full
复制代码


分区使用情况:
  1. smartly# df -hi
  2. Filesystem     Size    Used   Avail Capacity iused    ifree %iused  Mounted on
  3. /dev/ad8s1a    989M    909M    1.0M   100%    8437   132873    6%   /
  4. devfs          1.0K    1.0K      0B   100%       0        0  100%   /dev
  5. /dev/ad8s1e    989M    712K    909M     0%     437   140873    0%   /tmp
  6. /dev/ad8s1f     19G    1.4G     16G     8%  192499  2445323    7%   /usr
  7. /dev/ad8s1d    3.9G    429M    3.1G    12%     982   540712    0%   /var
  8. /dev/ad8s1g    117G    1.8G    106G     2%   69860 15827738    0%   /www
复制代码


根目录使用情况:
  1. smartly# du -hx
  2. 2.0K    ./.snap
  3. 512B    ./dev
  4. 22K    ./tmp
  5. 2.0K    ./usr
  6. 2.0K    ./var
  7. 2.0K    ./www
  8. 116K    ./etc/defaults
  9. 2.0K    ./etc/X11
  10. 8.0K    ./etc/bluetooth
  11. 4.0K    ./etc/gnats
  12. 6.0K    ./etc/gss
  13. 52K    ./etc/isdn
  14. 250K    ./etc/mail
  15. 72K    ./etc/mtree
  16. 2.0K    ./etc/ntp
  17. 38K    ./etc/pam.d
  18. 56K    ./etc/periodic/daily
  19. 6.0K    ./etc/periodic/monthly
  20. 40K    ./etc/periodic/security
  21. 14K    ./etc/periodic/weekly
  22. 118K    ./etc/periodic
  23. 4.0K    ./etc/ppp
  24. 366K    ./etc/rc.d
  25. 30K    ./etc/security
  26. 2.0K    ./etc/skel
  27. 150K    ./etc/ssh
  28. 12K    ./etc/ssl
  29. 2.0K    ./etc/zfs
  30. 1.7M    ./etc
  31. 2.0K    ./cdrom
  32. 2.0K    ./dist
  33. 986K    ./bin
  34. 22K    ./boot/defaults
  35. 2.0K    ./boot/firmware
  36. 32M    ./boot/kernel
  37. 2.0K    ./boot/modules
  38. 2.0K    ./boot/zfs
  39. 33M    ./boot
  40. 270K    ./lib/geom
  41. 5.4M    ./lib
  42. 170K    ./libexec
  43. 2.0K    ./media
  44. 2.0K    ./mnt
  45. 2.0K    ./proc
  46. 3.6M    ./rescue
  47. 10K    ./root/conf
  48. 4.0K    ./root/.ssh
  49. 28K    ./root
  50. 3.8M    ./sbin
  51. 48M    .
复制代码


实在是搞不定了,兄弟们,出手援助一下吧。

论坛徽章:
0
2 [报告]
发表于 2008-10-02 02:34 |只看该作者
你怎么看的,使用了909M,100%,怎么会是6%呢?

[ 本帖最后由 玄鹤 于 2008-10-2 02:36 编辑 ]

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
3 [报告]
发表于 2008-10-02 11:47 |只看该作者
http://www.freebsd.org/doc/en/books/faq/disks.html#DU-VS-DF
9.24. The du and df commands show different amounts of disk space available. What is going on?

You need to understand what du and df really do. du goes through the directory tree, measures how large each file is, and presents the totals. df just asks the file system how much space it has left. They seem to be the same thing, but a file without a directory entry will affect df but not du.

When a program is using a file, and you delete the file, the file is not really removed from the file system until the program stops using it. The file is immediately deleted from the directory listing, however. You can see this easily enough with a program such as more. Assume you have a file large enough that its presence affects the output of du and df. (Since disks can be so large today, this might be a very large file!) If you delete this file while using more on it, more does not immediately choke and complain that it cannot view the file. The entry is simply removed from the directory so no other program or user can access it. du shows that it is gone -- it has walked the directory tree and the file is not listed. df shows that it is still there, as the file system knows that more is still using that space. Once you end the more session, du and df will agree.

Note that Soft Updates can delay the freeing of disk space; you might need to wait up to 30 seconds for the change to be visible!

This situation is common on web servers. Many people set up a FreeBSD web server and forget to rotate the log files. The access log fills up /var. The new administrator deletes the file, but the system still complains that the partition is full. Stopping and restarting the web server program would free the file, allowing the system to release the disk space. To prevent this from happening, set up newsyslog(8 ).


http://www.freebsd.org/doc/en/bo ... DISK-MORE-THAN-FULL
9.27. How is it possible for a partition to be more than 100% full?

A portion of each UFS partition (8%, by default) is reserved for use by the operating system and the root user. df(1) does not count that space when calculating the Capacity column, so it can exceed 100%. Also, you will notice that the Blocks column is always greater than the sum of the Used and Avail columns, usually by a factor of 8%.

For more details, look up the -m option in tunefs(8 ).

[ 本帖最后由 gvim 于 2008-10-2 15:34 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2008-10-03 08:09 |只看该作者

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-07-06 06:20:00
5 [报告]
发表于 2008-10-03 09:20 |只看该作者
原帖由 玄鹤 于 2008-10-2 02:34 发表
你怎么看的,使用了909M,100%,怎么会是6%呢?

根目录我分配的是 1G 空间,但是我个了 48M,所以 100% 是不可能的。

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-07-06 06:20:00
6 [报告]
发表于 2008-10-03 09:20 |只看该作者

感谢  gvim,正在尝试中。

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-07-06 06:20:00
7 [报告]
发表于 2008-10-03 09:30 |只看该作者

是否需要进入单用户模式?
  1. smartly# tunefs -m minfree /
  2. tunefs: minimum percentage of free space changes from 8% to 0%
  3. tunefs: should optimize for space with minfree < 8%
  4. tunefs: /dev/ad8s1a: failed to write superblock
复制代码

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
8 [报告]
发表于 2008-10-03 11:59 |只看该作者
原帖由 冰力 于 2008-10-3 09:30 发表

是否需要进入单用户模式?
smartly# tunefs -m minfree /
tunefs: minimum percentage of free space changes from 8% to 0%
tunefs: should optimize for space with minfree < 8%
tunefs: /dev/ad8s1a: ...

收缩保留空间不一定是好的解决方案。你的系统负载较大的话,用fstat看看进程经常打开了哪些文件之后另外的进程对它删除,这是造成du和df不一致的原因。或者把相应的文件移到其它partition里面去。或者考虑FAQ中提到的newsyslog

论坛徽章:
1
操作系统版块每日发帖之星
日期:2016-07-06 06:20:00
9 [报告]
发表于 2008-10-11 14:40 |只看该作者
还没解决。。哈哈,问题严重了。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP